SoftLayer.network

Network Manager/helpers

license:MIT, see LICENSE for more details.
class SoftLayer.managers.network.NetworkManager(client)[source]

Manage Networks

add_global_ip(version=4, test_order=False)[source]

Adds a global IP address to the account.

Parameters:
  • version (int) – Specifies whether this is IPv4 or IPv6
  • test_order (bool) – If true, this will only verify the order.
add_subnet(subnet_type, quantity=None, vlan_id=None, version=4, test_order=False)[source]

Orders a new subnet

Parameters:
  • subnet_type (str) – Type of subnet to add: private, public, global
  • quantity (int) – Number of IPs in the subnet
  • vlan_id (int) – VLAN id for the subnet to be placed into
  • version (int) – 4 for IPv4, 6 for IPv6
  • test_order (bool) – If true, this will only verify the order.
assign_global_ip(global_ip_id, target)[source]

Assigns a global IP address to a specified target.

Parameters:
  • global_ip_id (int) – The ID of the global IP being assigned
  • target (string) – The IP address to assign
cancel_global_ip(global_ip_id)[source]

Cancels the specified global IP address.

Parameters:id (int) – The ID of the global IP to be cancelled.
cancel_subnet(subnet_id)[source]

Cancels the specified subnet.

Parameters:subnet_id (int) – The ID of the subnet to be cancelled.
edit_rwhois(abuse_email=None, address1=None, address2=None, city=None, company_name=None, country=None, first_name=None, last_name=None, postal_code=None, private_residence=None, state=None)[source]

Edit rwhois record

get_rwhois()[source]

Returns the RWhois information about the current account.

Returns:A dictionary containing the account’s RWhois information.
get_subnet(subnet_id, **kwargs)[source]

Returns information about a single subnet.

Parameters:id (string) – Either the ID for the subnet or its network identifier
Returns:A dictionary of information about the subnet
get_vlan(vlan_id)[source]

Returns information about a single VLAN.

Parameters:id (int) – The unique identifier for the VLAN
Returns:A dictionary containing a large amount of information about the specified VLAN.
ip_lookup(ip_address)[source]

Looks up an IP address and returns network information about it.

Parameters:ip_address (string) – An IP address. Can be IPv4 or IPv6
Returns:A dictionary of information about the IP
list_global_ips(version=None, identifier=None, **kwargs)[source]

Returns a list of all global IP address records on the account.

Parameters:
  • version (int) – Only returns IPs of this version (4 or 6)
  • identifier (string) – If specified, the list will only contain the global ips matching this network identifier.
list_subnets(identifier=None, datacenter=None, version=0, subnet_type=None, **kwargs)[source]

Display a list of all subnets on the account.

This provides a quick overview of all subnets including information about data center residence and the number of devices attached.

Parameters:
  • identifier (string) – If specified, the list will only contain the subnet matching this network identifier.
  • datacenter (string) – If specified, the list will only contain subnets in the specified data center.
  • version (int) – Only returns subnets of this version (4 or 6).
  • subnet_type (string) – If specified, it will only returns subnets of this type.
  • **kwargs (dict) – response-level options (mask, limit, etc.)
list_vlans(datacenter=None, vlan_number=None, name=None, **kwargs)[source]

Display a list of all VLANs on the account.

This provides a quick overview of all VLANs including information about data center residence and the number of devices attached.

Parameters:
  • datacenter (string) – If specified, the list will only contain VLANs in the specified data center.
  • vlan_number (int) – If specified, the list will only contain the VLAN matching this VLAN number.
  • name (int) – If specified, the list will only contain the VLAN matching this VLAN name.
  • **kwargs (dict) – response-level options (mask, limit, etc.)
resolve_global_ip_ids(identifier)[source]

Resolve global ip ids

resolve_subnet_ids(identifier)[source]

Resolve subnet ids

resolve_vlan_ids(identifier)[source]

Resolve VLAN ids

summary_by_datacenter()[source]

Provides a dictionary with a summary of all network information on the account, grouped by data center.

The resultant dictionary is primarily useful for statistical purposes. It contains count information rather than raw data. If you want raw information, see the list_vlans() method instead.

Returns:A dictionary keyed by data center with the data containing a series of counts for hardware, subnets, CCIs, and other objects residing within that data center.
unassign_global_ip(global_ip_id)[source]

Unassigns a global IP address from a target.

Parameters:id (int) – The ID of the global IP being unassigned