get list of nodes using CloudifyClient

45 Views Asked by At

I am trying to get a list of Tosca nodes within my blueprint but it returns all the nodes in the whole cloudify (includes nodes from other blueprints)

nodes = client.nodes.list(_include=['id','type','properties'])

I expect to get a list of nodes in a specific blueprint.

1

There are 1 best solutions below

0
Isaac On

To obtain node templates for a blueprint:

blueprint = client.blueprints.get(blueprint_id, _include=['plan'])
nodes = blueprint.plan['nodes']

nodes will be a list of dictionaries, each one represents a node template.