HP BL680c XenServer Software Development Kit Guide 4.1.0 - Page 19

Where to look next, Argument, Description

Page 19 highlights

Overview of the XenServer API Argument uuid Description the uuid of the VM; required only if not using the reference For example: curl http://root:foo@xenserver/export&uuid=[VM UUID]&task_id= [task ID] -o export To export just the metadata, use the URI http://server/export_metadata The import protocol is similar, using HTTP(S) PUT. The [session_id] and [task_id] arguments are as for the export. The [ref] and [uuid] are not used; a new reference and uuid will be generated for the VM. There are some additional parameters: Argument restore force sr_id Description if this parameter is true, the import is treated as replacing the original VM the implication of this currently is that the MAC addresses on the VIFs are exactly as the export was, which will lead to conflicts if the original VM is still being run. if this parameter is true, any checksum failures will be ignored (the default is to destroy the VM if a checksum error is detected) The reference of an SR into which the VM should be imported. The default behaviour is to import into the Pool.default_SR. To import just the metadata, use the URI http://server/import_metadata 3.5. Where to look next In this chapter we have presented a brief high-level overview of the API and its object-model. The aim here is not to present the detailed semantics of the API, but just to provide enough background for you to start reading the code samples of the next chapter and to find your way around the more detailed XenEnterprise Management API reference document. There are a number of places you can find more information: • The Administrators Guide contains an overview of the xe CLI. Since a good deal of xe commands are a thin veneer over the API, playing with xe is a good way to start finding your way around the API object model described in this chapter. • The code samples in the next chapter provide some concrete instances of API coding in a variety of client languages. • The XenEnterprise Management API reference document provides a more detailed description of the API semantics as well as describing the the format of XML/RPC messages on the wire. and • There are a few scripts that use the API in the XenServer Host dom0 itself. For example, "/opt/xensource/libexec/shutdown" is a python program that cleanly shuts VMs down. This script is invoked when the host itself is shutdown. 13

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37

Overview of the XenServer API
13
Argument
Description
uuid
the uuid of the VM; required only if not using the reference
For example:
curl http://root:foo@xenserver/export&uuid=[VM UUID]&task_id= [task ID] -o export
To export just the metadata, use the URI http://server/export_metadata
The import protocol is similar, using HTTP(S) PUT. The [session_id] and [task_id] arguments are as for the
export. The [ref] and [uuid] are not used; a new reference and uuid will be generated for the VM. There are
some additional parameters:
Argument
Description
restore
if this parameter is
true
, the import is treated as replacing the original VM -
the implication of this currently is that the MAC addresses on the VIFs are
exactly as the export was, which will lead to conflicts if the original VM is
still being run.
force
if this parameter is
true
, any checksum failures will be ignored (the default
is to destroy the VM if a checksum error is detected)
sr_id
The reference of an SR into which the VM should be imported. The default
behaviour is to import into the
Pool.default_SR
.
To import just the metadata, use the URI http://server/import_metadata
3.5. Where to look next
In this chapter we have presented a brief high-level overview of the API and its object-model. The aim here
is not to present the detailed semantics of the API, but just to provide enough background for you to start
reading the code samples of the next chapter and to find your way around the more detailed
XenEnterprise
Management API
reference document.
There are a number of places you can find more information:
The
Administrators Guide
contains an overview of the
xe
CLI. Since a good deal of
xe
commands are a
thin veneer over the API, playing with
xe
is a good way to start finding your way around the API object
model described in this chapter.
The code samples in the next chapter provide some concrete instances of API coding in a variety of client
languages.
The
XenEnterprise Management API
reference document provides a more detailed description of the API
semantics as well as describing the the format of XML/RPC messages on the wire. and
There are a few scripts that use the API in the XenServer Host dom0 itself. For example, "/opt/xen-
source/libexec/shutdown" is a python program that cleanly shuts VMs down. This script is invoked when
the host itself is shutdown.