def cli(env, name, backend_router_id, flavor, instances, test=False):
    """Create a Reserved Capacity instance.

    *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired.
    """
    manager = CapacityManager(env.client)

    result = manager.create(
        name=name,
        backend_router_id=backend_router_id,
        flavor=flavor,
        instances=instances,
        test=test)
    if test:
        table = formatting.Table(['Name', 'Value'], "Test Order")
        container = result['orderContainers'][0]
        table.add_row(['Name', container['name']])
        table.add_row(['Location', container['locationObject']['longName']])
        for price in container['prices']:
            table.add_row(['Contract', price['item']['description']])
        table.add_row(['Hourly Total', result['postTaxRecurring']])
    else:
        table = formatting.Table(['Name', 'Value'], "Reciept")
        table.add_row(['Order Date', result['orderDate']])
        table.add_row(['Order ID', result['orderId']])
        table.add_row(['status', result['placedOrder']['status']])
        table.add_row(['Hourly Total', result['orderDetails']['postTaxRecurring']])
    env.fout(table)
def cli ( env , name , backend_router_id , flavor , instances , test = False ) : manager = CapacityManager ( env . client ) result = manager . create ( name = name , backend_router_id = backend_router_id , flavor = flavor , instances = instances , test = test ) if test : table = formatting . Table ( [ 'Name' , 'Value' ] , "Test Order" ) container = result [ 'orderContainers' ] [ 0 ] table . add_row ( [ 'Name' , container [ 'name' ] ] ) table . add_row ( [ 'Location' , container [ 'locationObject' ] [ 'longName' ] ] ) for price in container [ 'prices' ] : table . add_row ( [ 'Contract' , price [ 'item' ] [ 'description' ] ] ) table . add_row ( [ 'Hourly Total' , result [ 'postTaxRecurring' ] ] ) else : table = formatting . Table ( [ 'Name' , 'Value' ] , "Reciept" ) table . add_row ( [ 'Order Date' , result [ 'orderDate' ] ] ) table . add_row ( [ 'Order ID' , result [ 'orderId' ] ] ) table . add_row ( [ 'status' , result [ 'placedOrder' ] [ 'status' ] ] ) table . add_row ( [ 'Hourly Total' , result [ 'orderDetails' ] [ 'postTaxRecurring' ] ] ) env . fout ( table )
Create a Reserved Capacity instance.

    *WARNING*: Reserved Capacity is on a yearly contract and not cancelable until the contract is expired.