daemonthread / pyproxmox Goto Github PK
View Code? Open in Web Editor NEWA Python wrapper for the Proxmox 2.x API
A Python wrapper for the Proxmox 2.x API
Could you specify software license for this module?
Hi, this is not exactly an issue, but an addition to the functionality:
(didn't know where to put it other than here)
I created an Icinga/Nagios script to check all backups in a single check using your Proxmox API.
See:
https://github.com/roland-gsell/check_proxmox_backups
I needed to add a call for cluster/resources, like one of your pull requests already suggests.
I like to start/stop a specific vm on the node where the vm currently exists.
Therefore I need either to know the current node or a global start.
I dont see any global start command so at first a getNodes would be good
followed by getNodeOfVM(vmId)
There is a critical documentation bug within your first example for createOpenvzContainer:
post_data = {'ostemplate':'localvztmpl/debian-6.0-standard_6.0-4_amd64.tar.gz',
The ":" is missing within this line. It has to be:
post_data = {'ostemplate':'local:vztmpl/debian-6.0-standard_6.0-4_amd64.tar.gz',
This cost me 3 hours of my life to find out. :(
There's no provided method to list all openvz containers of a node.
This does the trick however:
>>> data = pve.connect('get','nodes/NODENAME/openvz', None)
>>> [ct['name'] for ct in data['data']]
Hi again!
May be code need serious review. For example in pyproxmox.py:534 - syntax error. In not 'get' requests you are using params keyword instead data. So we have totally broken wrapper.
And may be I`m asking for too much but how about using PEP8 in code?
I'm trying to get the pyproxmox code to create a Container from commandline for me.
# Get Proxmox Authentication Token
auth = prox_auth('<redacted_hostname>','root@pam','<redacted_password>')
# Instantiate the API with the Authentication
proxmox_api = pyproxmox(auth)
post_data = {
'ostemplate':'data-templates:vztmpl/centos-6-default_20161207_amd64-chef-enabled.tar.xz',
'vmid': 106,
'cpus':cores,
'hostname': fqdn,
'description': 'Template',
'memory': memory,
'net0': 'name=eth0,bridge=vmbr0,ip=%s/16,gw=172.29.254.10' % ip,
'storage': 'data',
'password':'template'
}
print post_data
result = proxmox_api.createOpenvzContainer(hostname,post_data)
print result
The post data looks like this:
{'password': 'template', 'description': 'Template', 'memory': '4096', 'storage': 'data', 'hostname': 'pietje.puk', 'vmid': 106, 'cpus': '1', 'ostemplate': 'data-templates:vztmpl/centos-6-default_20161207_amd64-chef-enabled.tar.xz', 'net0': 'name=eth0,bridge=vmbr0,ip=172.29.111.126/16,gw=172.29.254.10'}
The result looks like this. Whatever i try, i'm only getting the data: None value back.
/usr/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py:821: InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.org/en/latest/security.html
InsecureRequestWarning)
{u'data': None}
Any ideas?
Hi!
First of all, congratulations and thanks for this great job you've done.
Anyway, I have to write about something that has provided me a headache:
A few days ago I've installed pyproxmox with "sudo pip install pyproxmox".
Everything seemed to work properly, but when I tried to clone a qemu template using "cloneVirtualMachine" I got an error "pyproxmox has no attribute cloneVirtualMachine".
After checking the code, I realized that it was true: the source code of the pyproxmox version I had installed with pip didn't include that method!!
I've had to download it from you github project and manually substitute the "/usr/local/lib/python2.7/dist-packagespyproxmox.py" file with the new one.
Now it works properly.
Regards.
Hello!
I am using your library and installing it from pypi, but i see that many good features added in last time. So, can you plz add setup.py to repository or update package on pypi?
Thank you.
Hi, tested pyproxmox yesterday and found it really useful. I plan to use it for various administrative purposes (shinken-proxmox integration would be a first goal).
However, there's no distutils/setuptools/distribute packaging in the source code.
'pip install pyproxmox' does not automatically install the required 'requests'
README says to install 'requests' as well, but that's counter-intuitive, and not what the average python guy testing packages from pypi will expect.
Hello ,
I was trying new virtual machine with createVirtualMachine function. I send to request but return to json error.
{u'errors': {u'password': u'property is not defined in schema and the schema does not allow additional properties'}, u'data': None}
After that, I noticed that the Proxmox api documentation changed. I wanted to share with you.
[https://pve.proxmox.com/pve-docs/api-viewer/index.html]
There is currently no errorhandling existing for username and password faults
Hi,
When trying to use your wrapper, i get the following error with python2.6:
Traceback (most recent call last):
File "./toto.py", line 4, in
from pyproxmox import prox_auth,pyproxmox
File "/usr/local/lib/python2.6/dist-packages/pyproxmox.py", line 374
post_data = {'target', str(target)}
^
SyntaxError: invalid syntax
Append when importing
Thank you in advance for your help,
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.