Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with custom post request. #74

Open
3JIou opened this issue Apr 17, 2019 · 1 comment
Open

problems with custom post request. #74

3JIou opened this issue Apr 17, 2019 · 1 comment

Comments

@3JIou
Copy link

3JIou commented Apr 17, 2019

i have some problems with custom post request
code example

    nextid = proxmox.cluster.nextid.get()
    node5 = proxmox.nodes('proxmox5')
    node5.qemu.create(
        '/api2/json/nodes/proxmox5/qemu/%s/clone' % template_id,
        data={'newid': nextid}
    )

answer:

proxmoxer.core.ResourceException: 400 Bad Request: b'{"data":null,"errors":{"data":"property is not defined in schema and the schema does not allow additional properties","newid":"property is missing and it is not optional"}}'

problem in data parameter.

/api2/json/nodes/proxmox5/qemu/100/clone {'data': {'newid': '102'}}

but need

/api2/json/nodes/proxmox5/qemu/100/clone {'newid': '102'}
@3JIou
Copy link
Author

3JIou commented Apr 17, 2019

fix:

./proxmoxer/core.py
string 74
resp = self._store["session"].request(method, url, data=data["data"] or None, params=params)

or something like:

        if data is not None and "data" in data:
            data = data["data"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant