SoftLayer.vs_capacity

Reserved Capacity Manager and helpers

license

MIT, see License for more details.

class SoftLayer.managers.vs_capacity.CapacityManager(client, ordering_manager=None)[source]

Manages SoftLayer Reserved Capacity Groups.

Parameters
  • client (SoftLayer.API.BaseClient) – the client instance

  • ordering_manager (SoftLayer.managers.OrderingManager) – an optional manager to handle ordering. If none is provided, one will be auto initialized.

create(name, backend_router_id, flavor, instances, test=False)[source]

Orders a Virtual_ReservedCapacityGroup

Parameters
  • name (string) – Name for the new reserved capacity

  • backend_router_id (int) – This selects the pod. See create_options for a list

  • flavor (string) – Capacity KeyName, see create_options for a list

  • instances (int) – Number of guest this capacity can support

  • test (bool) – If True, don’t actually order, just test.

create_guest(capacity_id, test, guest_object)[source]

Turns an empty Reserve Capacity into a real Virtual Guest

Parameters
  • capacity_id (int) – ID of the RESERVED_CAPACITY_GROUP to create this guest into

  • test (bool) – True will use verifyOrder, False will use placeOrder

  • guest_object (dictionary) – Below is the minimum info you need to send in guest_object = { ‘domain’: ‘test.com’, ‘hostname’: ‘A1538172419’, ‘os_code’: ‘UBUNTU_LATEST_64’, ‘primary_disk’: ‘25’, }

get_available_routers(dc=None)[source]

Pulls down all backendRouterIds that are available

Parameters

dc (string) – A specific location to get routers for, like ‘dal13’.

Returns list

A list of locations where RESERVED_CAPACITY can be ordered.

get_create_options()[source]

List available reserved capacity plans

get_object(identifier, mask=None)[source]

Get a Reserved Capacity Group

Parameters
  • identifier (int) – Id of the SoftLayer_Virtual_ReservedCapacityGroup

  • mask (string) – override default object Mask

list()[source]

List Reserved Capacities

resolve_ids(identifier)

Takes a string and tries to resolve to a list of matching ids.

What exactly ‘identifier’ can be depends on the resolvers

Parameters

identifier (string) – identifying string

Returns list