Ask Your Question
0

i am trying to do operations like if heat stack-list | grep $STACK_NAME | grep "CREATE_COMPLETE"

asked 2016-06-16 20:08:44 -0500

krishn gravatar image

i am trying to do operations like if heat stack-list | grep $STACK_NAME | grep "CREATE_COMPLETE" in python.

But it needs knoweledge on python binding with openstack. Can you guys help me doing this kind of solution. how heat stack-list is used in python.

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2016-06-23 07:22:50 -0500

teju gravatar image

1.Please follow the instructions in the below link

http://docs.openstack.org/developer/python-heatclient/
  1. List all the stacks

    stacks = heat.stacks.list()

  2. Iterate through the stacks to search for stacks with status "CREATE_COMPLETE"

    for stack in stacks: if stack.status == "CREATE_COMPLETE": print stack

I've pasted the full code in the below link:

http://pastebin.com/EmGTuZKX

Please replace the values of tenant_id, heat_url, auth_token , etc

edit flag offensive delete link more

Comments

Thank you. This make lot of sense.

krishn gravatar imagekrishn ( 2016-06-23 09:13:35 -0500 )edit

If this works, accept the answer and close the question

teju gravatar imageteju ( 2016-06-24 04:22:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-06-16 20:08:44 -0500

Seen: 107 times

Last updated: Jun 23 '16