libcloud.common.nttcis module¶
NTTCIS Common Components
- class libcloud.common.nttcis.NetworkDomainServicePlan[source]¶
Bases:
object
- ADVANCED = 'ADVANCED'¶
- ESSENTIALS = 'ESSENTIALS'¶
- exception libcloud.common.nttcis.NttCisAPIException(code, msg, driver)[source]¶
Bases:
LibcloudError
- class libcloud.common.nttcis.NttCisAccountDetails(user_name, full_name, first_name, last_name, email)[source]¶
Bases:
object
NTTCIS account class details
- class libcloud.common.nttcis.NttCisAntiAffinityRule(id, node_list)[source]¶
Bases:
object
Anti-Affinity rule for NTTCIS
An Anti-Affinity rule ensures that servers in the rule will not reside on the same VMware ESX host.
Instantiate a new
NttCisDataAntiAffinityRule
- Parameters:
id (
str
) – The ID of the Anti-Affinity rulenode_list (
list
ofstr
) – List of node ids that belong in this rule
- class libcloud.common.nttcis.NttCisBackupClient(id, type, status, schedule_policy, storage_policy, download_url, alert=None, running_job=None)[source]¶
Bases:
object
An object that represents a backup client
Initialize an instance of this class.
- Parameters:
id (
str
) – Unique ID for the clienttype (
NttCisBackupClientType
) – The type of client that this client isstatus (
str
) – The states of this particular backup client. i.e. (Unregistered)schedule_policy (
str
) – The schedule policy for this client NOTE: NTTCIS only sends back the name of the schedule policy, no further detailsstorage_policy (
str
) – The storage policy for this client NOTE: NTTCIS only sends back the name of the storage policy, no further detailsdownload_url (
str
) – The download url for this clientalert (
NttCisBackupClientRunningJob
) – The alert configured for this backup client (optional)alert – The running job for the client (optional)
- class libcloud.common.nttcis.NttCisBackupClientAlert(trigger, notify_list=[])[source]¶
Bases:
object
An alert for a backup client
Initialize an instance of
NttCisBackupClientAlert
- Parameters:
trigger (
str
) – Trigger type for the client i.e. ON_FAILUREnotify_list (
list
ofstr
) – List of email addresses that are notified when the alert is fired
- class libcloud.common.nttcis.NttCisBackupClientRunningJob(id, status, percentage=0)[source]¶
Bases:
object
A running job for a given backup client
Initialize an instance of
NttCisBackupClientRunningJob
- Parameters:
id (
str
) – The unique ID of the jobstatus (
str
) – The status of the job i.e. Waitingpercentage (
int
) – The percentage completion of the job
- class libcloud.common.nttcis.NttCisBackupClientType(type, is_file_system, description)[source]¶
Bases:
object
A client type object for backups
Initialize an instance of
NttCisBackupClientType
- Parameters:
type (
str
) – The type of client i.e. (FA.Linux, MySQL, etc.)is_file_system (
bool
) – The name of the iRuledescription (
str
) – Description of the client
- class libcloud.common.nttcis.NttCisBackupDetails(asset_id, service_plan, status, clients=None)[source]¶
Bases:
object
NTTCIS Backup Details represents information about a targets backups configuration
Initialize an instance of
NttCisBackupDetails
- Parameters:
asset_id (
str
) – Asset identification for backupsservice_plan (
str
) – The service plan for backups. i.e (Essentials)status (
str
) – The overall status this backup target. i.e. (unregistered)clients (
list
ofNttCisBackupClient
) – Backup clients attached to this target
- class libcloud.common.nttcis.NttCisBackupSchedulePolicy(name, description)[source]¶
Bases:
object
A representation of a schedule policy
Initialize an instance of
NttCisBackupSchedulePolicy
- Parameters:
name (
str
) – The name of the policy i.e 12AM - 6AMdescription (
str
) – Short summary of the details of the policy
- class libcloud.common.nttcis.NttCisBackupStoragePolicy(name, retention_period, secondary_location)[source]¶
Bases:
object
A representation of a storage policy
Initialize an instance of
NttCisBackupStoragePolicy
- Parameters:
name (
str
) – The name of the storage policy i.e. 14 Day Storage Policyretention_period (
int
) – How long to keep the backup in dayssecondary_location (
str
) – The secondary location i.e. Primary
- class libcloud.common.nttcis.NttCisChildIpAddressList(id, name)[source]¶
Bases:
object
NttCis Child IP Address list
” Initialize an instance of
NttCisDataChildIpAddressList
- Parameters:
id (
str
) – GUID of the IP Address List keyname (
str
) – Name of the IP Address List
- class libcloud.common.nttcis.NttCisChildPortList(id, name)[source]¶
Bases:
object
NttCis Child Port list
” Initialize an instance of
NttCisChildIpAddressList
- Parameters:
id (
str
) – GUID of the child port list keyname (
str
) – Name of the child port List
- class libcloud.common.nttcis.NttCisConnection(user_id, key, secure=True, host=None, port=None, url=None, timeout=None, proxy_url=None, api_version=None, **conn_kwargs)[source]¶
Bases:
ConnectionUserAndKey
Connection class for the NttCis driver
Initialize user_id and key; set secure to an
int
based on passed value.- active_api_version = '2.7'¶
- add_default_headers(headers)[source]¶
Adds default headers (such as Authorization, X-Foo-Bar) to the passed headers
Should return a dictionary.
- allow_insecure = False¶
- api_path_version_1 = '/oec'¶
- api_path_version_2 = '/caas'¶
- api_version_1 = 0.9¶
- get_account_details()[source]¶
Get the details of this account
- Return type:
DimensionDataAccountDetails
- get_resource_path_api_1()[source]¶
This method returns a resource path which is necessary for referencing resources that require a full path instead of just an ID, such as networks, and customer snapshots.
- get_resource_path_api_2()[source]¶
This method returns a resource path which is necessary for referencing resources that require a full path instead of just an ID, such as networks, and customer snapshots.
- latest_api_version = '2.7'¶
- oldest_api_version = '2.2'¶
- paginated_request_with_orgId_api_2(action, params=None, data='', headers=None, method='GET', page_size=250)[source]¶
A paginated request to the MCP2.0 API This essentially calls out to request_with_orgId_api_2 for each page and yields the response to make a generator This generator can be looped through to grab all the pages.
- Parameters:
action (
str
) – The resource to access (i.e. ‘network/vlan’)params (
dict
orNone
) – Parameters to give to the actiondata (
str
) – The data payload to be added to the requestheaders (
str
ordict
orNone
) – Additional header to be added to the requestmethod (
str
) – HTTP Method for the request (i.e. ‘GET’, ‘POST’)page_size (
int
) – The size of each page to be returned Note: Max page size in MCP2.0 is currently 250
- rawResponseCls¶
alias of
NttCisRawResponse
- responseCls¶
alias of
NttCisResponse
- wait_for_state(state, func, poll_interval=2, timeout=60, *args, **kwargs)[source]¶
Wait for the function which returns a instance with field status/state 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_vlan. Note: This function needs to return an object which hasstatus
attribute.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
- Returns:
Result from the calling function.
- class libcloud.common.nttcis.NttCisDefaultHealthMonitor(id, name, node_compatible, pool_compatible)[source]¶
Bases:
object
A default health monitor for a VIP (node, pool or listener)
Initialize an instance of
NttCisDefaultHealthMonitor
- Parameters:
id (
str
) – The ID of the monitorname (
str
) – The name of the monitornode_compatible (
bool
) – Is a monitor capable of monitoring nodespool_compatible (
bool
) – Is a monitor capable of monitoring pools
- class libcloud.common.nttcis.NttCisDefaultiRule(id, name, compatible_listeners)[source]¶
Bases:
object
A default iRule for a network domain, can be applied to a listener
Initialize an instance of
NttCisefaultiRule
- Parameters:
id (
str
) – The ID of the iRulename (
str
) – The name of the iRulecompatible_listeners (
list
ofNttCisVirtualListenerCompatibility
) – List of compatible Virtual Listener types
- class libcloud.common.nttcis.NttCisFirewallAddress(any_ip=None, ip_address=None, ip_prefix_size=None, port_begin=None, port_end=None, address_list_id=None, port_list_id=None)[source]¶
Bases:
object
The source or destination model in a firewall rule 9/4/18: Editing Class to use with ex_create_firewall_rtule method. Will haved to circle back and test for any other uses.
- Parameters:
any_ip – used to set ip address to “ANY”
ip_address – Optional, an ip address of either IPv4 decimal notation or an IPv6 address
:type
str
- Parameters:
ip_prefix_size – An integer denoting prefix size.
:type
int
- Parameters:
port_begin – integer for an individual port or start of a list of ports if not using a port list
:type
int
- Parameters:
port_end – integer required if using a list of ports (NOT a port list but a list starting with port begin)
:type
int
- Parameters:
address_list_id – An id identifying an address list
:type
str
- Parameters:
port_list_id – An id identifying a port list
:type
str
- class libcloud.common.nttcis.NttCisFirewallRule(id, name, action, location, network_domain, status, ip_version, protocol, source, destination, enabled)[source]¶
Bases:
object
NTTCIS Firewall Rule for a network domain
- class libcloud.common.nttcis.NttCisIpAddress(begin, end=None, prefix_size=None)[source]¶
Bases:
object
A representation of IP Address in NttCis
Initialize an instance of
NttCisIpAddress
- Parameters:
begin (
str
) – IP Address Beginend (
str
) – IP Address endprefixSize (
int
) – IP Address prefix size
- class libcloud.common.nttcis.NttCisIpAddressList(id, name, description, ip_version, ip_address_collection, state, create_time, child_ip_address_lists=None)[source]¶
Bases:
object
NttCis IP Address list
” Initialize an instance of
NttCisIpAddressList
- Parameters:
id (
str
) – GUID of the IP Address List keyname (
str
) – Name of the IP Address Listdescription (
str
) – Description of the IP Address Listip_version (
str
) – IP version. E.g. IPV4, IPV6ip_address_collection (
List
) – Collection of NttCisIpAddressstate (
str
) – IP Address list statecreate_time (
date time
) – IP Address List created timechild_ip_address_lists (List) – List of IP address list to be included
of :class:’NttCisIpAddressList’
- class libcloud.common.nttcis.NttCisNatRule(id, network_domain, internal_ip, external_ip, status)[source]¶
Bases:
object
An IP NAT rule in a network domain
- class libcloud.common.nttcis.NttCisNetwork(id, name, description, location, private_net, multicast, status)[source]¶
Bases:
object
NTTCIS network with location.
- class libcloud.common.nttcis.NttCisNetworkDomain(id, name, description, location, status, plan)[source]¶
Bases:
object
NttCis network domain with location.
- class libcloud.common.nttcis.NttCisNic(private_ip_v4=None, vlan=None, network_adapter_name=None)[source]¶
Bases:
object
A representation of Network Adapter in NTTCIS
Initialize an instance of
NttCisNic
- Parameters:
private_ip_v4 (
str
) – IPv4vlan (class: NttCisVlan or
str
) – Network VLANnetwork_adapter_name (
str
) – Network Adapter Name
- class libcloud.common.nttcis.NttCisPersistenceProfile(id, name, compatible_listeners, fallback_compatible)[source]¶
Bases:
object
Each Persistence Profile declares the combination of Virtual Listener type and protocol with which it is compatible and whether or not it is compatible as a Fallback Persistence Profile.
Initialize an instance of
NttCisPersistenceProfile
- Parameters:
id (
str
) – The ID of the profilename (
str
) – The name of the profilecompatible_listeners (
list
ofNttCisVirtualListenerCompatibility
) – List of compatible Virtual Listener typesfallback_compatible (
bool
) – Is capable as a fallback profile
- class libcloud.common.nttcis.NttCisPool(id, name, description, status, load_balance_method, health_monitor_id, service_down_action, slow_ramp_time)[source]¶
Bases:
object
NttCis VIP Pool.
Initialize an instance of
NttCisPool
- Parameters:
id (
str
) – The ID of the poolname (
str
) – The name of the pooldescription (
str
) – Plan text description of the poolstatus (:class:NttCisStatus`) – The status of the pool
load_balance_method (
str
) – The load balancer methodhealth_monitor_id (
str
) – The ID of the health monitorservice_down_action (
str
) – Action to take when pool is downslow_ramp_time (
int
) – The ramp-up time for service recovery
- class libcloud.common.nttcis.NttCisPoolMember(id, name, status, ip, port, node_id)[source]¶
Bases:
object
NTTCIS VIP Pool Member.
Initialize an instance of
NttCisPoolMember
- Parameters:
id (
str
) – The ID of the pool membername (
str
) – The name of the pool memberstatus (
NttCisStatus
) – The status of the poolip (
str
) – The IP of the pool memberport (
int
) – The port of the pool membernode_id (
str
) – The ID of the associated node
- class libcloud.common.nttcis.NttCisPort(begin, end=None)[source]¶
Bases:
object
A representation of Port in NTTCIS
Initialize an instance of
NttCisPort
- Parameters:
begin (
str
) – Port Number Beginend (
str
) – Port Number end
- class libcloud.common.nttcis.NttCisPortList(id, name, description, port_collection, child_portlist_list, state, create_time)[source]¶
Bases:
object
NttCis Port list
” Initialize an instance of
DNttCisPortList
- Parameters:
id (
str
) – GUID of the Port List keyname (
str
) – Name of the Port Listdescription (
str
) – Description of the Port Listport_collection (
List
) – Collection of NttCisPortchild_portlist_list (
List
) – Collection of NttCisChildPortstate (
str
) – Port list statecreate_time (
date time
) – Port List created time
- class libcloud.common.nttcis.NttCisPublicIpBlock(id, base_ip, size, location, network_domain, status)[source]¶
Bases:
object
NTTCIS Public IP Block with location.
- class libcloud.common.nttcis.NttCisRawResponse(connection, response=None)[source]¶
Bases:
RawResponse
- Parameters:
connection (
Connection
) – Parent connection object.
- class libcloud.common.nttcis.NttCisReservedIpAddress(datacenter_id, exclusive, vlan_id, ip, description=None)[source]¶
Bases:
object
NTTCIS Rerverse IPv4 address
- class libcloud.common.nttcis.NttCisResponse(response, connection)[source]¶
Bases:
XmlResponse
- Parameters:
response (
httplib.HTTPResponse
) – HTTP response object. (optional)connection (
Connection
) – Parent connection object.
- class libcloud.common.nttcis.NttCisScsiController(id, adapter_type, bus_number, state)[source]¶
Bases:
object
A class that represents the disk on a server
Instantiate a new
DimensionDataServerDisk
- Parameters:
id (
str
) – The id of the controlleradapter_type (
str
) – The ‘brand’ of adapterbus_number – The bus number occupied on the virtual hardware
state (
str
) – Current state (i.e. NORMAL)state – State of the disk (i.e. PENDING)
- class libcloud.common.nttcis.NttCisServerCpuSpecification(cpu_count, cores_per_socket, performance)[source]¶
Bases:
object
A class that represents the specification of the CPU(s) for a node
Instantiate a new
NttCisServerCpuSpecification
- Parameters:
cpu_count (
int
) – The number of CPUscores_per_socket (
int
) – The number of cores per socket, the recommendation is 1performance (
str
) – The performance type, e.g. HIGHPERFORMANCE
- class libcloud.common.nttcis.NttCisServerDisk(id=None, scsi_id=None, size_gb=None, speed=None, state=None)[source]¶
Bases:
object
A class that represents the disk on a server
Instantiate a new
DimensionDataServerDisk
- Parameters:
id (
str
) – The id of the diskscsi_id (
int
) – Representation for scsisize_gb (
int
) – Size of the diskspeed (
str
) – Speed of the disk (i.e. STANDARD)state (
str
) – State of the disk (i.e. PENDING)
- class libcloud.common.nttcis.NttCisServerVMWareTools(status, version_status, api_version)[source]¶
Bases:
object
A class that represents the VMWareTools for a node
Instantiate a new
NttCisServerVMWareTools
object- Parameters:
status (
str
) – The status of VMWare Toolsversion_status (
str
) – The status for the version of VMWare Tools (i.e NEEDS_UPGRADE)api_version (
str
) – The API version of VMWare Tools
- class libcloud.common.nttcis.NttCisSnapshot(server_id, service_plan, id=None, window_id=None, start_time=None, state=None, end_time=None, type=None, expiry_time=None, action=None)[source]¶
Bases:
object
NTTCIS Class representing server snapshots
- class libcloud.common.nttcis.NttCisStatus(action=None, request_time=None, user_name=None, number_of_steps=None, update_time=None, step_name=None, step_number=None, step_percent_complete=None, failure_reason=None)[source]¶
Bases:
object
- NTTCIS API pending operation status class
action, request_time, user_name, number_of_steps, update_time, step.name, step.number, step.percent_complete, failure_reason,
- class libcloud.common.nttcis.NttCisTag(asset_type, asset_id, asset_name, datacenter, key, value)[source]¶
Bases:
object
A representation of a Tag in NTTCIS A Tag first must have a Tag Key, then an asset is tag with a key and an option value. Tags can be queried later to filter assets and also show up on usage report if so desired.
Initialize an instance of
NttCisTag
- Parameters:
asset_type (
str
) – The type of asset. Current asset types: SERVER, VLAN, NETWORK_DOMAIN, CUSTOMER_IMAGE, PUBLIC_IP_BLOCK, ACCOUNTasset_id (
str
) – The GUID of the asset that is taggedasset_name (
str
) – The name of the asset that is taggeddatacenter (
str
) – The short datacenter name of the tagged assetkey (
NttCisTagKey
) – The tagged keyvalue (
None
orstr
) – The tagged value
- class libcloud.common.nttcis.NttCisTagKey(id, name, description, value_required, display_on_report)[source]¶
Bases:
object
A representation of a Tag Key in NTTCIS A tag key is required to tag an asset
Initialize an instance of
NttCisTagKey
- Parameters:
id (
str
) – GUID of the tag keyname (
str
) – Name of the tag keydescription (
str
) – Description of the tag keyvalue_required (
bool
) – If a value is required for this tag keydisplay_on_report (
bool
) – If this tag key should be displayed on usage reports
- class libcloud.common.nttcis.NttCisVIPNode(id, name, status, ip, connection_limit='10000', connection_rate_limit='10000', health_monitor=None)[source]¶
Bases:
object
Initialize an instance of
NttCisVIPNode
- Parameters:
id (
str
) – The ID of the nodename (
str
) – The name of the nodestatus (
NttCisStatus
) – The status of the nodeip (
str
) – The IP of the nodeconnection_limit (
int
) – The total connection limit for the nodeconnection_rate_limit (
int
) – The rate limit for the node
- class libcloud.common.nttcis.NttCisVirtualListener(id, name, status, ip)[source]¶
Bases:
object
NTTCIS Virtual Listener.
Initialize an instance of
NttCisVirtualListener
- Parameters:
id (
str
) – The ID of the listenername (
str
) – The name of the listenerstatus (
NttCisStatus
) – The status of the listenerip (
str
) – The IP of the listener
- class libcloud.common.nttcis.NttCisVirtualListenerCompatibility(type, protocol)[source]¶
Bases:
object
A compatibility preference for a persistence profile or iRule specifies which virtual listener types this profile or iRule can be applied to.
- class libcloud.common.nttcis.NttCisVlan(id, name, description, location, network_domain, status, private_ipv4_range_address, private_ipv4_range_size, ipv6_range_address, ipv6_range_size, ipv4_gateway, ipv6_gateway)[source]¶
Bases:
object
NTTCIS VLAN.
Initialize an instance of
DimensionDataVlan
- Parameters:
id (
str
) – The ID of the VLANname (
str
) – The name of the VLANdescription (
str
) – Plan text description of the VLANlocation (
NodeLocation
) – The location (data center) of the VLANnetwork_domain (
DimensionDataNetworkDomain
) – The Network Domain that owns this VLANstatus (
DimensionDataStatus
) – The status of the VLANprivate_ipv4_range_address (
str
) – The host address of the VLAN IP spaceprivate_ipv4_range_size (
int
) – The size (e.g. ‘24’) of the VLAN as a CIDR range sizeipv6_range_address (
str
) – The host address of the VLAN IP spaceipv6_range_size (
int
) – The size (e.g. ‘32’) of the VLAN as a CIDR range sizeipv4_gateway (
str
) – The IPv4 default gateway addressipv6_gateway (
str
) – The IPv6 default gateway address
- class libcloud.common.nttcis.XmlDictConfig(parent_element)[source]¶
Bases:
dict
Inherits from dict. Looks for XML elements, such as attrib, that can be converted to a dictionary. Any XML element that contains other XML elements, will be passed to XmlListConfig
- class libcloud.common.nttcis.XmlListConfig(elem_list)[source]¶
Bases:
list
Creates a class from XML elements that make a list. If a list of XML elements with attributes, the attributes are passed to XmlDictConfig.
- libcloud.common.nttcis.class_factory(cls_name, attrs)[source]¶
This class takes a name and a dictionary to create a class. The clkass has an init method, an iter for retrieving properties, and, finally, a repr for returning the instance :param cls_name: The name to be tacked onto the suffix NttCis :type cls_name:
str
:param attrs: The attributes and values for an instance :type attrs:dict
:return: a class that inherits from ClassFactory :rtype:ClassFactory
- libcloud.common.nttcis.dd_object_to_id(obj, obj_type, id_value='id')[source]¶
Takes in a DD object or string and prints out it’s id This is a helper method, as many of our functions can take either an object or a string, and we need an easy way of converting them
- Parameters:
obj (
object
) – The object to get the id forfunc (
function
) – The function to call, e.g. ex_get_vlan. Note: This function needs to return an object which hasstatus
attribute.
- Return type:
str
- libcloud.common.nttcis.process_xml(xml)[source]¶
Take the xml and put it into a dictionary. The process the dictionary recursively. This returns a class based on the XML API. Thus, properties will have the camel case found in the Java XML. This a trade-off to reduce the number of “static” classes that all have to be synchronized with any changes in the API. :param xml: The serialized version of the XML returned from Cloud Control :return: a dynamic class that inherits from ClassFactory :rtype: ClassFactory
- libcloud.common.nttcis.processor(mapping, name=None)[source]¶
Closure that keeps the deepcopy of the original dict converted to XML current. :param mapping: The converted XML to dict/lists :type mapping:
dict
:param name: (Optional) what becomes the class name if provided :type:str
:return: Nothing