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

Add support for resources with dashes in name #80

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

julozi
Copy link

@julozi julozi commented Jul 31, 2019

Proxmox API includes a few resources with dashes (-) in their name (like /api2/json/nodes/{node}/qemu/{vmid}/agent/get-host-name).
However the dash character (-) is not authorized in Python object attributes.

This PR adds support for this kind of resource's name by replacing dashes by underscores.

Exemple code :

client.nodes('my_node').qemu(12).agent.get_host_name.get()

will call the API URL : /api2/json/nodes/my_node/qemu/12/agent/get-host-name

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 79.208% when pulling de51882 on julozi:support_dash_resources into f7874b5 on swayf:develop.

@morph027
Copy link

@julozi Would you mind re-creating this PR for https://github.com/proxmoxer/proxmoxer ?

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

Successfully merging this pull request may close these issues.

None yet

3 participants