Giter VIP home page Giter VIP logo

Comments (3)

jarrodjackson avatar jarrodjackson commented on August 22, 2024 1

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.

swayf avatar swayf commented on August 22, 2024

Thank you Jarrod for the help with explanation =).. So I close the issue for now

from proxmoxer.

hocineKHE avatar hocineKHE commented on August 22, 2024

how we can use base url with CREATE ?

from proxmoxer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.