HP BL680c XenEnterprise Management API - Page 11
Example Interactive Session, Introduction
UPC - 884420396314
View all HP BL680c manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 11 highlights
1.5. EXAMPLE INTERACTIVE SESSION CHAPTER 1. INTRODUCTION In this case the start message has been rejected, because the VM is a template, and so an error response has been returned. These high-level errors are returned as structured data (rather than as XML-RPC faults), allowing them to be internationalised. Rather than querying fields individually, whole records may be returned at once. To retrieve the record of a single object as a python dictionary: >>> record = xen.VM.get_record(session, all_templates[0])['Value'] >>> record['power_state'] 'Halted' >>> record['name_label'] 'XenSource P2V Server' To retrieve all the VM records in a single call: >>> records = xen.VM.get_all_records(session)['Value'] >>> records.keys() ['OpaqueRef:1', 'OpaqueRef:2', 'OpaqueRef:3', 'OpaqueRef:4' ] >>> records['OpaqueRef:1']['name_label'] 'RHEL 4.1 Autoinstall Template' 11