Esempio n. 1
0
def cli(env, key, immediate):
    """Cancel a license."""

    licenses = SoftLayer.LicensesManager(env.client)

    item = licenses.cancel_item(key, immediate)

    if item:
        env.fout("License key: {} was cancelled.".format(key))
Esempio n. 2
0
def cli(env, key, datacenter):
    """Order/Create License."""

    item_package = [key]

    licenses = SoftLayer.LicensesManager(env.client)

    result = licenses.create(datacenter, item_package)

    table = formatting.KeyValueTable(['name', 'value'])
    table.align['name'] = 'r'
    table.align['value'] = 'l'
    table.add_row(['id', result['orderId']])
    table.add_row(['created', result['orderDate']])

    env.fout(table)