ganeti :: hypervisor :: hv_kvm :: QmpMessage :: Class QmpMessage
[hide private]
[frames] | no frames]

Class QmpMessage

source code

QEMU Messaging Protocol (QMP) message.

Instance Methods [hide private]
 
__init__(self, data)
Creates a new QMP message based on the passed data.
source code
 
__getitem__(self, field_name)
Get the value of the required field if present, or None.
source code
 
__setitem__(self, field_name, field_value)
Set the value of the required field_name to field_value.
source code
 
__len__(self)
Return the number of fields stored in this QmpMessage.
source code
 
__delitem__(self, key)
Delete the specified element from the QmpMessage.
source code
 
__str__(self) source code
 
__eq__(self, other) source code
Static Methods [hide private]
QmpMessage
BuildFromJsonString(json_string)
Build a QmpMessage from a JSON encoded string.
source code
Method Details [hide private]

__getitem__(self, field_name)
(Indexing operator)

source code 

Get the value of the required field if present, or None.

Overrides the [] operator to provide access to the message data, returning None if the required item is not in the message

Returns:
the value of the field_name field, or None if field_name is not contained in the message

BuildFromJsonString(json_string)
Static Method

source code 

Build a QmpMessage from a JSON encoded string.

Parameters:
  • json_string (str) - JSON string representing the message
Returns: QmpMessage
a QmpMessage built from json_string