SoftLayer.ipsec

IPSec VPN Manager

license

MIT, see LICENSE for more details.

class SoftLayer.managers.ipsec.IPSECManager(client)[source]

Manage SoftLayer IPSEC VPN tunnel contexts.

This provides helpers to manage IPSEC contexts, private and remote subnets, and NAT translations.

Parameters
add_internal_subnet(context_id, subnet_id)[source]

Add an internal subnet to a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the internal subnet.

Return bool

True if internal subnet addition was successful.

add_remote_subnet(context_id, subnet_id)[source]

Adds a remote subnet to a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the remote subnet.

Return bool

True if remote subnet addition was successful.

add_service_subnet(context_id, subnet_id)[source]

Adds a service subnet to a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the service subnet.

Return bool

True if service subnet addition was successful.

apply_configuration(context_id)[source]

Requests network configuration for a tunnel context.

Parameters

context_id (int) – The id-value representing the context instance.

Return bool

True if the configuration request was successfully queued.

create_remote_subnet(account_id, identifier, cidr)[source]

Creates a remote subnet on the given account.

Parameters
  • account_id (string) – The account identifier.

  • identifier (string) – The network identifier of the remote subnet.

  • cidr (string) – The CIDR value of the remote subnet.

Return dict

Mapping of properties for the new remote subnet.

create_translation(context_id, static_ip, remote_ip, notes)[source]

Creates an address translation on a tunnel context/

Parameters
  • context_id (int) – The id-value representing the context instance.

  • static_ip (string) – The IP address value representing the internal side of the translation entry,

  • remote_ip (string) – The IP address value representing the remote side of the translation entry,

  • notes (string) – The notes to supply with the translation entry,

Return dict

Mapping of properties for the new translation entry.

delete_remote_subnet(subnet_id)[source]

Deletes a remote subnet from the current account.

Parameters

subnet_id (string) – The id-value representing the remote subnet.

Return bool

True if subnet deletion was successful.

get_translation(context_id, translation_id)[source]

Retrieves a translation entry for the given id values.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • translation_id (int) – The id-value representing the translation instance.

Return dict

Mapping of properties for the translation entry.

Raises

SoftLayerAPIError – If a translation cannot be found.

get_translations(context_id)[source]

Retrieves all translation entries for a tunnel context.

Parameters

context_id (int) – The id-value representing the context instance.

Return list(dict)

Translations associated with the given context

get_tunnel_context(context_id, **kwargs)[source]

Retrieves the network tunnel context instance.

Parameters

context_id (int) – The id-value representing the context instance.

Return dict

Mapping of properties for the tunnel context.

Raises

SoftLayerAPIError – If a context cannot be found.

get_tunnel_contexts(**kwargs)[source]

Retrieves network tunnel module context instances.

Return list(dict)

Contexts associated with the current account.

remove_internal_subnet(context_id, subnet_id)[source]

Remove an internal subnet from a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the internal subnet.

Return bool

True if internal subnet removal was successful.

remove_remote_subnet(context_id, subnet_id)[source]

Removes a remote subnet from a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the remote subnet.

Return bool

True if remote subnet removal was successful.

remove_service_subnet(context_id, subnet_id)[source]

Removes a service subnet from a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • subnet_id (int) – The id-value representing the service subnet.

Return bool

True if service subnet removal was successful.

remove_translation(context_id, translation_id)[source]

Removes a translation entry from a tunnel context.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • translation_id (int) – The id-value representing the translation.

Return bool

True if translation entry removal was successful.

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

update_translation(context_id, translation_id, static_ip=None, remote_ip=None, notes=None)[source]

Updates an address translation entry using the given values.

Parameters
  • context_id (int) – The id-value representing the context instance.

  • template (dict) – A key-value mapping of translation properties.

  • static_ip (string) – The static IP address value to update.

  • remote_ip (string) – The remote IP address value to update.

  • notes (string) – The notes value to update.

Return bool

True if the update was successful.

update_tunnel_context(context_id, friendly_name=None, remote_peer=None, preshared_key=None, phase1_auth=None, phase1_crypto=None, phase1_dh=None, phase1_key_ttl=None, phase2_auth=None, phase2_crypto=None, phase2_dh=None, phase2_forward_secrecy=None, phase2_key_ttl=None)[source]

Updates a tunnel context using the given values.

Parameters
  • context_id (string) – The id-value representing the context.

  • friendly_name (string) – The friendly name value to update.

  • remote_peer (string) – The remote peer IP address value to update.

  • preshared_key (string) – The preshared key value to update.

  • phase1_auth (string) – The phase 1 authentication value to update.

  • phase1_crypto (string) – The phase 1 encryption value to update.

  • phase1_dh (string) – The phase 1 diffie hellman group value to update.

  • phase1_key_ttl (string) – The phase 1 key life value to update.

  • phase2_auth (string) – The phase 2 authentication value to update.

  • phase2_crypto (string) – The phase 2 encryption value to update.

  • phase2_df (string) – The phase 2 diffie hellman group value to update.

  • phase2_forward_secriecy (string) – The phase 2 perfect forward secrecy value to update.

  • phase2_key_ttl (string) – The phase 2 key life value to update.

Return bool

True if the update was successful.