Package ganeti :: Package hypervisor :: Package hv_kvm :: Module monitor :: 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)
str(x)
source code
 
__eq__(self, other) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Static Methods [hide private]
QmpMessage
BuildFromJsonString(json_string)
Build a QmpMessage from a JSON encoded string.
source code
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, data)
(Constructor)

source code 

Creates a new QMP message based on the passed data.

Overrides: object.__init__

__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

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)