Difference between revisions of "API Detail"
From Luna Node
(Created page with "This page includes details about the available API actions. See [API] to get started. Each action has a category and an action identifier, and can also accept some parameters...") |
(→Examples) |
||
Line 28: | Line 28: | ||
api.request('vm', 'start', {'vm_id': 55}) # boot VM with id=55 | api.request('vm', 'start', {'vm_id': 55}) # boot VM with id=55 | ||
print api.request('vm', 'vnc', {'vm_id': 56})['vnc_url'] # print VNC URL for this VM | print api.request('vm', 'vnc', {'vm_id': 56})['vnc_url'] # print VNC URL for this VM | ||
− | print api.request('vm', 'info', {'vm_id': 56})['info']['primaryip'] # print VM id=56 primary IP | + | print api.request('vm', 'info', {'vm_id': 56})['info']['primaryip'] # print VM id=56 primary IP</nowiki> |
− | </nowiki> | + |
Revision as of 04:05, 23 May 2015
This page includes details about the available API actions. See [API] to get started.
Each action has a category and an action identifier, and can also accept some parameters.
Virtual Machine
Virtual machine actions have the "vm" category, and allow you to provision and manage virtual machine instances.
Basic Operations
Actions
- start: boot the VM
- stop: shutoff the VM
- reboot: soft reboot the VM
- info: show VM details
- delete: remove VM
- rescue: boot VM to initial OS
- vnc: get VNC URL
Parameters
All basic operations take a single vm_id parameter.
Examples
api.request('vm', 'start', {'vm_id': 55}) # boot VM with id=55 print api.request('vm', 'vnc', {'vm_id': 56})['vnc_url'] # print VNC URL for this VM print api.request('vm', 'info', {'vm_id': 56})['info']['primaryip'] # print VM id=56 primary IP