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

Module host_templates

source code

Classes [hide private]
  ApiHostTemplate
Functions [hide private]
 
create_host_template(resource_root, name, cluster_name)
Create a host template.
source code
 
get_host_template(resource_root, name, cluster_name)
Lookup a host template by name in the specified cluster.
source code
 
get_all_host_templates(resource_root, cluster_name='default')
Get all host templates in a cluster.
source code
 
delete_host_template(resource_root, name, cluster_name)
Delete a host template identified by name in the specified cluster.
source code
 
update_host_template(resource_root, name, cluster_name, api_host_template)
Update a host template identified by name in the specified cluster.
source code
 
apply_host_template(resource_root, name, cluster_name, host_ids, start_roles)
Apply a host template identified by name on the specified hosts and optionally start them.
source code
Variables [hide private]
  HOST_TEMPLATES_PATH = '/clusters/%s/hostTemplates'
  HOST_TEMPLATE_PATH = '/clusters/%s/hostTemplates/%s'
  APPLY_HOST_TEMPLATE_PATH = '/clusters/%s/hostTemplates/%s/comm...
  __package__ = 'cm_api.endpoints'
Function Details [hide private]

create_host_template(resource_root, name, cluster_name)

source code 

Create a host template.

Parameters:
  • resource_root - The root Resource object.
  • name - Host template name
  • cluster_name - Cluster name
Returns:
An ApiHostTemplate object for the created host template.

Since: API v3

get_host_template(resource_root, name, cluster_name)

source code 

Lookup a host template by name in the specified cluster.

Parameters:
  • resource_root - The root Resource object.
  • name - Host template name.
  • cluster_name - Cluster name.
Returns:
An ApiHostTemplate object.

Since: API v3

get_all_host_templates(resource_root, cluster_name='default')

source code 

Get all host templates in a cluster.

Parameters:
  • cluster_name - Cluster name.
Returns:
ApiList of ApiHostTemplate objects for all host templates in a cluster.

Since: API v3

delete_host_template(resource_root, name, cluster_name)

source code 

Delete a host template identified by name in the specified cluster.

Parameters:
  • resource_root - The root Resource object.
  • name - Host template name.
  • cluster_name - Cluster name.
Returns:
The deleted ApiHostTemplate object.

Since: API v3

update_host_template(resource_root, name, cluster_name, api_host_template)

source code 

Update a host template identified by name in the specified cluster.

Parameters:
  • resource_root - The root Resource object.
  • name - Host template name.
  • cluster_name - Cluster name.
  • api_host_template - The updated host template.
Returns:
The updated ApiHostTemplate.

Since: API v3

apply_host_template(resource_root, name, cluster_name, host_ids, start_roles)

source code 

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

Parameters:
  • resource_root - The root Resource object.
  • name - Host template name.
  • cluster_name - Cluster name.
  • host_ids - List of host ids.
  • start_roles - Whether to start the created roles or not.
Returns:
An ApiCommand object.

Since: API v3


Variables Details [hide private]

APPLY_HOST_TEMPLATE_PATH

Value:
'/clusters/%s/hostTemplates/%s/commands/applyHostTemplate'