SoftLayer.hardware

Hardware Manager/helpers

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

BSD, see LICENSE for more details.

class SoftLayer.managers.hardware.HardwareManager(client)[source]

Manages hardware devices.

cancel_hardware(id, reason='unneeded', comment='')[source]

Cancels the specified dedicated server.

Parameters:
  • id (int) – The ID of the hardware to be cancelled.
  • immediate (bool) – If true, the hardware will be cancelled immediately. Otherwise, it will be scheduled to cancel on the anniversary date.
  • reason (string) – The reason code for the cancellation.
cancel_metal(id, immediate=False)[source]

Cancels the specified bare metal instance.

Parameters:
  • id (int) – The ID of the bare metal instance to be cancelled.
  • immediate (bool) – If true, the bare metal instance will be cancelled immediately. Otherwise, it will be scheduled to cancel on the anniversary date.
change_port_speed(id, public, speed)[source]

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

Parameters:
  • id (int) – The ID of the server
  • 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.
edit(id, userdata=None, hostname=None, domain=None, notes=None)[source]

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

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 the hardware to edit. If none exist it will be created
  • hostname (string) – valid hostname
  • domain (string) – valid domain namem
  • notes (string) – notes about this particular hardware
get_available_dedicated_server_packages()[source]

Retrieves a list of packages that are available for ordering dedicated servers.

Note - This currently returns a hard coded list until the API is updated to allow filtering on packages to just those for ordering servers.

get_bare_metal_create_options()[source]

Retrieves the available options for creating a bare metal server.

The information for ordering bare metal instances comes from multiple API calls. In order to make the process easier, this function will make those calls and reformat the results into a dictionary that’s easier to manage. It’s recommended that you cache these results with a reasonable lifetime for performance reasons.

get_cancellation_reasons()[source]
get_dedicated_server_create_options(package_id)[source]

Retrieves the available options for creating a dedicated server in a specific chassis (based on package ID).

The information for ordering dedicated servers comes from multiple API calls. In order to make the process easier, this function will make those calls and reformat the results into a dictionary that’s easier to manage. It’s recommended that you cache these results with a reasonable lifetime for performance reasons.

get_hardware(id, **kwargs)[source]

Get details about a hardware device

Parameters:id (integer) – the hardware ID
list_hardware(tags=None, cpus=None, memory=None, hostname=None, domain=None, datacenter=None, nic_speed=None, public_ip=None, private_ip=None, **kwargs)[source]

List all hardware.

Parameters:
  • tags (list) – filter based on tags
  • cpus (integer) – filter based on number of CPUS
  • memory (integer) – filter based on amount of memory in gigabytes
  • hostname (string) – filter based on hostname
  • domain (string) – filter based on domain
  • 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.)
place_order(**kwargs)[source]

Places an order for a piece of hardware. See _generate_create_dict for a list of available options.

reload(id, post_uri=None)[source]

Perform an OS reload of a server 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
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 = []
verify_order(**kwargs)[source]

Verifies an order for a piece of hardware without actually placing it. See _generate_create_dict for a list of available options.

SoftLayer.managers.hardware.get_default_value(package_options, category)[source]

Previous topic

SoftLayer.firewall

Next topic

SoftLayer.messaging

This Page