ia64/xen-unstable

changeset 13281:568efb79a0f6

Fix examples to have correct class names and error handling.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Fri Jan 05 15:52:58 2007 +0000 (2007-01-05)
parents f43fc1d6c1a6
children df00f7a98821
files docs/xen-api/wire-protocol.tex
line diff
     1.1 --- a/docs/xen-api/wire-protocol.tex	Fri Jan 05 15:51:39 2007 +0000
     1.2 +++ b/docs/xen-api/wire-protocol.tex	Fri Jan 05 15:52:58 2007 +0000
     1.3 @@ -149,16 +149,16 @@ We ought to support at least
     1.4  The XML-RPC interface is session-based; before you can make arbitrary RPC calls
     1.5  you must login and initiate a session. For example:
     1.6  \begin{verbatim}
     1.7 -   session_id    Session.login_with_password(string uname, string pwd)
     1.8 +   session_id    session.login_with_password(string uname, string pwd)
     1.9  \end{verbatim}
    1.10  Where {\tt uname} and {\tt password} refer to your username and password
    1.11  respectively, as defined by the Xen administrator.
    1.12 -The {\tt session\_id} returned by {\tt Session.Login} is passed to subequent
    1.13 -RPC calls as an authentication token.
    1.14 +The {\tt session\_id} returned by {\tt session.login_with_password} is passed
    1.15 +to subequent RPC calls as an authentication token.
    1.16  
    1.17 -A session can be terminated with the {\tt Session.Logout} function:
    1.18 +A session can be terminated with the {\tt session.logout} function:
    1.19  \begin{verbatim}
    1.20 -   void          Session.Logout(session_id session)
    1.21 +   void          session.logout(session_id session)
    1.22  \end{verbatim}
    1.23  
    1.24  \subsection{Synchronous and Asynchronous invocation}
    1.25 @@ -251,14 +251,20 @@ call takes the session token as the only
    1.26    '2045dbc0-0734-4eea-9cb2-b8218c6b5bf2', '3202ae18-a046-4c32-9fda-e32e9631866e']
    1.27  \end{verbatim}
    1.28  
    1.29 -Note the VM references are internally UUIDs. Once a reference to a VM has been acquired a lifecycle operation may be invoked:
    1.30 +The VM references here are UUIDs, though they may not be that simple in the
    1.31 +future, and you should treat them as opaque strings.  Once a reference to a VM
    1.32 +has been acquired a lifecycle operation may be invoked:
    1.33  
    1.34  \begin{verbatim}
    1.35  >>> xen.VM.start(session, all_vms[3], False)
    1.36 -{'Status': 'Failure', 'ErrorDescription': 'Operation not implemented'}
    1.37 +{'Status': 'Failure', 'ErrorDescription': ['VM_BAD_POWER_STATE', 'Halted', 'Running']}
    1.38  \end{verbatim}
    1.39  
    1.40 -In this case the {\tt start} message has not been implemented and an error response has been returned. Currently these high-level errors are returned as structured data (rather than as XMLRPC faults), allowing for internationalised errors in future. Finally, here are some examples of using accessors for object fields:
    1.41 +In this case the {\tt start} message has been rejected, because the VM is
    1.42 +already running, and so an error response has been returned.  These high-level
    1.43 +errors are returned as structured data (rather than as XML-RPC faults),
    1.44 +allowing them to be internationalised.  Finally, here are some examples of
    1.45 +using accessors for object fields:
    1.46  
    1.47  \begin{verbatim}
    1.48  >>> xen.VM.get_name_label(session, all_vms[3])['Value']