Package ganeti :: Package masterd :: Module iallocator :: Class IARequestBase
[hide private]
[frames] | no frames]

Class IARequestBase

source code


A generic IAllocator request object.

Nested Classes [hide private]
  __metaclass__
Meta class for request definitions.
Instance Methods [hide private]
 
__init__(self, **kwargs)
Constructor for IARequestBase.
source code
NoneType
Validate(self)
Validates all parameters of the request.
source code
 
GetRequest(self, cfg)
Gets the request data dict.
source code
 
ValidateResult(self, ia, result)
Validates the result of an request.
source code

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

Class Methods [hide private]

Inherited from outils.ValidatedSlots: GetAllSlots

Class Variables [hide private]
  MODE = NotImplemented
  REQ_PARAMS = []
  REQ_RESULT = NotImplemented
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, **kwargs)
(Constructor)

source code 

Constructor for IARequestBase.

The constructor takes only keyword arguments and will set attributes on this object based on the passed arguments. As such, it means that you should not pass arguments which are not in the REQ_PARAMS attribute for this class.

Overrides: object.__init__

Validate(self)

source code 

Validates all parameters of the request.

This method returns None if the validation succeeds, or raises an exception otherwise.

Returns: NoneType
None, if the validation succeeds
Raises:
  • Exception - validation fails
Overrides: outils.ValidatedSlots.Validate

GetRequest(self, cfg)

source code 

Gets the request data dict.

Parameters:
  • cfg - The configuration instance

ValidateResult(self, ia, result)

source code 

Validates the result of an request.

Parameters:
  • ia - The IAllocator instance
  • result - The IAllocator run result
Raises: