https://github.com/johnelse/xenapi-helpers
Helper scripts for working with XenAPI interactively via ipython
https://github.com/johnelse/xenapi-helpers
Last synced: 8 months ago
JSON representation
Helper scripts for working with XenAPI interactively via ipython
- Host: GitHub
- URL: https://github.com/johnelse/xenapi-helpers
- Owner: johnelse
- Created: 2013-09-08T00:57:19.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2016-06-07T11:07:38.000Z (about 10 years ago)
- Last Synced: 2025-05-07T17:05:27.411Z (about 1 year ago)
- Language: Python
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
An interactive shell for XenAPI. Requires ipython.
Usage:
```
./run [ []]
```
Example:
```
$ ./run myxenserver
You now have the following objects to play with:
session - an API session object for myxenserver.
api - an API dispatcher for myxenserver (just an alias for session.xenapi).
In [1]: hosts = api.host.get_all()
In [2]: api.host.get_address(hosts[0])
Out[2]: '192.168.1.123'
In [3]: api.host.get_PIFs(hosts[0])
Out[3]:
['OpaqueRef:d6ffc2d8-de83-5958-abe2-6e3c4239708b',
'OpaqueRef:7fe8a78a-5533-c24e-1dcd-fe7ad87add2d',
'OpaqueRef:f44b4c44-155a-1bc6-27be-63ed3e45e52b',
'OpaqueRef:f38a7a96-32de-3bac-12ac-d099c7ddd715']
In [4]: api.host.set_name_label(hosts[0], "foo")
Out[4]: ''
```