node-instances

The cfy node-instances command is used to view information about the different node-instances of a deployment.

You can use the command to list the node-instances of a specific deployment or of all deployments, and to retrieve information about a single node-instance.

Optional flags

These commands support the common CLI flags.

Commands

list

Usage

cfy node-instances list [OPTIONS]

List node-instances.

If DEPLOYMENT_ID is provided, lists node-instances for that deployment. Otherwise, lists node-instances for all deployments.

Optional flags

 

Example

$ cfy node-instances list
...

Listing all instances...

Node-instances:
+------------------------+------------------------------+-------------+-----------------+---------+------------+----------------+------------+
|           id           |        deployment_id         |   host_id   |     node_id     |  state  | visibility |  tenant_name   | created_by |
+------------------------+------------------------------+-------------+-----------------+---------+------------+----------------+------------+
|      host_gkxr6j       | cloudify-nodecellar-example  | host_gkxr6j |       host      | started |  creator   | default_tenant |   admin    |
| http_web_server_mwtpct | cloudify-hello-world-example |  vm_qu2t7i  | http_web_server | started |  creator   | default_tenant |   admin    |
|     mongod_nps479      | cloudify-nodecellar-example  | host_gkxr6j |      mongod     | started |  creator   | default_tenant |   admin    |
|   nodecellar_gj0mj2    | cloudify-nodecellar-example  | host_gkxr6j |    nodecellar   | started |  creator   | default_tenant |   admin    |
|     nodejs_gsy2zz      | cloudify-nodecellar-example  | host_gkxr6j |      nodejs     | started |  creator   | default_tenant |   admin    |
|       vm_qu2t7i        | cloudify-hello-world-example |  vm_qu2t7i  |        vm       | started |  creator   | default_tenant |   admin    |
+------------------------+------------------------------+-------------+-----------------+---------+------------+----------------+------------+

...

summary

Usage

cfy node-instances summary <field> [optional sub-field] [OPTIONS]

Summarizes node-instances, giving a count of elements with each distinct value for the selected field. If a sub-field is selected then a count will be given for each distinct field and sub-field combination, as well as totals for each field.

For valid field/sub-field names, invoke cfy node-instances summary

 

Example

$ cfy node-instances summary deployment_id
Retrieving summary of node instances on field deployment_id

Node instance summary by deployment_id
+---------------+----------------+
| deployment_id | node_instances |
+---------------+----------------+
|      sga1     |       51       |
|      sga3     |       51       |
|      sga2     |       51       |
|       s3      |       2        |
|       s2      |       2        |
|       s1      |       2        |
|       s5      |       2        |
|       s4      |       2        |
|      sg1      |       35       |
+---------------+----------------+

...

$ cfy node-instances summary deployment_id state
Retrieving summary of node instances on field deployment_id

Node instance summary by deployment_id
+---------------+---------+----------------+
| deployment_id |  state  | node_instances |
+---------------+---------+----------------+
|      sga1     | started |       51       |
|      sga1     |  TOTAL  |       51       |
|      sga3     | started |       51       |
|      sga3     |  TOTAL  |       51       |
|      sga2     | started |       51       |
|      sga2     |  TOTAL  |       51       |
|       s3      | started |       2        |
|       s3      |  TOTAL  |       2        |
|       s2      | started |       2        |
|       s2      |  TOTAL  |       2        |
|       s1      | started |       2        |
|       s1      |  TOTAL  |       2        |
|       s5      | started |       2        |
|       s5      |  TOTAL  |       2        |
|       s4      | started |       2        |
|       s4      |  TOTAL  |       2        |
|      sg1      | started |       35       |
|      sg1      |  TOTAL  |       35       |
+---------------+---------+----------------+

...

get

Usage

cfy node-instances get [OPTIONS] NODE_INSTANCE_ID

Retrieve information for a specific node-instance.

NODE_INSTANCE_ID is the ID of the node-instance for which to retrieve information.

Optional flags

Example

$ cfy node-instances get nodecellar_gj0mj2
...

Retrieving node instance nodecellar_gj0mj2

Node-instance:
+-------------------+-----------------------------+-------------+------------+---------+------------+----------------+------------+
|         id        |        deployment_id        |   host_id   |  node_id   |  state  | visibility |  tenant_name   | created_by |
+-------------------+-----------------------------+-------------+------------+---------+------------+----------------+------------+
| nodecellar_gj0mj2 | cloudify-nodecellar-example | host_gkxr6j | nodecellar | started |  creator   | default_tenant |   admin    |
+-------------------+-----------------------------+-------------+------------+---------+------------+----------------+------------+

Instance runtime properties:
	mongo_port: 27017
	nodejs_binaries_path: /tmp/68672f1b-b49a-4e58-ae6f-b2de63676e4f/nodejs/nodejs-binaries
	pid: 27816
	nodecellar_source_path: /tmp/68672f1b-b49a-4e58-ae6f-b2de63676e4f/nodecellar/nodecellar-source
	mongo_ip_address: localhost

...

update-runtime

Usage

cfy node-instances update-runtime [OPTIONS] NODE_INSTANCE_ID

Update the runtime properties of a specific node-instance.

NODE_INSTANCE_ID is the id of the node-instance to update.

Mandatory flags

Optional flags

Example

$ cfy node-instances update-runtime vm_d720jr -p new_property=value -p dict_property.key=value

Successfully updated the runtime properties of "vm_d720jr"

Node-instance:
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+
|     id    | deployment_id |  host_id  | node_id |  state  | visibility |  tenant_name   | created_by |
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+
| vm_d720jr | hello_world   | vm_d720jr |    vm   | started |   tenant   | default_tenant |   admin    |
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+

Instance runtime properties:
    dict_property:   {'key': 'value'}
    new_property:    value
	ipv6_address:    None
	cloudify_agent:  {'broker_ip': ['172.16.3.112'], 'file_server_url': 'https://172.16.3.112:53333/resources', ... }
	external_name:   server_hello_world_2_vm_d720jr
	ip:              172.16.3.114
	ipv6_addresses:  []
	networks:        {'cloudify-management-network': ['172.16.3.114']}
    ...

Notice how using the dot notation dict_property.key has created a property dict_property and within it a sub-property key.
In the same way, we can access sub-properties to update them, e.g. dict_property.key = [value1, value2].

Options for providing the runtime properties

Usage note:

Updating a sub-property within a runtime property does not affect other sub-properties. For example, running cfy node-instances update-runtime vm_d720jr -p '{a: {b: 5}}' on a node-instance where:

Instance runtime properties:
    a:  {b: 4, c: 3}
    ...

Will result in:

Instance runtime properties:
    a:  {b: 5, c: 3}
    ...

delete-runtime

Usage

cfy node-instances delete-runtime [OPTIONS] NODE_INSTANCE_ID

Delete specified runtime properties of a specific node-instance

NODE_INSTANCE_ID is the id of the node-instance to update.

Mandatory flags

Optional flags

Example

$ cfy node-instances delete-runtime vm_d720jr -p 'dict_property.key' -p 'new_property'

Successfully updated the runtime properties of "vm_d720jr"

Node-instance:
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+
|     id    | deployment_id |  host_id  | node_id |  state  | visibility |  tenant_name   | created_by |
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+
| vm_d720jr | hello_world   | vm_d720jr |    vm   | started |   tenant   | default_tenant |   admin    |
+-----------+---------------+-----------+---------+---------+------------+----------------+------------+

Instance runtime properties:
    dict_property:   {}
	ipv6_address:    None
	cloudify_agent:  {'broker_ip': ['172.16.3.112'], 'file_server_url': 'https://172.16.3.112:53333/resources', ... }
	external_name:   server_hello_world_2_vm_d720jr
	ip:              172.16.3.114
	ipv6_addresses:  []
	networks:        {'cloudify-management-network': ['172.16.3.114']}
    ...

Notice how using the dot notation dict_property.key allowed us to delete the sub-property key within the property dict_property.

Options for providing the runtime properties

Usage note:

Deleting a sub-property within a runtime property does not affect other sub-properties. For example, running cfy node-instances delete-runtime vm_d720jr -p '{a: {b}}' on a node-instance where:

Instance runtime properties:
    a:  {b: 4, c: 3}
    ...

Will result in:

    a:  {c: 3}
    ...