Node Instances API

class cloudify_rest_client.node_instances.NodeInstance[source]

Bases: dict

Cloudify node instance.

property id

The identifier of the node instance.

property node_id

The identifier of the node whom this is in instance of.

property relationships

The node instance relationships.

property host_id

The node instance host_id.

property deployment_id

The deployment id the node instance belongs to.

property created_by

The name of the node instance creator.

property runtime_properties

The runtime properties of the node instance.

property system_properties

The system properties of the node instance.

property state

The current state of the node instance.

property version

The current version of the node instance (used for optimistic locking on update)

property scaling_groups

Scaling group instances this node instance belongs to.

property index

The index of this node instance in relation to other node instances of the same node.

property is_status_check_ok

Has the last status check for this NI succeeded?

This examines the result of the most recent check_status call on this node instance, and returns whether the call succeeded.

If the result is missing, the result is succeeded.

property has_configuration_drift

Has this NI’s configuration drifted?

This examines the result of the most recent check_drift call on this node instance, and returns whether there was any configuration drift reported.

The instance is drifted if either the instance itself, or any of its relationships have drifted.

class cloudify_rest_client.node_instances.NodeInstancesClient(api)[source]

Bases: object

create_many(deployment_id, node_instances)[source]

Create multiple node-instances.

  • deployment_id – the new instances belong to this deployment

  • node_instances – list of dicts representing the instances to be created. Each node dict must contain at least the keys: id, node_id.



get(node_instance_id, _include=None, evaluate_functions=False)[source]

Returns the node instance for the provided node instance id.

  • node_instance_id – The identifier of the node instance to get.

  • _include – List of fields to include in response.

  • evaluate_functions – Evaluate intrinsic functions


The retrieved node instance.

update(node_instance_id, state=None, runtime_properties=None, version=1, force=False, relationships=None, system_properties=None)[source]

Update node instance with the provided state & runtime_properties.

  • node_instance_id – The identifier of the node instance to update.

  • state – The updated state.

  • runtime_properties – The updated runtime properties.

  • system_properties – Like runtime_properties, but only managed by Cloudify itself internally.

  • version – Current version value of this node instance in Cloudify’s storage (used for optimistic locking).

  • force – ignore the version check - use with caution

  • relationships – New relationships to set for the node-instance. This is only useful when called from deployment-update: otherwise, just setting relationships will not do anything else by itself (eg. it won’t run the relationships establish operations)


The updated node instance.

list(_include=None, constraints=None, **kwargs)[source]

Returns a list of node instances which belong to the deployment identified by the provided deployment id.

  • deployment_id – Optional deployment id to list node instances for.

  • node_name – Optional node name to only fetch node instances with this name. The node_name positional argument will be deprecated as of the next rest-client version. Use node_id instead.

  • node_id – Equivalent to node_name.

  • _include – List of fields to include in response.

  • sort – Key for sorting the list.

  • is_descending – True for descending order, False for ascending.

  • constraints – A list of DSL constraints for node_instance data type to filter the node_instances by.

  • kwargs – Optional filter fields. for a list of available fields see the REST service’s models.DeploymentNodeInstance.fields


Node instances.

Return type:


search(ids, all_tenants=False)[source]

Search node instances by their IDs.

  • ids – list of ids to search by

  • all_tenants – search node-instances of all tenants


Node instances.

Return type:



Delete a node-instance

This is only useful from within deployment-update. You don’t want to delete node-instances otherwise: the state of the deployment could be made inconsistent.


instance_id – ID of the instance to be deleted

dump(deployment_ids=None, get_broker_conf=None, node_instance_ids=None)[source]

Generate node instances’ attributes for a snapshot.

  • deployment_ids – A list of deployments’ identifiers used to select node instances to be dumped, should not be empty.

  • get_broker_conf – A function used to retrieve broker configuration.

  • node_instance_ids – A list of node instances’ identifiers, if not empty, used to select specific node instances to be dumped.


A generator of dictionaries, which describe node instances’ attributes.

restore(entities, logger, deployment_id, inject_broker_conf=None)[source]

Restore node instances from a snapshot.

  • entities – An iterable (e.g. a list) of dictionaries describing node instances to be restored.

  • logger – A logger instance.

  • deployment_id – A deployment identifier for the entities.

  • inject_broker_conf – A function used to inject broker configuration for given node_instance’s runtime_properties.