Created
November 14, 2017 16:35
-
-
Save psachin/d5dad6acd2d590d8ed4005a5a3bc197e to your computer and use it in GitHub Desktop.
[WIP] Redploy stack using OpenStack client APIs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
from keystoneauth1 import loading | |
from keystoneauth1 import session | |
from heatclient import client | |
loader = loading.get_plugin_loader('password') | |
auth = loader.load_from_options(auth_url=os.environ.get("OS_AUTH_URL"), | |
username=os.environ.get("OS_USERNAME"), | |
password=os.environ.get("OS_PASSWORD"), | |
project_name=os.environ.get("OS_PROJECT_NAME")) | |
# print(os.environ.get("OS_PROJECT_NAME")) | |
sess = session.Session(auth=auth) | |
heat = client.Client('1', session=sess) | |
for s in heat.stacks.list(): | |
print s.stack_name, s.id, s.status | |
heat.stacks.snapshot('8927fef8-65a4-45fb-9e11-d6247ea24773') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment