77from SoftLayer .CLI import formatting
88from SoftLayer .managers .vs_capacity import CapacityManager as CapacityManager
99
10-
10+ from pprint import pprint as pp
1111@click .command (epilog = click .style ("""WARNING: Reserved Capacity is on a yearly contract"""
1212 """ and not cancelable until the contract is expired.""" , fg = 'red' ))
1313@click .option ('--name' , '-n' , required = True , prompt = True ,
1414 help = "Name for your new reserved capacity" )
15- @click .option ('--datacenter' , '-d' , required = True , prompt = True ,
16- help = "Datacenter shortname" )
1715@click .option ('--backend_router_id' , '-b' , required = True , prompt = True ,
1816 help = "backendRouterId, create-options has a list of valid ids to use." )
19- @click .option ('--capacity ' , '-c ' , required = True , prompt = True ,
17+ @click .option ('--flavor ' , '-f ' , required = True , prompt = True ,
2018 help = "Capacity keyname (C1_2X2_1_YEAR_TERM for example)." )
21- @click .option ('--quantity ' , '-q ' , required = True , prompt = True ,
19+ @click .option ('--instances ' , '-i ' , required = True , prompt = True ,
2220 help = "Number of VSI instances this capacity reservation can support." )
2321@click .option ('--test' , is_flag = True ,
2422 help = "Do not actually create the virtual server" )
2523@environment .pass_env
26- def cli (env , name , datacenter , backend_router_id , capacity , quantity , test = False ):
24+ def cli (env , name , backend_router_id , flavor , instances , test = False ):
2725 """Create a Reserved Capacity instance.
2826
2927 *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired.
@@ -32,10 +30,9 @@ def cli(env, name, datacenter, backend_router_id, capacity, quantity, test=False
3230
3331 result = manager .create (
3432 name = name ,
35- datacenter = datacenter ,
3633 backend_router_id = backend_router_id ,
37- capacity = capacity ,
38- quantity = quantity ,
34+ flavor = flavor ,
35+ instances = instances ,
3936 test = test )
4037
4138 if test :
@@ -44,14 +41,14 @@ def cli(env, name, datacenter, backend_router_id, capacity, quantity, test=False
4441 table .add_row (['Name' , container ['name' ]])
4542 table .add_row (['Location' , container ['locationObject' ]['longName' ]])
4643 for price in container ['prices' ]:
47- table .add_row ([price [ 'item' ][ 'keyName' ] , price ['item' ]['description' ]])
48- table .add_row (['Total' , result ['postTaxRecurring' ]])
44+ table .add_row (['Contract' , price ['item' ]['description' ]])
45+ table .add_row (['Hourly Total' , result ['postTaxRecurring' ]])
4946 else :
5047 table = formatting .Table (['Name' , 'Value' ], "Reciept" )
5148 table .add_row (['Order Date' , result ['orderDate' ]])
5249 table .add_row (['Order ID' , result ['orderId' ]])
5350 table .add_row (['status' , result ['placedOrder' ]['status' ]])
5451 for item in result ['placedOrder' ]['items' ]:
5552 table .add_row ([item ['categoryCode' ], item ['description' ]])
56- table .add_row (['Total' , result ['orderDetails' ]['postTaxRecurring' ]])
53+ table .add_row (['Hourly Total' , result ['orderDetails' ]['postTaxRecurring' ]])
5754 env .fout (table )
0 commit comments