Package cm_api :: Package endpoints :: Module host_templates :: Class ApiHostTemplate
[hide private]
[frames] | no frames]

Class ApiHostTemplate

source code

         object --+        
                  |        
types.BaseApiObject --+    
                      |    
  types.BaseApiResource --+
                          |
                         ApiHostTemplate

Instance Methods [hide private]
 
__init__(self, resource_root, name=None, roleConfigGroupRefs=None)
Initializes internal state and sets all known writable properties of the object to None.
source code
 
__str__(self)
Default implementation of __str__.
source code
 
_api_version(self)
Returns the minimum API version for this resource.
source code
 
_path(self)
Returns the path to the resource.
source code
 
_do_update(self, update) source code
 
rename(self, new_name)
Rename a host template.
source code
 
set_role_config_groups(self, role_config_group_refs)
Updates the role config groups in a host template.
source code
 
apply_host_template(self, host_ids, start_roles)
Apply a host template identified by name on the specified hosts and optionally start them.
source code

Inherited from types.BaseApiObject: __setattr__, to_json_dict

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

Class Methods [hide private]

Inherited from types.BaseApiObject: from_json_dict

Inherited from types.BaseApiObject (private): _get_attributes

Static Methods [hide private]

Inherited from types.BaseApiObject: init

Class Variables [hide private]
  _ATTRIBUTES = {'name': None, 'roleConfigGroupRefs': Attr(ApiRo...

Inherited from types.BaseApiObject (private): _WHITELIST

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, resource_root, name=None, roleConfigGroupRefs=None)
(Constructor)

source code 

Initializes internal state and sets all known writable properties of the object to None. Then initializes the properties given in the provided attributes dictionary.

Parameters:
  • resource_root - API resource object.
  • attrs - optional dictionary of attributes to set. This should only contain r/w attributes.
Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

Default implementation of __str__. Uses the type name and the first attribute retrieved from the attribute map to create the string.

Overrides: object.__str__
(inherited documentation)

_api_version(self)

source code 

Returns the minimum API version for this resource. Defaults to 1.

Overrides: types.BaseApiResource._api_version
(inherited documentation)

_path(self)

source code 

Returns the path to the resource.

e.g., for a service 'foo' in cluster 'bar', this should return '/clusters/bar/services/foo'.

Overrides: types.BaseApiResource._path
(inherited documentation)

rename(self, new_name)

source code 

Rename a host template.

Parameters:
  • new_name - New host template name.
Returns:
An ApiHostTemplate object.

set_role_config_groups(self, role_config_group_refs)

source code 

Updates the role config groups in a host template.

Parameters:
  • role_config_group_refs - List of role config group refs.
Returns:
An ApiHostTemplate object.

apply_host_template(self, host_ids, start_roles)

source code 

Apply a host template identified by name on the specified hosts and optionally start them.

Parameters:
  • host_ids - List of host ids.
  • start_roles - Whether to start the created roles or not.
Returns:
An ApiCommand object.

Class Variable Details [hide private]

_ATTRIBUTES

Value:
{'name': None, 'roleConfigGroupRefs': Attr(ApiRoleConfigGroupRef), 'cl\
usterRef': ROAttr(ApiClusterRef),}