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

Class R_Generic

source code


Generic class for resources.

Instance Methods [hide private]
 
__init__(self, items, queryargs, req)
Generic resource constructor.
source code
 
_GetRequestBody(self)
Returns the body data.
source code
 
_checkIntVariable(self, name, default=0)
Return the parsed value of an int argument.
source code
 
_checkStringVariable(self, name, default=None)
Return the parsed value of an int argument.
source code
 
getBodyParameter(self, name, *args)
Check and return the value for a given parameter.
source code
 
useLocking(self)
Check if the request specifies locking.
source code
 
useBulk(self)
Check if the request specifies bulk querying.
source code
 
useForce(self)
Check if the request specifies a forced operation.
source code
 
dryRun(self)
Check if the request specifies dry-run mode.
source code

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

Class Variables [hide private]
  GET_ACCESS = []
  PUT_ACCESS = [rapi.RAPI_ACCESS_WRITE]
  POST_ACCESS = [rapi.RAPI_ACCESS_WRITE]
  DELETE_ACCESS = [rapi.RAPI_ACCESS_WRITE]
  request_body = property(fget= _GetRequestBody)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, items, queryargs, req)
(Constructor)

source code 

Generic resource constructor.

Parameters:
  • items - a list with variables encoded in the URL
  • queryargs - a dictionary with additional options from URL
Overrides: object.__init__

getBodyParameter(self, name, *args)

source code 

Check and return the value for a given parameter.

If a second parameter is not given, an error will be returned, otherwise this parameter specifies the default value.

Parameters:
  • name - the required parameter