Package ganeti :: Module opcodes :: Class OpInstanceMultiAlloc
[hide private]
[frames] | no frames]

Class OpInstanceMultiAlloc

source code


Allocates multiple instances.

Nested Classes [hide private]

Inherited from BaseOpCode: __metaclass__

Instance Methods [hide private]
dict
__getstate__(self)
Generic serializer.
source code
 
__setstate__(self, state)
Generic unserializer.
source code
 
Validate(self, set_defaults)
Validates this opcode.
source code

Inherited from OpCode: Summary, TinySummary

Inherited from outils.ValidatedSlots: __init__

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

Class Methods [hide private]

Inherited from OpCode: LoadOpCode

Inherited from BaseOpCode: GetAllParams

Inherited from outils.ValidatedSlots: GetAllSlots

Class Variables [hide private]
  OP_PARAMS = [_POpportunisticLocking, _PIAllocFromDesc("Ialloca...
List of opcode attributes, the default values they should get if not already defined, and types they must match.
  _JOB_LIST = ht.Comment("List of submitted jobs")(TJobIdList)
  ALLOCATABLE_KEY = "allocatable"
  FAILED_KEY = "allocatable"
  OP_RESULT = ht.TStrictDict(True, True, {constants.JOB_IDS_KEY:...
Callable to verify opcode result

Inherited from OpCode: OP_DSC_FIELD, OP_DSC_FORMATTER, OP_ID, WITH_LU

Instance Variables [hide private]

Inherited from OpCode: dry_run, priority

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__getstate__(self)

source code 

Generic serializer.

Returns: dict
the state as a dictionary
Overrides: BaseOpCode.__getstate__

__setstate__(self, state)

source code 

Generic unserializer.

This method just restores from the serialized state the attributes of the current instance.

Parameters:
  • state (dict) - the serialized opcode data
Overrides: BaseOpCode.__setstate__

Validate(self, set_defaults)

source code 

Validates this opcode.

We do this recursively.

Parameters:
  • set_defaults - Whether to set default values
Raises:
Overrides: outils.ValidatedSlots.Validate

Class Variable Details [hide private]

OP_PARAMS

List of opcode attributes, the default values they should get if not already defined, and types they must match.
Value:
[_POpportunisticLocking, _PIAllocFromDesc("Iallocator used to allocate\
 all the instances"), ("instances", ht.EmptyList, ht.TListOf(ht.TInsta\
nceOf(OpInstanceCreate)), "List of instance create opcodes describing \
the instances to allocate"),]

OP_RESULT

Callable to verify opcode result
Value:
ht.TStrictDict(True, True, {constants.JOB_IDS_KEY: _JOB_LIST, ALLOCATA\
BLE_KEY: ht.TListOf(ht.TNonEmptyString), FAILED_KEY: ht.TListOf(ht.TNo\
nEmptyString),})