API Detail

From Luna Node
Revision as of 04:05, 23 May 2015 by Favyen Bastani (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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