class documentation

class OpcodeResource(ResourceBase):

Known subclasses: ganeti.rapi.rlib2.R_2_cluster_modify, ganeti.rapi.rlib2.R_2_groups, ganeti.rapi.rlib2.R_2_groups_name, ganeti.rapi.rlib2.R_2_groups_name_assign_nodes, ganeti.rapi.rlib2.R_2_groups_name_modify, ganeti.rapi.rlib2.R_2_groups_name_rename, ganeti.rapi.rlib2.R_2_info, ganeti.rapi.rlib2.R_2_instances, ganeti.rapi.rlib2.R_2_instances_multi_alloc, ganeti.rapi.rlib2.R_2_instances_name, ganeti.rapi.rlib2.R_2_instances_name_activate_disks, ganeti.rapi.rlib2.R_2_instances_name_deactivate_disks, ganeti.rapi.rlib2.R_2_instances_name_disk_grow, ganeti.rapi.rlib2.R_2_instances_name_export, ganeti.rapi.rlib2.R_2_instances_name_failover, ganeti.rapi.rlib2.R_2_instances_name_info, ganeti.rapi.rlib2.R_2_instances_name_migrate, ganeti.rapi.rlib2.R_2_instances_name_modify, ganeti.rapi.rlib2.R_2_instances_name_prepare_export, ganeti.rapi.rlib2.R_2_instances_name_reboot, ganeti.rapi.rlib2.R_2_instances_name_recreate_disks, ganeti.rapi.rlib2.R_2_instances_name_reinstall, ganeti.rapi.rlib2.R_2_instances_name_rename, ganeti.rapi.rlib2.R_2_instances_name_replace_disks, ganeti.rapi.rlib2.R_2_instances_name_shutdown, ganeti.rapi.rlib2.R_2_instances_name_startup, ganeti.rapi.rlib2.R_2_networks, ganeti.rapi.rlib2.R_2_networks_name, ganeti.rapi.rlib2.R_2_networks_name_connect, ganeti.rapi.rlib2.R_2_networks_name_disconnect, ganeti.rapi.rlib2.R_2_networks_name_modify, ganeti.rapi.rlib2.R_2_networks_name_rename, ganeti.rapi.rlib2.R_2_nodes, ganeti.rapi.rlib2.R_2_nodes_name, ganeti.rapi.rlib2.R_2_nodes_name_evacuate, ganeti.rapi.rlib2.R_2_nodes_name_migrate, ganeti.rapi.rlib2.R_2_nodes_name_modify, ganeti.rapi.rlib2.R_2_nodes_name_powercycle, ganeti.rapi.rlib2.R_2_nodes_name_role, ganeti.rapi.rlib2.R_2_nodes_name_storage, ganeti.rapi.rlib2.R_2_nodes_name_storage_modify, ganeti.rapi.rlib2.R_2_nodes_name_storage_repair, ganeti.rapi.rlib2.R_2_os, ganeti.rapi.rlib2.R_2_redist_config, ganeti.rapi.rlib2._R_Tags

View In Hierarchy

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). Still default behavior cannot be totally overriden. There are opcode params that are available to all opcodes, e.g. "depends". In case those params (currently only "depends") are found in the original request's body, they are added to the dictionary of parsed parameters and eventually passed to the opcode. If the parsed body is not represented as a dictionary object, the values are not added.

Class Variable DELETE_FORBIDDEN Set this to disable listed parameters and optionally specific values from being set through the DELETE handler (see baserlib.InspectParams)
Class Variable DELETE_OPCODE Set this to a class derived from opcodes.OpCode to automatically generate a DELETE handler submitting the opcode
Class Variable DELETE_RENAME Set this to rename parameters in the DELETE handler (see baserlib.FillOpcode)
Class Variable GET_ALIASES Set this to duplicate return values in GET results (see baserlib.GetHandler)
Class Variable GET_FORBIDDEN Set this to disable listed parameters and optionally specific values from being set through the GET handler (see baserlib.InspectParams)
Class Variable GET_OPCODE Set this to a class derived from opcodes.OpCode to automatically generate a GET handler submitting the opcode
Class Variable GET_RENAME Set this to rename parameters in the GET handler (see baserlib.FillOpcode)
Class Variable POST_FORBIDDEN Set this to disable listed parameters and optionally specific values from being set through the POST handler (see baserlib.InspectParams)
Class Variable POST_OPCODE Set this to a class derived from opcodes.OpCode to automatically generate a POST handler submitting the opcode
Class Variable POST_RENAME Set this to rename parameters in the POST handler (see baserlib.FillOpcode)
Class Variable PUT_FORBIDDEN Set this to disable listed parameters and optionally specific values from being set through the PUT handler (see baserlib.InspectParams)
Class Variable PUT_OPCODE Set this to a class derived from opcodes.OpCode to automatically generate a PUT handler submitting the opcode
Class Variable PUT_RENAME Set this to rename parameters in the PUT handler (see baserlib.FillOpcode)
Instance Variable GetDeleteOpInput Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
Instance Variable GetGetOpInput Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
Instance Variable GetPostOpInput Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
Instance Variable GetPutOpInput Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)
Method _ForbiddenHandler Examines provided parameters for forbidden values.
Method _GenericHandler Undocumented
Method _GetCommonStatic Return the static parameters common to all the RAPI calls
Method _GetDefaultData Undocumented
Method _GetDepends Undocumented
Method _GetRapiOpName Extracts the name of the RAPI operation from the class name

Inherited from ResourceBase:

Method __init__ Generic resource constructor.
Method dryRun Check if the request specifies dry-run mode.
Method getBodyParameter Check and return the value for a given parameter.
Method GetClient Wrapper for luxi.Client with HTTP-specific error handling.
Method SubmitJob Generic wrapper for submit job, for better http compatibility.
Method useBulk Check if the request specifies bulk querying.
Method useForce Check if the request specifies a forced operation.
Method useLocking Check if the request specifies locking.
Constant DELETE_ACCESS Undocumented
Constant GET_ACCESS Undocumented
Constant POST_ACCESS Undocumented
Constant PUT_ACCESS Undocumented
Class Variable request_body Undocumented
Instance Variable items Undocumented
Instance Variable queryargs Undocumented
Method _checkIntVariable Return the parsed value of an int argument.
Method _checkStringVariable Return the parsed value of a string argument.
Method _GetRequestBody Returns the body data.
Instance Variable _client_cls Undocumented
Instance Variable _req Undocumented
DELETE_FORBIDDEN =

Set this to disable listed parameters and optionally specific values from being set through the DELETE handler (see baserlib.InspectParams)

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_ALIASES =

Set this to duplicate return values in GET results (see baserlib.GetHandler)

GET_FORBIDDEN =

Set this to disable listed parameters and optionally specific values from being set through the GET handler (see baserlib.InspectParams)

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_FORBIDDEN =

Set this to disable listed parameters and optionally specific values from being set through the POST handler (see baserlib.InspectParams)

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_FORBIDDEN =

Set this to disable listed parameters and optionally specific values from being set through the PUT handler (see baserlib.InspectParams)

PUT_OPCODE =

Set this to a class derived from opcodes.OpCode to automatically generate a PUT handler submitting the opcode

GetDeleteOpInput =
GetGetOpInput =

Define this to override the default method for getting opcode parameters (see baserlib.OpcodeResource._GetDefaultData)

def _ForbiddenHandler(self, method_fn, forbidden_params, rename_dict):

Examines provided parameters for forbidden values.

def _GenericHandler(self, opcode, rename, fn):

Undocumented

def _GetCommonStatic(self):

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.

def _GetDefaultData(self):

Undocumented

def _GetDepends(self):

Undocumented

def _GetRapiOpName(self):

Extracts the name of the RAPI operation from the class name