SoftLayer.cci

CCI Manager/helpers

copyright:
  1. 2013, SoftLayer Technologies, Inc. All rights reserved.
license:

MIT, see LICENSE for more details.

class SoftLayer.managers.cci.CCIManager(client)[source]

Manage CCIs

account = None

Reference to the SoftLayer_Account API object.

cancel_instance(id)[source]

Cancel an instance immediately, deleting all its data.

Parameters:id (integer) – the instance ID to cancel
change_port_speed(id, public, speed)[source]

Allows you to change the port speed of a CCI’s NICs.

Parameters:
  • id (int) – The ID of the CCI
  • public (bool) – Flag to indicate which interface to change. True (default) means the public interface. False indicates the private interface.
  • speed (int) – The port speed to set.
client = None

A valid SoftLayer.API.Client object that will be used for all actions.

create_instance(**kwargs)[source]

Orders a new instance. See _generate_create_dict() for a list of available options.

edit(id, userdata=None, hostname=None, domain=None, notes=None)[source]

Edit hostname, domain name, notes, and/or the user data of a CCI

Parameters set to None will be ignored and not attempted to be updated.

Parameters:
  • id (integer) – the instance ID to edit
  • userdata (string) – user data on CCI to edit. If none exist it will be created
  • hostname (string) – valid hostname
  • domain (string) – valid domain namem
  • notes (string) – notes about this particular CCI
get_create_options()[source]

Retrieves the available options for creating a CCI.

Returns:A dictionary of creation options.
get_instance(id, **kwargs)[source]

Get details about a CCI instance

Parameters:id (integer) – the instance ID
Returns:A dictionary containing a large amount of information about the specified instance.
guest = None

Reference to the SoftLayer_Virtual_Guest API object.

list_instances(hourly=True, monthly=True, tags=None, cpus=None, memory=None, hostname=None, domain=None, local_disk=None, datacenter=None, nic_speed=None, public_ip=None, private_ip=None, **kwargs)[source]

Retrieve a list of all CCIs on the account.

Parameters:
  • hourly (boolean) – include hourly instances
  • monthly (boolean) – include monthly instances
  • tags (list) – filter based on tags
  • cpus (integer) – filter based on number of CPUS
  • memory (integer) – filter based on amount of memory
  • hostname (string) – filter based on hostname
  • domain (string) – filter based on domain
  • local_disk (string) – filter based on local_disk
  • datacenter (string) – filter based on datacenter
  • nic_speed (integer) – filter based on network speed (in MBPS)
  • public_ip (string) – filter based on public ip address
  • private_ip (string) – filter based on private ip address
  • **kwargs (dict) – response-level arguments (limit, offset, etc.)
Returns:

Returns a list of dictionaries representing the matching CCIs

# Print out a list of all hourly CCIs in the DAL05 data center.
# env variables
# SL_USERNAME = YOUR_USERNAME
# SL_API_KEY = YOUR_API_KEY
import SoftLayer
client = SoftLayer.Client()

mgr = SoftLayer.CCIManager(client)
for cci in mgr.list_instances(hourly=True, datacenter='dal05'):
    print cci['fullyQualifiedDomainName'], cci['primaryIpAddress']
reload_instance(id, post_uri=None, ssh_keys=None)[source]

Perform an OS reload of an instance with its current configuration.

Parameters:
  • id (integer) – the instance ID to reload
  • post_url (string) – The URI of the post-install script to run after reload
  • ssh_keys (list) – The SSH keys to add to the root user
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:
resolvers = []

A list of resolver functions. Used primarily by the CLI to provide a variety of methods for uniquely identifying an object such as hostname and IP address.

verify_create_instance(**kwargs)[source]

Verifies an instance creation command without actually placing an order. See _generate_create_dict() for a list of available options.

wait_for_transaction(id, limit, delay=1)[source]

Waits on a CCI transaction for the specified amount of time.

Parameters:
  • id (int) – The instance ID with the pending transaction
  • limit (int) – The maximum amount of time to wait.
  • delay (int) – The number of seconds to sleep before checks. Defaults to 1.

Project Versions

Previous topic

API Documentation

Next topic

SoftLayer.dns

This Page