Package restxclient :: Module restx_resourcetemplate :: Class RestxResourceTemplate
[hide private]
[frames] | no frames]

Class RestxResourceTemplate

source code

object --+
         |
        RestxResourceTemplate

Represents a template that can be used by a client to create a new resource.

The resource template assists the client in setting the required resource creation time parameters and provides the method for the creation of the new resource.

Instance Methods [hide private]
 
__init__(self, comp)
Create a new resource template in memory.
source code
dict of RestxParameter
get_all_parameters(self)
Return all parameters defined for this template's component.
source code
RestxParameter
get_parameter(self, name)
Return one parameters of this template's component.
source code
RestxParameter
get_resource_description(self)
Return parameter definition for this template's resource description parameter.
source code
RestxParameter
get_resource_suggested_name(self)
Return parameter definition for this template's resource suggested name parameter.
source code
RestxResourceTemplate
set(self, name, value)
Set a parameter value for a given parameter.
source code
RestxResourceTemplate
set_params(self, params)
Set values of multiple parameters from a dictionary.
source code
RestxResourceTemplate
set_description(self, desc)
Sets the 'description' resource creation time parameter.
source code
RestxResourceTemplate
set_suggested_name(self, name)
Sets the 'suggested name' resource creation time parameter.
source code
 
create_resource(self)
Posts a new resource description to the server.
source code
 
create_specialized_component(self)
Posts a new specialized component resource description to the server.
source code

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

Class Variables [hide private]
  __PARAMS_KEY = 'params'
  __RCP_KEY = 'resource_creation_params'
  __RCP_DESC_KEY = 'desc'
  __RCP_SUGGESTED_NAME_KEY = 'suggested_name'
  __RCP_SPECIALIZED_KEY = 'specialized'
Properties [hide private]
  suggested_name
  description
  params

Inherited from object: __class__

Method Details [hide private]

__init__(self, comp)
(Constructor)

source code 

Create a new resource template in memory.

Parameters:
Overrides: object.__init__

get_all_parameters(self)

source code 

Return all parameters defined for this template's component.

Returns: dict of RestxParameter
Dictionary of all parameter descriptions.

get_parameter(self, name)

source code 

Return one parameters of this template's component.

Parameters:
  • name (string) - Name of the parameter.
Returns: RestxParameter
A parameter description.

get_resource_description(self)

source code 

Return parameter definition for this template's resource description parameter.

Returns: RestxParameter
The resource description parameter definition.

get_resource_suggested_name(self)

source code 

Return parameter definition for this template's resource suggested name parameter.

Returns: RestxParameter
The resource suggested name parameter definition.

set(self, name, value)

source code 

Set a parameter value for a given parameter.

Performs proper sanity checking on the type and value.

Parameters:
  • name (string) - Name of the parameter.
  • value (object) - Value of the parameter.
Returns: RestxResourceTemplate
Reference to ourselves, so that set() calls can be chained

set_params(self, params)

source code 

Set values of multiple parameters from a dictionary.

Performs proper sanity checking on the type and value of each parameter.

Parameters:
  • params (dict) - Dictionart of name/values for the parameters of this resource template.
Returns: RestxResourceTemplate
Reference to ourselves, so that set() calls can be chained

set_description(self, desc)

source code 

Sets the 'description' resource creation time parameter.

Parameters:
  • desc (string) - Description for the new resource.
Returns: RestxResourceTemplate
Reference to ourselves, so that set() calls can be chained

set_suggested_name(self, name)

source code 

Sets the 'suggested name' resource creation time parameter.

Parameters:
  • name (string) - Suggested name for the new resource.
Returns: RestxResourceTemplate
Reference to ourselves, so that set() calls can be chained

create_resource(self)

source code 

Posts a new resource description to the server.

Returns an initialized RestxResource object, ready to use.

create_specialized_component(self)

source code 

Posts a new specialized component resource description to the server.

Returns an initialized RestxComponent object, ready to use.


Property Details [hide private]

suggested_name

Set Method:
set_suggested_name(self, name) - Sets the 'suggested name' resource creation time parameter.

description

Set Method:
set_description(self, desc) - Sets the 'description' resource creation time parameter.

params

Set Method:
set_params(self, params) - Set values of multiple parameters from a dictionary.