Package ganeti :: Package rapi :: Module baserlib :: Class OpcodeResource
[hide private]
[frames] | no frames]

Class OpcodeResource

source code


Base class for opcode-based RAPI resources.

Instances of this class automatically gain handler functions through _MetaOpcodeResource for any method for which a $METHOD$_OPCODE variable is defined at class level. Subclasses can define a Get$Method$OpInput method to do their own opcode input processing (e.g. for static values). The $METHOD$_RENAME variable defines which values are renamed (see baserlib.FillOpcode).

Nested Classes [hide private]
  __metaclass__
Meta class for RAPI resources.
Instance Methods [hide private]
 
_GetDefaultData(self) source code
 
_GetRapiOpName(self)
Extracts the name of the RAPI operation from the class name
source code
 
_GetCommonStatic(self)
Return the static parameters common to all the RAPI calls
source code
 
_GenericHandler(self, opcode, rename, fn) source code

Inherited from ResourceBase: GetClient, SubmitJob, __init__, dryRun, getBodyParameter, useBulk, useForce, useLocking

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

Class Variables [hide private]
  DELETE_OPCODE
Set this to a class derived from opcodes.OpCode to automatically generate a DELETE handler submitting the opcode
  DELETE_RENAME
Set this to rename parameters in the DELETE handler (see baserlib.FillOpcode)
  GET_OPCODE
Set this to a class derived from opcodes.OpCode to automatically generate a GET handler submitting the opcode
  GET_RENAME
Set this to rename parameters in the GET handler (see baserlib.FillOpcode)
  POST_OPCODE
Set this to a class derived from opcodes.OpCode to automatically generate a POST handler submitting the opcode
  POST_RENAME
Set this to rename parameters in the POST handler (see baserlib.FillOpcode)
  PUT_OPCODE
Set this to a class derived from opcodes.OpCode to automatically generate a PUT handler submitting the opcode
  PUT_RENAME
Set this to rename parameters in the PUT handler (see baserlib.FillOpcode)

Inherited from ResourceBase: DELETE_ACCESS, GET_ACCESS, POST_ACCESS, PUT_ACCESS, request_body

Instance Variables [hide private]
  GetDeleteOpInput
Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
  GetGetOpInput
Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
  GetPostOpInput
Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
  GetPutOpInput
Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_GetCommonStatic(self)

source code 

Return the static parameters common to all the RAPI calls

The reason is a parameter present in all the RAPI calls, and the reason trail has to be build for all of them, so the parameter is read here and used to build the reason trail, that is the actual parameter passed forward.