class ConfigObject(outils.ValidatedSlots):
Known subclasses: ganeti.confd.client.ConfdUpcallPayload
, ganeti.objects.BlockDevStatus
, ganeti.objects.ConfdReply
, ganeti.objects.ConfdRequest
, ganeti.objects.ConfigData
, ganeti.objects.Disk
, ganeti.objects.ExtStorage
, ganeti.objects.Filter
, ganeti.objects.ImportExportOptions
, ganeti.objects.ImportExportStatus
, ganeti.objects.InstanceConsole
, ganeti.objects.InstancePolicy
, ganeti.objects.LvmPvInfo
, ganeti.objects.MasterNetworkParameters
, ganeti.objects.MigrationStatus
, ganeti.objects.NIC
, ganeti.objects.NodeDiskState
, ganeti.objects.NodeHvState
, ganeti.objects.OS
, ganeti.objects.QueryFieldDefinition
, ganeti.objects.QueryFieldsRequest
, ganeti.objects.TaggableObject
, ganeti.query.ExtStorageInfo
, ganeti.query.OsInfo
, ganeti.objects._QueryResponseBase
A generic config object.
It has the following properties:
- provides somewhat safe recursive unpickling and pickling for its classes
- unset attributes which are defined in slots are always returned as None instead of raising an error
Classes derived from this must always declare __slots__ (we use many config objects and the memory reduction is useful)
Class Method |
|
Create an object from a dictionary. |
Method | __getattr__ |
Undocumented |
Method | __repr__ |
Implement __repr__ for ConfigObjects. |
Method | __setstate__ |
Undocumented |
Method |
|
Makes a deep copy of the current object and its children. |
Method |
|
Convert to a dict holding only standard python types. |
Method |
|
Fill defaults for missing configuration values. |
Method |
|
Validates the slots. |
Class Variable | __slots__ |
Undocumented |
Inherited from ValidatedSlots
:
Class Method |
|
Compute the list of all declared slots for a class. |
Method | __init__ |
Constructor for BaseOpCode. |
ganeti.objects.ConfigData
, ganeti.objects.Disk
, ganeti.objects.TaggableObject
, ganeti.objects._QueryResponseBase
Create an object from a dictionary.
This generic routine takes a dict, instantiates a new instance of the given class, and sets attributes based on the dict content.
As for `ToDict`, this does not work if the class has children who are ConfigObjects themselves (e.g. the nics list in an Instance), in which case the object should subclass the function and alter the objects.
ganeti.objects.ConfigData
, ganeti.objects.Disk
, ganeti.objects.TaggableObject
, ganeti.objects._QueryResponseBase
Convert to a dict holding only standard python types.
The generic routine just dumps all of this object's attributes in a dict. It does not work if the class has children who are ConfigObjects themselves (e.g. the nics list in an Instance), in which case the object should subclass the function in order to make sure all objects returned are only standard python types.
Private fields can be included or not with the _with_private switch. The actual implementation of this switch is left for those subclassses with private fields to implement.
Parameters | |
_with | if True, the object will leak its private fields in the dictionary representation. If False, the values will be replaced with None. |
ganeti.objects.Cluster
, ganeti.objects.ConfigData
, ganeti.objects.Disk
, ganeti.objects.Instance
, ganeti.objects.Node
, ganeti.objects.NodeGroup
Fill defaults for missing configuration values.
This method will be called at configuration load time, and its implementation will be object dependent.
ganeti.outils.ValidatedSlots.Validate
ganeti.objects.InstanceConsole
Validates the slots.
This method returns None
if the validation succeeds, or raises an exception otherwise.
This method must be implemented by the child classes.
Returns | |
NoneType | None , if the validation succeeds |
Raises | |
Exception | validation fails |
ganeti.outils.ValidatedSlots.__slots__
ganeti.confd.client.ConfdUpcallPayload
, ganeti.objects.BlockDevStatus
, ganeti.objects.ConfdReply
, ganeti.objects.ConfdRequest
, ganeti.objects.ConfigData
, ganeti.objects.Disk
, ganeti.objects.ExtStorage
, ganeti.objects.Filter
, ganeti.objects.ImportExportOptions
, ganeti.objects.ImportExportStatus
, ganeti.objects.InstanceConsole
, ganeti.objects.LvmPvInfo
, ganeti.objects.MasterNetworkParameters
, ganeti.objects.MigrationStatus
, ganeti.objects.NIC
, ganeti.objects.NodeDiskState
, ganeti.objects.NodeHvState
, ganeti.objects.OS
, ganeti.objects.QueryFieldDefinition
, ganeti.objects.QueryFieldsRequest
, ganeti.objects.TaggableObject
, ganeti.query.ExtStorageInfo
, ganeti.query.OsInfo
, ganeti.objects._QueryResponseBase
Undocumented