Manager

class cloudify.manager.NodeInstance(node_instance_id, node_id, runtime_properties=None, state=None, version=None, host_id=None, relationships=None, index=None, scaling_groups=None, system_properties=None)[source]

Bases: object

Represents a deployment node instance. An instance of this class contains runtime information retrieved from Cloudify’s runtime storage as well as the node’s state.

delete(key)[source]
property runtime_properties

The node instance runtime properties.

To update the properties, make changes on the returned dict and call update_node_instance with the modified instance.

property state

The node instance state.

To update the node instance state, change this property value and call update_node_instance with the modified instance.

property node_id
property relationships
property index
property scaling_groups
property system_properties
cloudify.manager.get_rest_client(tenant=None, api_token=None)[source]
Parameters:
  • tenant – optional tenant name to connect as

  • api_token – optional api_token to authenticate with (instead of using REST token)

Returns:

A REST client configured to connect to the manager in context

Return type:

cloudify_rest_client.CloudifyClient

cloudify.manager.download_resource_from_manager(resource_path, logger, target_path=None)[source]

Download resource from the manager file server.

Parameters:
  • resource_path – path to resource on the file server

  • logger – logger to use for info output

  • target_path – optional target path for the resource

Returns:

path to the downloaded resource

cloudify.manager.download_resource(blueprint_id, deployment_id, tenant_name, resource_path, logger, target_path=None)[source]

Download resource from the manager file server with path relative to the deployment or blueprint denoted by deployment_id or blueprint_id

An attempt will first be made for getting the resource from the deployment folder. If not found, an attempt will be made for getting the resource from the blueprint folder.

Parameters:
  • blueprint_id – the blueprint id of the blueprint to download the resource from

  • deployment_id – the deployment id of the deployment to download the resource from

  • tenant_name – the resource’s tenant

  • resource_path – path to resource relative to blueprint or deployment folder

  • logger – logger to use for info output

  • target_path – optional target path for the resource

Returns:

path to the downloaded resource

cloudify.manager.get_resource_from_manager(resource_path, base_url=None, base_urls=None)[source]

Get resource from the manager file server.

Parameters:
  • resource_path – path to resource on the file server

  • base_url – The base URL to manager file server. Deprecated.

  • base_urls – A list of base URL to cluster manager file servers.

  • resource_path – path to resource on the file server.

Returns:

resource content

cloudify.manager.get_resource(blueprint_id, deployment_id, tenant_name, resource_path)[source]

Get resource from the manager file server with path relative to the deployment or blueprint denoted by deployment_id or blueprint_id.

An attempt will first be made for getting the resource from the deployment folder. If not found, an attempt will be made for getting the resource from the blueprint folder.

Parameters:
  • blueprint_id – the blueprint id of the blueprint to download the resource from

  • deployment_id – the deployment id of the deployment to download the resource from

  • tenant_name – tenant name

  • resource_path – path to resource relative to blueprint folder

Returns:

resource content

cloudify.manager.get_resource_directory_index(blueprint_id, deployment_id, tenant_name, resource_path)[source]
cloudify.manager.get_node_instance(node_instance_id, evaluate_functions=False, client=None)[source]

Read node instance data from the storage.

Parameters:
  • node_instance_id – the node instance id

  • evaluate_functions – Evaluate intrinsic functions

  • client – a REST client to use

Return type:

NodeInstance

cloudify.manager.update_node_instance(node_instance, client=None)[source]

Update node instance data changes in the storage.

Parameters:
  • node_instance – the node instance with the updated data

  • client – a REST client to use

cloudify.manager.get_node_instance_ip(node_instance_id, client=None)[source]

Get the IP address of the host the node instance denoted by node_instance_id is contained in.

cloudify.manager.update_execution_status(execution_id, status, error=None, client=None)[source]

Update the execution status of the execution denoted by execution_id.

Returns:

The updated status

cloudify.manager.get_bootstrap_context(client=None)[source]

Read the manager bootstrap context.

cloudify.manager.get_provider_context(client=None)[source]

Read the manager provider context.