Comments (3)
Hello Bill,
I had a very similar problem to the one that you did and was pretty frustrated. This issue helped me understand the design of this wrapper better, so I am responding with my solution:
Use the interactive python interpreter to inspect the proxmox object. I did this by putting a breakpoint in my script import pdb; pdb.set_trace()
after I had instantiated it. As you observed, one of the attributes of proxmox object is base_url
. The README touches on various different ways to construct a query, but doesn't really explain what is going on under the hood or how to invoke the verbs.
proxmox.get('nodes/{0}/qemu/{1}/config'.format(node['node'], vm['vmid']))
could also be constructed as: proxmox.nodes(node['node']).qemu(vm['vmid']).config.get()
(without the variable interpolation).
Your construction (the former) results in: 'base_url': 'https://pve1.int.wscnet.com:8006/api2/json/get/nodes/pve5/qemu/117/config'
. Note that 'get' has been inserted into the url after 'json'.
The latter construction results in: 'base_url': 'https://pve1.int.wscnet.com:8006/api2/json/nodes/pve5/qemu/117/config'
and then subsequently invokes the GET verb on the url.
Manipulating the proxmox object in the interactive interpreter was key to understanding how to construct the url that I wanted. By thinking of the proxmox object as the base url and the subsequent attributes as elements for constructing the url, I was able to observe how the urls were constructed and how to successfully invoke the get()
method.
Thanks for the wrapper @swayf!
-Jarrod
from proxmoxer.
Thank you Jarrod for the help with explanation =).. So I close the issue for now
from proxmoxer.
how we can use base url with CREATE ?
from proxmoxer.
Related Issues (20)
- KVM current disk space not showing
- 500 internal server HOT 5
- TypeError: __call__() takes from 1 to 2 positional arguments but 7 were given HOT 2
- 2FA support?
- Converting a vm to a template doesn't return Unique Task ID
- Problems with version 5.3 HOT 3
- Is it possible to get all VMs config within in a pool by single API call?
- get vm config of current config
- Encryption of SSH keys
- how i can creeate VM with api ? HOT 7
- problems with custom post request. HOT 1
- i want create contener and i get this error
- creation problm
- How to add a disk to already created VM?
- PVE 6 Beta: 'authorization on proxmox cluster failed with exception: invalid literal for float(): 6-0.1' HOT 10
- Still working (python3)? HOT 3
- authorization on proxmox cluster failed with exception: invalid literal for float(): 6.0-7
- What is the status of this project? HOT 1
- IPv6 not supported
- boolean parameter not serialized correctly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxmoxer.