libcloud.compute.drivers.dimensiondata module
Dimension Data Driver
- class libcloud.compute.drivers.dimensiondata.DimensionDataNodeDriver(key, secret=None, secure=True, host=None, port=None, api_version=None, region='dd-na', **kwargs)[source]
Bases:
NodeDriver
DimensionData node driver. Default api_version is used unless specified.
- Parameters:
key (
str
) – API key or username to be used (required)secret (
str
) – Secret password to be used (required)secure (
bool
) – Whether to use HTTPS or HTTP. Note: Some providers only support HTTPS, and it is on by default.host (
str
) – Override hostname used for connections.port (
int
) – Override port used for connections.api_version (
str
) – Optional API version. Only used by drivers which support multiple API versions.region (
str
) – Optional driver region. Only used by drivers which support multiple regions.
- Return type:
None
- api_version = 1.0
- connectionCls
alias of
DimensionDataConnection
- create_node(name, image, auth, ex_network_domain=None, ex_primary_nic_private_ipv4=None, ex_primary_nic_vlan=None, ex_primary_nic_network_adapter=None, ex_additional_nics=None, ex_description=None, ex_disks=None, ex_cpu_specification=None, ex_memory_gb=None, ex_is_started=True, ex_primary_dns=None, ex_secondary_dns=None, ex_ipv4_gateway=None, ex_microsoft_time_zone=None, **kwargs)[source]
Create a new DimensionData node in MCP2. However, it is still backward compatible for MCP1 for a limited time. Please consider using MCP2 datacenter as MCP1 will phase out soon.
Legacy Create Node for MCP1 datacenter
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.base import NodeAuthPassword >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = False >>> DimensionData = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Password >>> root_pw = NodeAuthPassword('password123') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU1') >>> >>> # Get network by location >>> my_network = driver.list_networks(location=location)[0] >>> pprint(my_network) >>> >>> # Get Image >>> images = driver.list_images(location=location) >>> image = images[0] >>> >>> node = driver.create_node(name='test_blah_2', image=image, >>> auth=root_pw, >>> ex_description='test3 node', >>> ex_network=my_network, >>> ex_is_started=False) >>> pprint(node)
Create Node in MCP2 Data Center
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.base import NodeAuthPassword >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Password >>> root_pw = NodeAuthPassword('password123') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> vlan = driver.ex_list_vlans(location=location, >>> network_domain=my_network_domain)[0] >>> pprint(vlan) >>> >>> # Get Image >>> images = driver.list_images(location=location) >>> image = images[0] >>> >>> # Create node using vlan instead of private IPv4 >>> node = driver.create_node(name='test_server_01', image=image, >>> auth=root_pw, >>> ex_description='test2 node', >>> ex_network_domain=my_network_domain, >>> ex_primary_nic_vlan=vlan, >>> ex_is_started=False) >>> >>> # Option: Create node using private IPv4 instead of vlan >>> # node = driver.create_node(name='test_server_02', image=image, >>> # auth=root_pw, >>> # ex_description='test2 node', >>> # ex_network_domain=my_network_domain, >>> # ex_primary_nic_private_ipv4='10.1.1.7', >>> # ex_is_started=False) >>> >>> # Option: Create node using by specifying Network Adapter >>> # node = driver.create_node(name='test_server_03', image=image, >>> # auth=root_pw, >>> # ex_description='test2 node', >>> # ex_network_domain=my_network_domain, >>> # ex_primary_nic_vlan=vlan, >>> # ex_primary_nic_network_adapter='E1000', >>> # ex_is_started=False) >>>
- Parameters:
name (
str
) – (required) String with a name for this new nodeimage (
NodeImage
orstr
) – (required) OS Image to boot on node.auth (
NodeAuthPassword
orstr
orNone
) – Initial authentication information for the node. (If this is a customer LINUX image auth will be ignored)ex_description (
str
) – (optional) description for this nodeex_network_domain (
DimensionDataNetworkDomain
orstr
) – (required) Network Domain or Network Domain ID to create the nodeex_primary_nic_private_ipv4 (:
str
) – Provide private IPv4. Ignore if ex_primary_nic_vlan is provided. Use one or the other. Not both.ex_primary_nic_vlan – Provide VLAN for the node if ex_primary_nic_private_ipv4 NOT provided. One or the other. Not both.
ex_primary_nic_network_adapter (:
str
) – (Optional) Default value for the Operating System will be used if leave empty. Example: “E1000”.ex_additional_nics (
list
of :class:’DimensionDataNic’ orstr
) – (optional) List :class:’DimensionDataNic’ or Noneex_memory_gb (
int
) – (optional) The amount of memory in GB for the server Can be used to override the memory value inherited from the source Server Image.ex_cpu_specification (
DimensionDataServerCpuSpecification
) – (optional) The spec of CPU to deployex_is_started (
bool
) – (required) Start server after creation. Default is set to true.ex_primary_dns (
str
) – (Optional) The node’s primary DNSex_secondary_dns (
str
) – (Optional) The node’s secondary DNSex_ipv4_gateway (
str
) – (Optional) IPv4 address in dot-decimal notation, which will be used as the Primary NIC gateway instead of the default gateway assigned by the system. If ipv4Gateway is provided it does not have to be on the VLAN of the Primary NIC but MUST be reachable or the Guest OS will not be configured correctly.ex_disks (List or tuple of :class:'DimensionDataServerDisk`) – (optional) Dimensiondata disks. Optional disk elements can be used to define the disk speed that each disk on the Server; inherited from the source Server Image will be deployed to. It is not necessary to include a diskelement for every disk; only those that you wish to set a disk speed value for. Note that scsiId 7 cannot be used.Up to 13 disks can be present in addition to the required OS disk on SCSI ID 0. Refer to https://docs.mcp-services.net/x/UwIu for disk
ex_microsoft_time_zone (str`) – (optional) For use with Microsoft Windows source Server Images only. For the exact value to use please refer to the table of time zone indexes in the following Microsoft Technet documentation. If none is supplied, the default time zone for the data center geographic region will be used.
- Returns:
The newly created
Node
.- Return type:
Node
- destroy_node(node)[source]
Deletes a node, node must be stopped before deletion
- Parameters:
node (
Node
) – The node to delete- Return type:
bool
- ex_add_storage_to_node(node, amount, speed='STANDARD', scsi_id=None)[source]
Add storage to the node
- Parameters:
node (
Node
) – The server to add storage toamount (
int
) – The amount of storage to add, in GBspeed (
str
) – The disk speed typescsi_id (
int
) – The target SCSI ID (optional)
- Return type:
bool
- ex_apply_tag_to_asset(asset, tag_key, value=None)[source]
Apply a tag to a Dimension Data Asset
- Parameters:
asset (
Node
orNodeImage
orDimensionDataNewtorkDomain
orDimensionDataVlan
orDimensionDataPublicIpBlock
) – The asset to apply a tag to. (required)tag_key (
DimensionDataTagKey
orstr
) – 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 theDimensionDataTagKey
requires it
- Return type:
bool
- ex_attach_node_to_vlan(node, vlan=None, private_ipv4=None)[source]
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 usedvlan (
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)[source]
Get audit log report
- Parameters:
start_date (
str
in format YYYY-MM-DD) – Start date for the reportend_date (
str
in format YYYY-MM-DD) – End date for the report
- Return type:
list
oflist
- ex_backup_usage_report(start_date, end_date, location)[source]
Get audit log report
- Parameters:
start_date (
str
in format YYYY-MM-DD) – Start date for the reportend_date (
str
in format YYYY-MM-DD) – End date for the reportlocation (
NodeLocation
orstr
) – Filters the node list to nodes that are located in this location
- Return type:
list
oflist
- ex_change_nic_network_adapter(nic_id, network_adapter_name)[source]
Change network adapter of a NIC on a cloud server
- Parameters:
nic_id (:
str
) – Nic IDnetwork_adapter_name (:
str
) – Network adapter name
- Return type:
bool
- ex_change_storage_size(node, disk_id, size)[source]
Change the size of a disk
- Parameters:
node (
Node
) – The server to change the disk ofdisk_id (
str
) – The ID of the disk to resizesize (
int
) – The disk size in GB
- Return type:
bool
- ex_change_storage_speed(node, disk_id, speed)[source]
Change the speed (disk tier) of a disk
- Parameters:
node (
Node
) – The server to change the disk speed ofdisk_id (
str
) – The ID of the disk to changespeed (
str
) – The disk speed type e.g. STANDARD
- Return type:
bool
- ex_clean_failed_deployment(node)[source]
Removes a node that has failed to deploy
- Parameters:
node (
Node
orstr
) – The failed node to clean
- ex_clone_node_to_image(node, image_name, image_description=None, cluster_id=None, is_guest_Os_Customization=None, tag_key_id=None, tag_value=None)[source]
Clone a server into a customer image.
- Parameters:
node (
Node
) – The server to cloneimage_name (
str
) – The name of the clone imagedescription (
str
) – The description of the image
- Return type:
bool
- ex_create_anti_affinity_rule(node_list)[source]
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
ofNode
orlist
ofstr
) – 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)[source]
Creates a firewall rule
- Parameters:
network_domain (
DimensionDataNetworkDomain
orstr
) – The network domain in which to create the firewall rulerule (
DimensionDataFirewallRule
) – The rule in which to createposition (
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
orstr
) – The rule or rule name in which to decide positioning by
- Return type:
bool
- ex_create_ip_address_list(ex_network_domain, name, description, ip_version, ip_address_collection, child_ip_address_list=None)[source]
Create IP Address List. IP Address list.
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> from libcloud.common.dimensiondata import DimensionDataIpAddress >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> # IP Address collection >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100') >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106', end='190.2.2.108') >>> ipAddress_3 = DimensionDataIpAddress(begin='190.2.2.0', prefix_size='24') >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] >>> >>> # Create IPAddressList >>> result = driver.ex_create_ip_address_list( >>> ex_network_domain=my_network_domain, >>> name='My_IP_AddressList_2', >>> ip_version='IPV4', >>> description='Test only', >>> ip_address_collection=ip_address_collection, >>> child_ip_address_list='08468e26-eeb3-4c3d-8ff2-5351fa6d8a04' >>> ) >>> >>> pprint(result)
- Parameters:
ex_network_domain (
DimensionDataNetworkDomain
or ‘str’) – The network domain or network domain IDname (:
str
) – IP Address List Name (required)description (:
str
) – IP Address List Description (optional)ip_version (:
str
) – IP Version of ip address (required)ip_address_collection (:
str
) – List of IP Address. At least one ipAddress element or one childIpAddressListId element must be provided.child_ip_address_list (:class:’DimensionDataChildIpAddressList` or str`) – Child IP Address List or id to be included in this IP Address List. At least one ipAddress or one childIpAddressListId must be provided.
- Returns:
a list of DimensionDataIpAddressList objects
- Return type:
list
ofDimensionDataIpAddressList
- ex_create_nat_rule(network_domain, internal_ip, external_ip)[source]
Create a NAT rule
- Parameters:
network_domain (
DimensionDataNetworkDomain
) – The network domain the rule belongs tointernal_ip (
str
) – The IPv4 address internallyexternal_ip (
str
) – The IPv4 address externally
- Return type:
DimensionDataNatRule
- ex_create_network(location, name, description=None)[source]
Create a new network in an MCP 1.0 location
- Parameters:
location (
NodeLocation
orstr
) – The target location (MCP1)name (
str
) – The name of the networkdescription (
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)[source]
Deploy a new network domain to a data center
- Parameters:
location (
NodeLocation
orstr
) – The data center to listname (
str
) – The name of the network domain to createservice_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_node_uncustomized(name, image, ex_network_domain, ex_is_started=True, ex_description=None, ex_cluster_id=None, ex_cpu_specification=None, ex_memory_gb=None, ex_primary_nic_private_ipv4=None, ex_primary_nic_vlan=None, ex_primary_nic_network_adapter=None, ex_additional_nics=None, ex_disks=None, ex_tagid_value_pairs=None, ex_tagname_value_pairs=None)[source]
This MCP 2.0 only function deploys a new Cloud Server from a CloudControl compatible Server Image, which does not utilize VMware Guest OS Customization process.
Create Node in MCP2 Data Center
- Parameters:
name (
str
) – (required) String with a name for this new nodeimage (
NodeImage
orstr
) – (UUID of the Server Image being used as the target for the new Server deployment. The source Server Image (OS Image or Customer Image) must have osCustomization set to true. See Get/List OS Image(s) and Get/List Customer Image(s).ex_network_domain (
DimensionDataNetworkDomain
orstr
) – (required) Network Domain or Network Domain ID to create the nodeex_description (
str
) – (optional) description for this nodeex_cluster_id – (optional) For multiple cluster
environments, it is possible to set a destination cluster for the new Customer Image. Note that performance of this function is optimal when either the Server cluster and destination are the same or when shared data storage is in place for the multiple clusters. :type ex_cluster_id:
str
- Parameters:
ex_primary_nic_private_ipv4 (:
str
) – Provide private IPv4. Ignore if ex_primary_nic_vlan is provided. Use one or the other. Not both.ex_primary_nic_vlan – Provide VLAN for the node if ex_primary_nic_private_ipv4 NOT provided. One or the other. Not both.
ex_primary_nic_network_adapter (:
str
) – (Optional) Default value for the Operating System will be used if leave empty. Example: “E1000”.ex_additional_nics (
list
of :class:’DimensionDataNic’ orstr
) – (optional) List :class:’DimensionDataNic’ or Noneex_memory_gb (
int
) – (optional) The amount of memory in GB for the server Can be used to override the memory value inherited from the source Server Image.ex_cpu_specification (
DimensionDataServerCpuSpecification
) – (optional) The spec of CPU to deployex_is_started (
bool
) – (required) Start server after creation. Default is set to true.ex_disks (List or tuple of :class:'DimensionDataServerDisk`) – (optional) Dimensiondata disks. Optional disk elements can be used to define the disk speed that each disk on the Server; inherited from the source Server Image will be deployed to. It is not necessary to include a diskelement for every disk; only those that you wish to set a disk speed value for. Note that scsiId 7 cannot be used.Up to 13 disks can be present in addition to the required OS disk on SCSI ID 0. Refer to https://docs.mcp-services.net/x/UwIu for disk
ex_tagid_value_pairs – (Optional) up to 10 tag elements may be provided. A combination of tagById and tag name cannot be supplied in the same request. Note: ex_tagid_value_pairs and ex_tagname_value_pairs is mutually exclusive. Use one or other.
ex_tagname_value_pairs (
dict`
.) – (Optional) up to 10 tag elements may be provided. A combination of tagById and tag name cannot be supplied in the same request. Note: ex_tagid_value_pairs and ex_tagname_value_pairs is mutually exclusive. Use one or other.
- Returns:
The newly created
Node
.- Return type:
Node
- ex_create_portlist(ex_network_domain, name, description, port_collection, child_portlist_list=None)[source]
Create Port List.
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> from libcloud.common.dimensiondata import DimensionDataPort >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> # Port Collection >>> port_1 = DimensionDataPort(begin='1000') >>> port_2 = DimensionDataPort(begin='1001', end='1003') >>> port_collection = [port_1, port_2] >>> >>> # Create Port List >>> new_portlist = driver.ex_create_portlist( >>> ex_network_domain=my_network_domain, >>> name='MyPortListX', >>> description="Test only", >>> port_collection=port_collection, >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} >>> ) >>> pprint(new_portlist)
- Parameters:
ex_network_domain (:
str
) – (required) The network domain in which to create PortList. Provide networkdomain object or its id.name (:
str
) – Port List Namedescription (:
str
) – IP Address List Descriptionport_collection (:
str
) – List of Port Addresschild_portlist_list (:
str
or ‘’list of :class:’DimensionDataChildPortList’) – List of Child Portlist to be included in this Port List
- Returns:
result of operation
- Return type:
bool
- ex_create_tag_key(name, description=None, value_required=True, display_on_report=True)[source]
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 keyvalue_required (
bool
) – If a value is required for the tag Tags themselves can be just a tag, or be a key/value pairdisplay_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)[source]
Deploy a new VLAN to a network domain
- Parameters:
network_domain (
DimensionDataNetworkDomain
) – The network domain to add the VLAN toname (
str
) – The name of the VLAN to createprivate_ipv4_base_address (
str
) – The base IPv4 address e.g. 192.168.1.0description (
str
) – An additional description of the VLANprivate_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)[source]
Remove anti affinity rule
- Parameters:
anti_affinity_rule (
DimensionDataAntiAffinityRule
orstr
) – The anti affinity rule to delete- Return type:
bool
- ex_delete_firewall_rule(rule)[source]
Delete a firewall rule
- Parameters:
rule (
DimensionDataFirewallRule
) – The rule to delete- Return type:
bool
- ex_delete_ip_address_list(ex_ip_address_list)[source]
Delete IP Address List by ID
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' >>> result = driver.ex_delete_ip_address_list(ip_address_list_id) >>> pprint(result)
- Parameters:
ex_ip_address_list (:class:’DimensionDataIpAddressList’ or
str
) – IP Address List object or IP Address List ID (required)- Return type:
bool
- ex_delete_nat_rule(rule)[source]
Delete an existing NAT rule
- Parameters:
rule (
DimensionDataNatRule
) – The rule to delete- Return type:
bool
- ex_delete_network(network)[source]
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)[source]
Delete a network domain
- Parameters:
network_domain (
DimensionDataNetworkDomain
) – The network domain to delete- Return type:
bool
- ex_delete_portlist(ex_portlist)[source]
Delete Port List
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Delete Port List >>> portlist_id = '157531ce-77d4-493c-866b-d3d3fc4a912a' >>> response = driver.ex_delete_portlist(portlist_id) >>> pprint(response)
- Parameters:
ex_portlist (:
str
or :class:’DimensionDataPortList’) – Port List to be deleted- Return type:
bool
- ex_delete_vlan(vlan)[source]
Deletes an existing VLAN
- Parameters:
vlan (
DimensionDataNetworkDomain
) – The VLAN to delete- Return type:
bool
- ex_destroy_nic(nic_id)[source]
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)[source]
Get detailed usage information
- Parameters:
start_date (
str
in format YYYY-MM-DD) – Start date for the reportend_date (
str
in format YYYY-MM-DD) – End date for the report
- Return type:
list
oflist
- ex_disable_monitoring(node)[source]
Disables cloud monitoring for a node
- Parameters:
node (
Node
) – The node to stop monitoring- Return type:
bool
- ex_edit_firewall_rule(rule, position, relative_rule_for_position=None)[source]
Edit a firewall rule
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> >>> # List firewall rules >>> firewall_rules = driver.ex_list_firewall_rules(my_network_domain) >>> >>> # Get Firewall Rule by name >>> pprint("List specific firewall rule by name") >>> fire_rule_under_test = (list(filter(lambda x: x.name == 'My_New_Firewall_Rule', firewall_rules))[0]) >>> pprint(fire_rule_under_test.source) >>> pprint(fire_rule_under_test.destination) >>> >>> # Edit Firewall >>> fire_rule_under_test.destination.address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' >>> fire_rule_under_test.destination.port_list_id = 'b6557c5a-45fa-4138-89bd-8fe68392691b' >>> result = driver.ex_edit_firewall_rule(fire_rule_under_test, 'LAST') >>> pprint(result)
- Parameters:
rule (
DimensionDataFirewallRule
) – (required) The rule in which to createposition (
str
) – (required) There are two types of positions with position_relative_to_rule arg and without it With: ‘BEFORE’ or ‘AFTER’ Without: ‘FIRST’ or ‘LAST’relative_rule_for_position (
DimensionDataFirewallRule
orstr
) – (optional) The rule or rule name in which to decide the relative rule for positioning.
- Return type:
bool
- ex_edit_ip_address_list(ex_ip_address_list, description, ip_address_collection, child_ip_address_lists=None)[source]
Edit IP Address List. IP Address list.
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> from libcloud.common.dimensiondata import DimensionDataIpAddress >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # IP Address collection >>> ipAddress_1 = DimensionDataIpAddress(begin='190.2.2.100') >>> ipAddress_2 = DimensionDataIpAddress(begin='190.2.2.106', >>> end='190.2.2.108') >>> ipAddress_3 = DimensionDataIpAddress( >>> begin='190.2.2.0', prefix_size='24') >>> ip_address_collection = [ipAddress_1, ipAddress_2, ipAddress_3] >>> >>> # Edit IP Address List >>> ip_address_list_id = '5e7c323f-c885-4e4b-9a27-94c44217dbd3' >>> result = driver.ex_edit_ip_address_list( >>> ex_ip_address_list=ip_address_list_id, >>> description="Edit Test", >>> ip_address_collection=ip_address_collection, >>> child_ip_address_lists=None >>> ) >>> pprint(result)
- Parameters:
ex_ip_address_list (:class:’DimensionDataIpAddressList’ or
str
) – (required) IpAddressList object or IpAddressList IDdescription (:
str
) – IP Address List Descriptionip_address_collection (''list'' of :class:'DimensionDataIpAddressList') – List of IP Address
child_ip_address_lists (
list
of :class:’DimensionDataChildIpAddressList’ orstr
) – Child IP Address List or id to be included in this IP Address List
- Returns:
a list of DimensionDataIpAddressList objects
- Return type:
list
ofDimensionDataIpAddressList
- ex_edit_portlist(ex_portlist, description, port_collection, child_portlist_list=None)[source]
Edit Port List.
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> from libcloud.common.dimensiondata import DimensionDataPort >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Port Collection >>> port_1 = DimensionDataPort(begin='4200') >>> port_2 = DimensionDataPort(begin='4201', end='4210') >>> port_collection = [port_1, port_2] >>> >>> # Edit Port List >>> editPortlist = driver.ex_get_portlist( '27dd8c66-80ff-496b-9f54-2a3da2fe679e') >>> >>> result = driver.ex_edit_portlist( >>> ex_portlist=editPortlist.id, >>> description="Make Changes in portlist", >>> port_collection=port_collection, >>> child_portlist_list={'a9cd4984-6ff5-4f93-89ff-8618ab642bb9'} >>> ) >>> pprint(result)
- Parameters:
ex_portlist (:
str
or :class:’DimensionDataPortList’) – Port List to be edited (required)description (:
str
) – Port List Descriptionport_collection (:
str
) – List of Portschild_portlist_list (:
list
of :class’DimensionDataChildPortList’ or ‘’str’’) – Child PortList to be included in this IP Address List
- Returns:
a list of DimensionDataPortList objects
- Return type:
list
ofDimensionDataPortList
- ex_enable_monitoring(node, service_plan='ESSENTIALS')[source]
Enables cloud monitoring on a node
- Parameters:
node (
Node
) – The node to monitorservice_plan (
str
) – The service plan, one of ESSENTIALS or ADVANCED
- Return type:
bool
- ex_exchange_nic_vlans(nic_id_1, nic_id_2)[source]
Exchange NIC Vlans
- Parameters:
nic_id_1 (:
str
) – Nic ID 1nic_id_2 (:
str
) – Nic ID 2
- Return type:
bool
- ex_expand_vlan(vlan)[source]
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)[source]
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)[source]
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)[source]
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_ip_address_list(ex_network_domain, ex_ip_address_list_name)[source]
Get IP Address List by name in network domain specified
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> # Get IP Address List by Name >>> ipaddresslist_list_by_name = driver.ex_get_ip_address_list( >>> ex_network_domain=my_network_domain, >>> ex_ip_address_list_name='My_IP_AddressList_1') >>> pprint(ipaddresslist_list_by_name)
- Parameters:
ex_network_domain (
DimensionDataNetworkDomain
or ‘str’) – (required) The network domain or network domain ID in which ipaddresslist resides.ex_ip_address_list_name (:
str
) – (required) Get ‘IP Address List’ by name
- Returns:
a list of DimensionDataIpAddressList objects
- Return type:
list
ofDimensionDataIpAddressList
- ex_get_location_by_id(id)[source]
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)[source]
Get a NAT rule by ID
- Parameters:
network_domain (
DimensionDataNetworkDomain
) – The network domain the rule belongs torule_id (
str
) – The ID of the NAT rule to fetch
- Return type:
DimensionDataNatRule
- ex_get_network_domain(network_domain_id)[source]
Get an individual Network Domain, by identifier
- Parameters:
network_domain_id (
str
) – The identifier of the network domain- Return type:
DimensionDataNetworkDomain
- ex_get_portlist(ex_portlist_id)[source]
Get Port List
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get specific portlist by ID >>> portlist_id = '27dd8c66-80ff-496b-9f54-2a3da2fe679e' >>> portlist = driver.ex_get_portlist(portlist_id) >>> pprint(portlist)
- Parameters:
ex_portlist_id (
DimensionDataNetworkDomain
or ‘str’) – The ex_port_list or ex_port_list ID- Returns:
DimensionDataPortList object
- Return type:
DimensionDataPort
- ex_get_tag_key_by_id(id)[source]
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)[source]
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)[source]
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)[source]
List anti affinity rules for a network, network domain, or node
- Parameters:
network (
DimensionDataNetwork
orstr
) – The network to list anti affinity rules for One of network, network_domain, or node is requirednetwork_domain (
DimensionDataNetworkDomain
orstr
) – The network domain to list anti affinity rules One of network, network_domain, or node is requirednode (
Node
orstr
) – The node to list anti affinity rules for One of network, netwok_domain, or node is requiredfilter_id (
str
) – This will allow you to filter the rules by this node id
- Return type:
list
ofDimensionDataAntiAffinityRule
- ex_list_customer_images(location=None)[source]
Return a list of customer imported images
- Parameters:
location (
NodeLocation
orstr
) – The target location- Return type:
list
ofNodeImage
- ex_list_ip_address_list(ex_network_domain)[source]
List IP Address List by network domain ID specified
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == networkDomainName][0] >>> >>> # List IP Address List of network domain >>> ipaddresslist_list = driver.ex_list_ip_address_list( >>> ex_network_domain=my_network_domain) >>> pprint(ipaddresslist_list)
- Parameters:
ex_network_domain (
DimensionDataNetworkDomain
or ‘str’) – The network domain or network domain ID- Returns:
a list of DimensionDataIpAddressList objects
- Return type:
list
ofDimensionDataIpAddressList
- ex_list_nat_rules(network_domain)[source]
Get NAT rules for the network domain
- Parameters:
network_domain (
DimensionDataNetworkDomain
) – The network domain the rules belongs to- Return type:
list
ofDimensionDataNatRule
- ex_list_network_domains(location=None, name=None, service_plan=None, state=None)[source]
List networks domains deployed across all data center locations domain.
for your organization. The response includes the location of each network :param location: Only network domains in the location (optional) :type location:
NodeLocation
orstr
- Parameters:
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
ofDimensionDataNetwork
- ex_list_networks(location=None)[source]
List networks deployed across all data center locations for your organization. The response includes the location of each network.
- Parameters:
location (
NodeLocation
orstr
) – The target location- Returns:
a list of DimensionDataNetwork objects
- Return type:
list
ofDimensionDataNetwork
- 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)[source]
Return a generator which yields node lists in pages
- Parameters:
location (
NodeLocation
orstr
) – Filters the node list to nodes that are located in this locationname – 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 addressipv4 (
str
) – Filters the node list to nodes that have this ipv4 addressvlan (
DimensionDataVlan
orstr
) – Filters the node list to nodes that are in this VLANimage (
NodeImage
orstr
) – Filters the node list to nodes that have this imagedeployed (
bool
) – Filters the node list to nodes that are deployed or notstarted (
bool
) – Filters the node list to nodes that are started or notstate (
str
) – Filters the node list to nodes that are in this statenetwork (
DimensionDataNetwork
orstr
) – Filters the node list to nodes in this networknetwork_domain (
DimensionDataNetworkDomain
orstr
) – Filters the node list to nodes in this network domain
- Returns:
a list of Node objects
- Return type:
generator
of list ofNode
- ex_list_portlist(ex_network_domain)[source]
List Portlist by network domain ID specified
>>> from pprint import pprint >>> from libcloud.compute.types import Provider >>> from libcloud.compute.providers import get_driver >>> import libcloud.security >>> >>> # Get dimension data driver >>> libcloud.security.VERIFY_SSL_CERT = True >>> cls = get_driver(Provider.DIMENSIONDATA) >>> driver = cls('myusername','mypassword', region='dd-au') >>> >>> # Get location >>> location = driver.ex_get_location_by_id(id='AU9') >>> >>> # Get network domain by location >>> networkDomainName = "Baas QA" >>> network_domains = driver.ex_list_network_domains(location=location) >>> my_network_domain = [d for d in network_domains if d.name == >>> networkDomainName][0] >>> >>> # List portlist >>> portLists = driver.ex_list_portlist( >>> ex_network_domain=my_network_domain) >>> pprint(portLists) >>>
- Parameters:
ex_network_domain (
DimensionDataNetworkDomain
or ‘str’) – The network domain or network domain ID- Returns:
a list of DimensionDataPortList objects
- Return type:
list
ofDimensionDataPortList
- ex_list_tag_keys(id=None, name=None, value_required=None, display_on_report=None)[source]
List tag keys in the Dimension Data Cloud
- Parameters:
id (
str
) – Filter the list to the id of the tag keyname (
str
) – Filter the list to the name of the tag keyvalue_required (
bool
) – Filter the list to if a value is required for a tag keydisplay_on_report (
bool
) – Filter the list to if the tag key should show up on usage reports
- Return type:
list
ofDimensionDataTagKey
- 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)[source]
List tags in the Dimension Data Cloud
- Parameters:
asset_id (
str
) – Filter the list by asset idasset_type (
str
) – Filter the list by asset typelocation (:class:
NodeLocation
orstr
) – Filter the list by the assets locationtag_key_name (
str
) – Filter the list by a tag key nametag_key_id (
str
) – Filter the list by a tag key idvalue (
str
) – Filter the list by a tag valuevalue_required (
bool
) – Filter the list to if a value is required for a tagdisplay_on_report (
bool
) – Filter the list to if the tag should show up on usage reports
- Return type:
list
ofDimensionDataTag
- ex_list_vlans(location=None, network_domain=None, name=None, ipv4_address=None, ipv6_address=None, state=None)[source]
List VLANs available, can filter by location and/or network domain
- Parameters:
location (
NodeLocation
orstr
) – 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
ofDimensionDataVlan
- ex_modify_tag_key(tag_key, name=None, description=None, value_required=None, display_on_report=None)[source]
Modify a specific tag key
- Parameters:
tag_key (
DimensionDataTagKey
orstr
) – The tag key you want to modify (required)name (
str
) – Set to modify the name of the tag keydescription (
str
) – Set to modify the description of the tag keyvalue_required (
bool
) – Set to modify if a value is required for the tag keydisplay_on_report (
bool
) – Set to modify if this tag key should display on the usage reports
- Return type:
bool
- ex_power_off(node)[source]
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)[source]
Reconfigure the virtual hardware specification of a node
- Parameters:
node (
Node
) – The server to changememory_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)[source]
Remove storage from a node
- Parameters:
node (
Node
) – The server to add storage todisk_id (
str
) – The ID of the disk to remove
- Return type:
bool
- ex_remove_storage_from_node(node, scsi_id)[source]
Remove storage from a node
- Parameters:
node (
Node
) – The server to add storage toscsi_id (
str
) – The ID of the disk to remove
- Return type:
bool
- ex_remove_tag_from_asset(asset, tag_key)[source]
Remove a tag from an asset
- Parameters:
asset (
Node
orNodeImage
orDimensionDataNewtorkDomain
orDimensionDataVlan
orDimensionDataPublicIpBlock
) – The asset to remove a tag from. (required)tag_key (
DimensionDataTagKey
orstr
) – The tag key you want to remove (required)
- Return type:
bool
- ex_remove_tag_key(tag_key)[source]
Modify a specific tag key
- Parameters:
tag_key (
DimensionDataTagKey
orstr
) – The tag key you want to remove (required)- Return type:
bool
- ex_rename_network(network, new_name)[source]
Rename a network in MCP 1 data center
- Parameters:
network (
DimensionDataNetwork
) – The network to renamenew_name (
str
) – The new name of the network
- Return type:
bool
- ex_reset(node)[source]
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)[source]
Change the state (enabled or disabled) of a rule
- Parameters:
rule (
DimensionDataFirewallRule
) – The rule to deletestate (
bool
) – The desired state enabled (True) or disabled (False)
- Return type:
bool
- ex_software_usage_report(start_date, end_date)[source]
Get detailed software usage reports
- Parameters:
start_date (
str
in format YYYY-MM-DD) – Start date for the reportend_date (
str
in format YYYY-MM-DD) – End date for the report
- Return type:
list
oflist
- ex_summary_usage_report(start_date, end_date)[source]
Get summary usage information
- Parameters:
start_date (
str
in format YYYY-MM-DD) – Start date for the reportend_date (
str
in format YYYY-MM-DD) – End date for the report
- Return type:
list
oflist
- ex_update_monitoring_plan(node, service_plan='ESSENTIALS')[source]
Updates the service plan on a node with monitoring
- Parameters:
node (
Node
) – The node to monitorservice_plan (
str
) – The service plan, one of ESSENTIALS or ADVANCED
- Return type:
bool
- ex_update_network_domain(network_domain)[source]
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)[source]
Update the node, the name, CPU or RAM
- Parameters:
node (
Node
) – Node which should be usedname (
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)[source]
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)[source]
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)[source]
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
orlist
) – Either the desired state (str) or a list of statesfunc (
function
) – The function to call, e.g. ex_get_vlanpoll_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
- features: Dict[str, List[str]] = {'create_node': ['password']}
- List of available features for a driver.
libcloud.compute.base.NodeDriver.create_node()
ssh_key: Supports
NodeAuthSSHKey
as an authentication method for nodes.password: Supports
NodeAuthPassword
as an authentication method for nodes.generates_password: Returns a password attribute on the Node object returned from creation.
- import_image(ovf_package_name, name, cluster_id=None, datacenter_id=None, description=None, is_guest_os_customization=None, tagkey_name_value_dictionaries=None)[source]
Import image
- Parameters:
ovf_package_name (
str
) – Image OVF package namename (
str
) – Image namecluster_id (
str
) – Provide either cluster_id or datacenter_iddatacenter_id (
str
) – Provide either cluster_id or datacenter_iddescription (
str
) – Optional. Description of imageis_guest_os_customization (
bool
) – Optional. true for NGOC imagetagkey_name_value_dictionaries (dictionaries) – Optional tagkey name value dict
- Returns:
Return true if successful
- Return type:
bool
- list_images(location=None)[source]
List images available
- Note: Currently only returns the default ‘base OS images’
provided by DimensionData. Customer images (snapshots) use ex_list_customer_images
- Parameters:
ex_location (
NodeLocation
orstr
) – Filters the node list to nodes that are located in this location- Returns:
List of images available
- Return type:
list
ofNodeImage
- list_locations(ex_id=None)[source]
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
ofNodeLocation
- list_networks(location=None)[source]
List networks deployed across all data center locations for your organization. The response includes the location of each network.
- Parameters:
location (
NodeLocation
orstr
) – The location- Returns:
a list of DimensionDataNetwork objects
- Return type:
list
ofDimensionDataNetwork
- 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)[source]
List nodes deployed for your organization.
- Parameters:
ex_location (
NodeLocation
orstr
) – Filters the node list to nodes that are located in this locationex_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 addressex_ipv4 (
str
) – Filters the node list to nodes that have this ipv4 addressex_vlan (
DimensionDataVlan
orstr
) – Filters the node list to nodes that are in this VLANex_image (
NodeImage
orstr
) – Filters the node list to nodes that have this imageex_deployed (
bool
) – Filters the node list to nodes that are deployed or notex_started (
bool
) – Filters the node list to nodes that are started or notex_state (
str
) – Filters the node list by nodes that are in this stateex_network (
DimensionDataNetwork
orstr
) – Filters the node list to nodes in this networkex_network_domain (
DimensionDataNetworkDomain
orstr
) – Filters the node list to nodes in this network domain
- Returns:
a list of Node objects
- Return type:
list
ofNode
- list_sizes(location=None)[source]
- 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
- reboot_node(node)[source]
Reboots a node by requesting the OS restart via the hypervisor
- Parameters:
node (
Node
) – The node to reboot- Return type:
bool
- selected_region = None
- start_node(node)[source]
Powers on an existing deployed server
- Parameters:
node (
Node
) – Node which should be used- Return type:
bool
- stop_node(node)[source]
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