NTT America Public Cloud Compute Driver Documentation

The NTT America Cloud delivers enterprise-class infrastructure that allows customers to scale to meet demand in real time, and then shut down those resources when they are no longer needed. The deployment of private networks, each with their own customizable firewall, enables test and development environments to be logically separated, but still in the same VMware environment in which the applications will run.

Private networks, firewalls, load balancing and servers are deployed in minutes through the easy-to-use web-based control panel, or through standards based APIs. The support of burstable CPU means that capacity is always available when needed. The flexible payment and reporting options mean customers can get detailed reports on activity across their organization, allocate costs where appropriate, and receive valuable information for management and budgeting purposes.

../../_images/ntta.png

CaaS has its own non-standard API , libcloud provides a Python wrapper on top of this API with common methods with other IaaS solutions and Public cloud providers. Therefore, you can use use the NTT America libcloud driver to communicate with both the public and private clouds.

Instantiating a driver

When you instantiate a driver you need to pass the following arguments to the driver constructor:

  • user_id - Your NTT America Cloud username
  • key - Your NTT America Cloud password
  • region - The region key, one of the possible region keys

Possible regions:

  • ntta-na : NTT America North America (USA) - Default
  • ntta-eu : NTT America Europe
  • ntta-af : NTT America Africa
  • ntta-au : NTT America Australia
  • ntta-ap : NTT America Asia Pacific
from pprint import pprint

from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver

cls = get_driver(Provider.NTTA)
driver = cls('my username', 'my password', region='ntta-na')

pprint(driver.list_nodes())

The base libcloud API allows you to:

  • list nodes, images, instance types, locations

Non-standard functionality and extension methods

The NTT America driver exposes some libcloud non-standard functionalities through extension methods and arguments.

These functionalities include:

  • start and stop a node
  • list networks
  • create firewalls, configure network address translation
  • provision layer 3 networks

For information on how to use these functionalities please see the method docstrings below. You can also use an interactive shell for exploration as shown in the examples.

API Docs

class libcloud.compute.drivers.ntta.NTTAmericaNodeDriver(key, secret=None, secure=True, host=None, port=None, api_version=None, region='ntta-na', **kwargs)[source]

NTT America node driver, based on Dimension Data driver

attach_volume(node, volume, device=None)

Attaches volume to node.

Parameters:
  • node (Node) – Node to attach volume to.
  • volume (StorageVolume) – Volume to attach.
  • device (str) – Where the device is exposed, e.g. ‘/dev/sdb’
Rytpe:

bool

connectionCls

alias of DimensionDataConnection

copy_image(source_region, node_image, name, description=None)

Copies an image from a source region to the current region.

Parameters:
  • source_region (str) – Region to copy the node from.
  • node_image (NodeImage:) – NodeImage to copy.
  • name (str) – name for new image.
  • description – description for new image.
Return type:

NodeImage:

Returns:

NodeImage instance on success.

create_image(node, name, description=None)

Creates an image from a node object.

Parameters:
  • node (Node) – Node to run the task on.
  • name (description) – name for new image.
  • description – description for new image.
Return type:

NodeImage:

Returns:

NodeImage instance on success.

create_key_pair(name)

Create a new key pair object.

Parameters:name (str) – Key pair name.
create_node(name, image, auth, ex_description, ex_network=None, ex_network_domain=None, ex_vlan=None, ex_primary_ipv4=None, ex_memory_gb=None, ex_cpu_specification=None, ex_is_started=True, ex_additional_nics_vlan=None, ex_additional_nics_ipv4=None, ex_primary_dns=None, ex_secondary_dns=None, **kwargs)

Create a new DimensionData node

Parameters:
  • name (str) – String with a name for this new node (required)
  • image (NodeImage or str) – OS Image to boot on node. (required)
  • auth (NodeAuthPassword or str or None) – Initial authentication information for the node. (If this is a customer LINUX image auth will be ignored)
  • ex_description (str) – description for this node (required)
  • ex_network (DimensionDataNetwork or str) – Network to create the node within (required unless using ex_network_domain or ex_primary_ipv4)
  • ex_network_domain (DimensionDataNetworkDomain or str) – Network Domain to create the node (required unless using network or ex_primary_ipv4)
  • ex_primary_ipv4 (str) – Primary nics IPv4 Address MCP1: (required unless ex_network) MCP2: (required unless ex_vlan)
  • ex_vlan (DimensionDataVlan or str) – VLAN to create the node within (required unless using network)
  • ex_memory_gb (int) – The amount of memory in GB for the server
  • ex_cpu_specification (DimensionDataServerCpuSpecification) – The spec of CPU to deploy (optional)
  • ex_is_started (bool) – Start server after creation? default true (required)
  • ex_additional_nics_vlan (list of DimensionDataVlan or list of str) – (MCP2 Only) List of additional nics to add by vlan
  • ex_additional_nics_ipv4 (list of str) – (MCP2 Only) List of additional nics to add by ipv4 address
  • ex_primary_dns (str) – The node’s primary DNS
  • ex_secondary_dns (str) – The node’s secondary DNS
Returns:

The newly created Node.

Return type:

Node

create_volume(size, name, location=None, snapshot=None)

Create a new volume.

Parameters:
  • size (int) – Size of volume in gigabytes (required)
  • name (str) – Name of the volume to be created
  • location (NodeLocation) – Which data center to create a volume in. If empty, undefined behavior will be selected. (optional)
  • snapshot (VolumeSnapshot) – Snapshot from which to create the new volume. (optional)
Returns:

The newly created volume.

Return type:

StorageVolume

create_volume_snapshot(volume, name=None)

Creates a snapshot of the storage volume.

Parameters:
  • volume (VolumeSnapshot) – The StorageVolume to create a VolumeSnapshot from
  • name (str) – Name of created snapshot (optional)
Return type:

VolumeSnapshot

delete_image(node_image)

Deletes a node image from a provider.

Parameters:node_image (NodeImage) – Node image object.
Returns:True if delete_image was successful, False otherwise.
Return type:bool
delete_key_pair(key_pair)

Delete an existing key pair.

Parameters:key_pair (KeyPair) – Key pair object.
deploy_node(**kwargs)

Create a new node, and start deployment.

In order to be able to SSH into a created node access credentials are required.

A user can pass either a NodeAuthPassword or NodeAuthSSHKey to the auth argument. If the create_node implementation supports that kind if credential (as declared in self.features['create_node']) then it is passed on to create_node. Otherwise it is not passed on to create_node and it is only used for authentication.

If the auth parameter is not supplied but the driver declares it supports generates_password then the password returned by create_node will be used to SSH into the server.

Finally, if the ssh_key_file is supplied that key will be used to SSH into the server.

This function may raise a DeploymentException, if a create_node call was successful, but there is a later error (like SSH failing or timing out). This exception includes a Node object which you may want to destroy if incomplete deployments are not desirable.

>>> from libcloud.compute.drivers.dummy import DummyNodeDriver
>>> from libcloud.compute.deployment import ScriptDeployment
>>> from libcloud.compute.deployment import MultiStepDeployment
>>> from libcloud.compute.base import NodeAuthSSHKey
>>> driver = DummyNodeDriver(0)
>>> key = NodeAuthSSHKey('...') # read from file
>>> script = ScriptDeployment("yum -y install emacs strace tcpdump")
>>> msd = MultiStepDeployment([key, script])
>>> def d():
...     try:
...         driver.deploy_node(deploy=msd)
...     except NotImplementedError:
...         print ("not implemented for dummy driver")
>>> d()
not implemented for dummy driver

Deploy node is typically not overridden in subclasses. The existing implementation should be able to handle most such.

Parameters:
  • deploy (Deployment) – Deployment to run once machine is online and available to SSH.
  • ssh_username (str) – Optional name of the account which is used when connecting to SSH server (default is root)
  • ssh_alternate_usernames (list) – Optional list of ssh usernames to try to connect with if using the default one fails
  • ssh_port (int) – Optional SSH server port (default is 22)
  • ssh_timeout (float) – Optional SSH connection timeout in seconds (default is 10)
  • auth (NodeAuthSSHKey or NodeAuthPassword) – Initial authentication information for the node (optional)
  • ssh_key (str or list of str) – A path (or paths) to an SSH private key with which to attempt to authenticate. (optional)
  • timeout (int) – How many seconds to wait before timing out. (default is 600)
  • max_tries (int) – How many times to retry if a deployment fails before giving up (default is 3)
  • ssh_interface (str) – The interface to wait for. Default is ‘public_ips’, other option is ‘private_ips’.
destroy_node(node)

Deletes a node, node must be stopped before deletion

Parameters:node (Node) – The node to delete
Return type:bool
destroy_volume(volume)

Destroys a storage volume.

Parameters:volume (StorageVolume) – Volume to be destroyed
Return type:bool
destroy_volume_snapshot(snapshot)

Destroys a snapshot.

Parameters:snapshot (VolumeSnapshot) – The snapshot to delete
Return type:bool
detach_volume(volume)

Detaches a volume from a node.

Parameters:volume (StorageVolume) – Volume to be detached
Return type:bool
ex_add_storage_to_node(node, amount, speed='STANDARD', scsi_id=None)

Add storage to the node

Parameters:
  • node (Node) – The server to add storage to
  • amount (int) – The amount of storage to add, in GB
  • speed (str) – The disk speed type
  • scsi_id (int) – The target SCSI ID (optional)
Return type:

bool

ex_apply_tag_to_asset(asset, tag_key, value=None)

Apply a tag to a Dimension Data Asset

Parameters:
  • asset (Node or NodeImage or DimensionDataNewtorkDomain or DimensionDataVlan or DimensionDataPublicIpBlock) – The asset to apply a tag to. (required)
  • tag_key (DimensionDataTagKey or str) – The tag_key to apply to the asset. (required)
  • value (str) – The value to be assigned to the tag key This is only required if the DimensionDataTagKey requires it
Return type:

bool

ex_attach_node_to_vlan(node, vlan=None, private_ipv4=None)

Attach a node to a VLAN by adding an additional NIC to the node on the target VLAN. The IP will be automatically assigned based on the VLAN IP network space. Alternatively, provide a private IPv4 address instead of VLAN information, and this will be assigned to the node on corresponding NIC.

Parameters:
  • node (Node) – Node which should be used
  • vlan (DimensionDataVlan) – VLAN to attach the node to (required unless private_ipv4)
  • private_ipv4 (str) – Private nic IPv4 Address (required unless vlan)
Return type:

bool

ex_audit_log_report(start_date, end_date)

Get audit log report

Parameters:
  • start_date (str in format YYYY-MM-DD) – Start date for the report
  • end_date (str in format YYYY-MM-DD) – End date for the report
Return type:

list of list

ex_backup_usage_report(start_date, end_date, location)

Get audit log report

Parameters:
  • start_date (str in format YYYY-MM-DD) – Start date for the report
  • end_date (str in format YYYY-MM-DD) – End date for the report
  • location (NodeLocation or str) – Filters the node list to nodes that are located in this location
Return type:

list of list

ex_change_storage_size(node, disk_id, size)

Change the size of a disk

Parameters:
  • node (Node) – The server to change the disk of
  • disk_id (str) – The ID of the disk to resize
  • size (int) – The disk size in GB
Return type:

bool

ex_change_storage_speed(node, disk_id, speed)

Change the speed (disk tier) of a disk

Parameters:
  • node (Node) – The server to change the disk speed of
  • disk_id (str) – The ID of the disk to change
  • speed (str) – The disk speed type e.g. STANDARD
Return type:

bool

ex_clean_failed_deployment(node)

Removes a node that has failed to deploy

Parameters:node (Node or str) – The failed node to clean
ex_clone_node_to_image(node, image_name, image_description=None)

Clone a server into a customer image.

Parameters:
  • node (Node) – The server to clone
  • image_name (str) – The name of the clone image
  • description (str) – The description of the image
Return type:

bool

ex_create_anti_affinity_rule(node_list)

Create an anti affinity rule given a list of nodes Anti affinity rules ensure that servers will not reside on the same VMware ESX host

Parameters:node_list (list of Node or list of str) – The list of nodes to create a rule for
Return type:bool
ex_create_firewall_rule(network_domain, rule, position, position_relative_to_rule=None)

Creates a firewall rule

Parameters:
  • network_domain (DimensionDataNetworkDomain or str) – The network domain in which to create the firewall rule
  • rule (DimensionDataFirewallRule) – The rule in which to create
  • position (str) – The position in which to create the rule There are two types of positions with position_relative_to_rule arg and without it With: ‘BEFORE’ or ‘AFTER’ Without: ‘FIRST’ or ‘LAST’
  • position_relative_to_rule (DimensionDataFirewallRule or str) – The rule or rule name in which to decide positioning by
Return type:

bool

ex_create_nat_rule(network_domain, internal_ip, external_ip)

Create a NAT rule

Parameters:
  • network_domain (DimensionDataNetworkDomain) – The network domain the rule belongs to
  • internal_ip (str) – The IPv4 address internally
  • external_ip (str) – The IPv4 address externally
Return type:

DimensionDataNatRule

ex_create_network(location, name, description=None)

Create a new network in an MCP 1.0 location

Parameters:
  • location (NodeLocation or str) – The target location (MCP1)
  • name (str) – The name of the network
  • description (str) – Additional description of the network
Returns:

A new instance of DimensionDataNetwork

Return type:

Instance of DimensionDataNetwork

ex_create_network_domain(location, name, service_plan, description=None)

Deploy a new network domain to a data center

Parameters:
  • location (NodeLocation or str) – The data center to list
  • name (str) – The name of the network domain to create
  • service_plan (str) – The service plan, either “ESSENTIALS” or “ADVANCED”
  • description (str) – An additional description of the network domain
Returns:

an instance of DimensionDataNetworkDomain

Return type:

DimensionDataNetworkDomain

ex_create_tag_key(name, description=None, value_required=True, display_on_report=True)

Creates a tag key in the Dimension Data Cloud

Parameters:
  • name (str) – The name of the tag key (required)
  • description (str) – The description of the tag key
  • value_required (bool) – If a value is required for the tag Tags themselves can be just a tag, or be a key/value pair
  • display_on_report (bool) – Should this key show up on the usage reports
Return type:

bool

ex_create_vlan(network_domain, name, private_ipv4_base_address, description=None, private_ipv4_prefix_size=24)

Deploy a new VLAN to a network domain

Parameters:
  • network_domain (DimensionDataNetworkDomain) – The network domain to add the VLAN to
  • name (str) – The name of the VLAN to create
  • private_ipv4_base_address (str) – The base IPv4 address e.g. 192.168.1.0
  • description (str) – An additional description of the VLAN
  • private_ipv4_prefix_size (int) – The size of the IPv4 address space, e.g 24
Returns:

an instance of DimensionDataVlan

Return type:

DimensionDataVlan

ex_delete_anti_affinity_rule(anti_affinity_rule)

Remove anti affinity rule

Parameters:anti_affinity_rule (DimensionDataAntiAffinityRule or str) – The anti affinity rule to delete
Return type:bool
ex_delete_firewall_rule(rule)

Delete a firewall rule

Parameters:rule (DimensionDataFirewallRule) – The rule to delete
Return type:bool
ex_delete_nat_rule(rule)

Delete an existing NAT rule

Parameters:rule (DimensionDataNatRule) – The rule to delete
Return type:bool
ex_delete_network(network)

Delete a network from an MCP 1 data center

Parameters:network (DimensionDataNetwork) – The network to delete
Return type:bool
ex_delete_network_domain(network_domain)

Delete a network domain

Parameters:network_domain (DimensionDataNetworkDomain) – The network domain to delete
Return type:bool
ex_delete_vlan(vlan)

Deletes an existing VLAN

Parameters:vlan (DimensionDataNetworkDomain) – The VLAN to delete
Return type:bool
ex_destroy_nic(nic_id)

Remove a NIC on a node, removing the node from a VLAN

Parameters:nic_id (str) – The identifier of the NIC to remove
Return type:bool
ex_detailed_usage_report(start_date, end_date)

Get detailed usage information

Parameters:
  • start_date (str in format YYYY-MM-DD) – Start date for the report
  • end_date (str in format YYYY-MM-DD) – End date for the report
Return type:

list of list

ex_disable_monitoring(node)

Disables cloud monitoring for a node

Parameters:node (Node) – The node to stop monitoring
Return type:bool
ex_enable_monitoring(node, service_plan='ESSENTIALS')

Enables cloud monitoring on a node

Parameters:
  • node (Node) – The node to monitor
  • service_plan (str) – The service plan, one of ESSENTIALS or ADVANCED
Return type:

bool

ex_expand_vlan(vlan)

Expands the VLAN to the prefix size in private_ipv4_range_size The expansion will not be permitted if the proposed IP space overlaps with an already deployed VLANs IP space.

Parameters:vlan (DimensionDataNetworkDomain) – The VLAN to update
Returns:an instance of DimensionDataVlan
Return type:DimensionDataVlan
ex_get_base_image_by_id(id)

Gets a Base image in the Dimension Data Cloud given the id

Parameters:id (str) – The id of the image
Return type:NodeImage
ex_get_customer_image_by_id(id)

Gets a Customer image in the Dimension Data Cloud given the id

Parameters:id (str) – The id of the image
Return type:NodeImage
ex_get_image_by_id(id)

Gets a Base/Customer image in the Dimension Data Cloud given the id

Note: This first checks the base image
If it is not a base image we check if it is a customer image If it is not in either of these a DimensionDataAPIException is thrown
Parameters:id (str) – The id of the image
Return type:NodeImage
ex_get_location_by_id(id)

Get location by ID.

Parameters:id (str) – ID of the node location which should be used
Return type:NodeLocation
ex_get_nat_rule(network_domain, rule_id)

Get a NAT rule by ID

Parameters:
  • network_domain (DimensionDataNetworkDomain) – The network domain the rule belongs to
  • rule_id (str) – The ID of the NAT rule to fetch
Return type:

DimensionDataNatRule

ex_get_network_domain(network_domain_id)

Get an individual Network Domain, by identifier

Parameters:network_domain_id (str) – The identifier of the network domain
Return type:DimensionDataNetworkDomain
ex_get_tag_key_by_id(id)

Get a specific tag key by ID

Parameters:id (str) – ID of the tag key you want (required)
Return type:DimensionDataTagKey
ex_get_tag_key_by_name(name)

Get a specific tag key by Name

Parameters:name (str) – Name of the tag key you want (required)
Return type:DimensionDataTagKey
ex_get_vlan(vlan_id)

Get a single VLAN, by it’s identifier

Parameters:vlan_id (str) – The identifier of the VLAN
Returns:an instance of DimensionDataVlan
Return type:DimensionDataVlan
ex_list_anti_affinity_rules(network=None, network_domain=None, node=None, filter_id=None, filter_state=None)

List anti affinity rules for a network, network domain, or node

Parameters:
  • network (DimensionDataNetwork or str) – The network to list anti affinity rules for One of network, network_domain, or node is required
  • network_domain (DimensionDataNetworkDomain or str) – The network domain to list anti affinity rules One of network, network_domain, or node is required
  • node (Node or str) – The node to list anti affinity rules for One of network, netwok_domain, or node is required
  • filter_id (str) – This will allow you to filter the rules by this node id
Return type:

list of DimensionDataAntiAffinityRule

ex_list_customer_images(location=None)

Return a list of customer imported images

Parameters:location (NodeLocation or str) – The target location
Return type:list of NodeImage
ex_list_nat_rules(network_domain)

Get NAT rules for the network domain

Parameters:network_domain (DimensionDataNetworkDomain) – The network domain the rules belongs to
Return type:list of DimensionDataNatRule
ex_list_network_domains(location=None, name=None, service_plan=None, state=None)

List networks domains deployed across all data center locations for your organization. The response includes the location of each network domain.

Parameters:
  • location (NodeLocation or str) – Only network domains in the location (optional)
  • name (str) – Only network domains of this name (optional)
  • service_plan (str) – Only network domains of this type (optional)
  • state (str) – Only network domains in this state (optional)
Returns:

a list of DimensionDataNetwork objects

Return type:

list of DimensionDataNetwork

ex_list_networks(location=None)

List networks deployed across all data center locations for your organization. The response includes the location of each network.

Parameters:location (NodeLocation or str) – The target location
Returns:a list of DimensionDataNetwork objects
Return type:list of DimensionDataNetwork
ex_list_nodes_paginated(name=None, location=None, ipv6=None, ipv4=None, vlan=None, image=None, deployed=None, started=None, state=None, network=None, network_domain=None)

Return a generator which yields node lists in pages

Parameters:
  • location (NodeLocation or str) – Filters the node list to nodes that are located in this location
  • name – Filters the node list to nodes that have this name

:type name str

Parameters:
  • ipv6 (str) – Filters the node list to nodes that have this ipv6 address
  • ipv4 (str) – Filters the node list to nodes that have this ipv4 address
  • vlan (DimensionDataVlan or str) – Filters the node list to nodes that are in this VLAN
  • image (NodeImage or str) – Filters the node list to nodes that have this image
  • deployed (bool) – Filters the node list to nodes that are deployed or not
  • started (bool) – Filters the node list to nodes that are started or not
  • state (str) – Filters the node list to nodes that are in this state
  • network (DimensionDataNetwork or str) – Filters the node list to nodes in this network
  • network_domain (DimensionDataNetworkDomain or str) – Filters the node list to nodes in this network domain
Returns:

a list of Node objects

Return type:

generator of list of Node

ex_list_tag_keys(id=None, name=None, value_required=None, display_on_report=None)

List tag keys in the Dimension Data Cloud

Parameters:
  • id (str) – Filter the list to the id of the tag key
  • name (str) – Filter the list to the name of the tag key
  • value_required (bool) – Filter the list to if a value is required for a tag key
  • display_on_report (bool) – Filter the list to if the tag key should show up on usage reports
Return type:

list of DimensionDataTagKey

ex_list_tags(asset_id=None, asset_type=None, location=None, tag_key_name=None, tag_key_id=None, value=None, value_required=None, display_on_report=None)

List tags in the Dimension Data Cloud

Parameters:
  • asset_id (str) – Filter the list by asset id
  • asset_type (str) – Filter the list by asset type
  • location (:class:NodeLocation or str) – Filter the list by the assets location
  • tag_key_name (str) – Filter the list by a tag key name
  • tag_key_id (str) – Filter the list by a tag key id
  • value (str) – Filter the list by a tag value
  • value_required (bool) – Filter the list to if a value is required for a tag
  • display_on_report (bool) – Filter the list to if the tag should show up on usage reports
Return type:

list of DimensionDataTag

ex_list_vlans(location=None, network_domain=None, name=None, ipv4_address=None, ipv6_address=None, state=None)

List VLANs available, can filter by location and/or network domain

Parameters:
  • location (NodeLocation or str) – Only VLANs in this location (optional)
  • network_domain (DimensionDataNetworkDomain) – Only VLANs in this domain (optional)
  • name (str) – Only VLANs with this name (optional)
  • ipv4_address (str) – Only VLANs with this ipv4 address (optional)
  • ipv6_address (str) – Only VLANs with this ipv6 address (optional)
  • state (str) – Only VLANs with this state (optional)
Returns:

a list of DimensionDataVlan objects

Return type:

list of DimensionDataVlan

ex_modify_tag_key(tag_key, name=None, description=None, value_required=None, display_on_report=None)

Modify a specific tag key

Parameters:
  • tag_key (DimensionDataTagKey or str) – The tag key you want to modify (required)
  • name (str) – Set to modifiy the name of the tag key
  • description (str) – Set to modify the description of the tag key
  • value_required (bool) – Set to modify if a value is required for the tag key
  • display_on_report (bool) – Set to modify if this tag key should display on the usage reports
Return type:

bool

ex_power_off(node)

This function will abruptly power-off a server. Unlike ex_shutdown_graceful, success ensures the node will stop but some OS and application configurations may be adversely affected by the equivalent of pulling the power plug out of the machine.

Parameters:node (Node) – Node which should be used
Return type:bool
ex_reconfigure_node(node, memory_gb, cpu_count, cores_per_socket, cpu_performance)

Reconfigure the virtual hardware specification of a node

Parameters:
  • node (Node) – The server to change
  • memory_gb (int) – The amount of memory in GB (optional)
  • cpu_count (int) – The number of CPU (optional)
  • cores_per_socket (int) – Number of CPU cores per socket (optional)
  • cpu_performance (str) – CPU Performance type (optional)
Return type:

bool

ex_remove_storage(disk_id)

Remove storage from a node

Parameters:
  • node (Node) – The server to add storage to
  • disk_id (str) – The ID of the disk to remove
Return type:

bool

ex_remove_storage_from_node(node, scsi_id)

Remove storage from a node

Parameters:
  • node (Node) – The server to add storage to
  • scsi_id (str) – The ID of the disk to remove
Return type:

bool

ex_remove_tag_from_asset(asset, tag_key)

Remove a tag from an asset

Parameters:
  • asset (Node or NodeImage or DimensionDataNewtorkDomain or DimensionDataVlan or DimensionDataPublicIpBlock) – The asset to remove a tag from. (required)
  • tag_key (DimensionDataTagKey or str) – The tag key you want to remove (required)
Return type:

bool

ex_remove_tag_key(tag_key)

Modify a specific tag key

Parameters:tag_key (DimensionDataTagKey or str) – The tag key you want to remove (required)
Return type:bool
ex_rename_network(network, new_name)

Rename a network in MCP 1 data center

Parameters:
  • network (DimensionDataNetwork) – The network to rename
  • new_name (str) – The new name of the network
Return type:

bool

ex_reset(node)

This function will abruptly reset a server. Unlike reboot_node, success ensures the node will restart but some OS and application configurations may be adversely affected by the equivalent of pulling the power plug out of the machine.

Parameters:node (Node) – Node which should be used
Return type:bool
ex_set_firewall_rule_state(rule, state)

Change the state (enabled or disabled) of a rule

Parameters:
  • rule (DimensionDataFirewallRule) – The rule to delete
  • state (bool) – The desired state enabled (True) or disabled (False)
Return type:

bool

ex_shutdown_graceful(node)

This function will attempt to “gracefully” stop a server by initiating a shutdown sequence within the guest operating system. A successful response on this function means the system has successfully passed the request into the operating system.

Parameters:node (Node) – Node which should be used
Return type:bool
ex_software_usage_report(start_date, end_date)

Get detailed software usage reports

Parameters:
  • start_date (str in format YYYY-MM-DD) – Start date for the report
  • end_date (str in format YYYY-MM-DD) – End date for the report
Return type:

list of list

ex_start_node(node)

Powers on an existing deployed server

Parameters:node (Node) – Node which should be used
Return type:bool
ex_summary_usage_report(start_date, end_date)

Get summary usage information

Parameters:
  • start_date (str in format YYYY-MM-DD) – Start date for the report
  • end_date (str in format YYYY-MM-DD) – End date for the report
Return type:

list of list

ex_update_monitoring_plan(node, service_plan='ESSENTIALS')

Updates the service plan on a node with monitoring

Parameters:
  • node (Node) – The node to monitor
  • service_plan (str) – The service plan, one of ESSENTIALS or ADVANCED
Return type:

bool

ex_update_network_domain(network_domain)

Update the properties of a network domain

Parameters:network_domain (DimensionDataNetworkDomain) – The network domain with updated properties
Returns:an instance of DimensionDataNetworkDomain
Return type:DimensionDataNetworkDomain
ex_update_node(node, name=None, description=None, cpu_count=None, ram_mb=None)

Update the node, the name, CPU or RAM

Parameters:
  • node (Node) – Node which should be used
  • name (str) – The new name (optional)
  • description (str) – The new description (optional)
  • cpu_count (int) – The new CPU count (optional)
  • ram_mb (int) – The new Memory in MB (optional)
Return type:

bool

ex_update_vlan(vlan)

Updates the properties of the given VLAN Only name and description are updated

Parameters:vlan (DimensionDataNetworkDomain) – The VLAN to update
Returns:an instance of DimensionDataVlan
Return type:DimensionDataVlan
ex_update_vm_tools(node)

This function triggers an update of the VMware Tools software running on the guest OS of a Server.

Parameters:node (Node) – Node which should be used
Return type:bool
ex_wait_for_state(state, func, poll_interval=2, timeout=60, *args, **kwargs)

Wait for the function which returns a instance with field status to match

Keep polling func until one of the desired states is matched

Parameters:
  • state (str or list) – Either the desired state (str) or a list of states
  • func (function) – The function to call, e.g. ex_get_vlan
  • poll_interval (int) – The number of seconds to wait between checks
  • timeout (int) – The total number of seconds to wait to reach a state
  • args (Positional arguments) – The arguments for func
  • kwargs (Keyword arguments) – The arguments for func
get_image(image_id)

Returns a single node image from a provider.

Parameters:image_id (str) – Node to run the task on.

:rtype NodeImage: :return: NodeImage instance on success.

get_key_pair(name)

Retrieve a single key pair.

Parameters:name (str) – Name of the key pair to retrieve.
Return type:KeyPair
import_key_pair_from_file(name, key_file_path)

Import a new public key from string.

Parameters:
  • name (str) – Key pair name.
  • key_file_path (str) – Path to the public key file.
Return type:

KeyPair object

import_key_pair_from_string(name, key_material)

Import a new public key from string.

Parameters:
  • name (str) – Key pair name.
  • key_material (str) – Public key material.
Return type:

KeyPair object

list_images(location=None)

List images available

Note: Currently only returns the default ‘base OS images’
provided by DimensionData. Customer images (snapshots) are not yet supported.
Parameters:ex_location (NodeLocation or str) – Filters the node list to nodes that are located in this location
Returns:List of images available
Return type:list of NodeImage
list_key_pairs()

List all the available key pair objects.

Return type:list of KeyPair objects
list_locations(ex_id=None)

List locations (datacenters) available for instantiating servers and networks.

Parameters:ex_id (str) – Filters the location list to this id
Returns:List of locations
Return type:list of NodeLocation
list_networks(location=None)

List networks deployed across all data center locations for your organization. The response includes the location of each network.

Parameters:location (NodeLocation or str) – The location
Returns:a list of DimensionDataNetwork objects
Return type:list of DimensionDataNetwork
list_nodes(ex_location=None, ex_name=None, ex_ipv6=None, ex_ipv4=None, ex_vlan=None, ex_image=None, ex_deployed=None, ex_started=None, ex_state=None, ex_network=None, ex_network_domain=None)

List nodes deployed for your organization.

Parameters:
  • ex_location (NodeLocation or str) – Filters the node list to nodes that are located in this location
  • ex_name – Filters the node list to nodes that have this name

:type ex_name str

Parameters:
  • ex_ipv6 (str) – Filters the node list to nodes that have this ipv6 address
  • ex_ipv4 (str) – Filters the node list to nodes that have this ipv4 address
  • ex_vlan (DimensionDataVlan or str) – Filters the node list to nodes that are in this VLAN
  • ex_image (NodeImage or str) – Filters the node list to nodes that have this image
  • ex_deployed (bool) – Filters the node list to nodes that are deployed or not
  • ex_started (bool) – Filters the node list to nodes that are started or not
  • ex_state (str) – Filters the node list by nodes that are in this state
  • ex_network (DimensionDataNetwork or str) – Filters the node list to nodes in this network
  • ex_network_domain (DimensionDataNetworkDomain or str) – Filters the node list to nodes in this network domain
Returns:

a list of Node objects

Return type:

list of Node

list_regions()

Method which returns a list of the available / supported regions.

Return type:list of str
list_sizes(location=None)
return a list of available sizes
Currently, the size of the node is dictated by the chosen OS base image, they cannot be set explicitly.

@inherits: NodeDriver.list_sizes

list_volume_snapshots(volume)

List snapshots for a storage volume.

Return type:list of VolumeSnapshot
list_volumes()

List storage volumes.

Return type:list of StorageVolume
reboot_node(node)

Reboots a node by requesting the OS restart via the hypervisor

Parameters:node (Node) – The node to reboot
Return type:bool
wait_until_running(nodes, wait_period=3, timeout=600, ssh_interface='public_ips', force_ipv4=True, ex_list_nodes_kwargs=None)

Block until the provided nodes are considered running.

Node is considered running when it’s state is “running” and when it has at least one IP address assigned.

Parameters:
  • nodes (list of Node) – List of nodes to wait for.
  • wait_period (int) – How many seconds to wait between each loop iteration. (default is 3)
  • timeout (int) – How many seconds to wait before giving up. (default is 600)
  • ssh_interface (str) – Which attribute on the node to use to obtain an IP address. Valid options: public_ips, private_ips. Default is public_ips.
  • force_ipv4 (bool) – Ignore IPv6 addresses (default is True).
  • ex_list_nodes_kwargs (dict) – Optional driver-specific keyword arguments which are passed to the list_nodes method.
Returns:

[(Node, ip_addresses)] list of tuple of Node instance and list of ip_address on success.

Return type:

list of tuple