2017-05-23 7 views

答えて

-2
#!/usr/bin/python 
import boto3 

class bcolors: 
    HEADER = '\033[95m' 
    OKBLUE = '\033[94m' 
    OKGREEN = '\033[92m' 
    WARNING = '\033[93m' 
    FAIL = '\033[91m' 
    ENDC = '\033[0m' 
    BOLD = '\033[1m' 

print ("\n") 
st_name = raw_input("What is STACK_NAME name? :: ") 
stack_name = boto3.client('opsworks') 
stacs = stack_name.describe_stacks() 
for st in stacs['Stacks']: 
    stname = st['Name'] 
    if st_name == stname : 
     print bcolors.OKBLUE + ("\nSTACK ID FOR THIS STACK IS :: \n") 
     print bcolors.WARNING + st['StackId'] 
     stid = st['StackId'] 
     print bcolors.FAIL + (" \nLayers Attached with this STACK and their ID's are :") 
     print bcolors.ENDC 
     layr = stack_name.describe_layers(StackId=stid) 
     for lr in layr['Layers']: 
print "LAYER NAME :: " + bcolors.OKGREEN +lr['Name'] + bcolors.ENDC + " LAYER ID is :: " + bcolors.OKBLUE + lr['LayerId'] 

出力例:あなたは試してみました何

output

+0

サンプル出力を見るには、下のリンクをチェックしてください:https://s17.postimg.org/l6fhb8uu7/Screen_Shot_2017-11-26_at_2.05.38_AM.png –

関連する問題