SoftLayer.metadata

Metadata Manager/helpers

copyright:
  1. 2013, SoftLayer Technologies, Inc. All rights reserved.
license:

BSD, see LICENSE for more details.

class SoftLayer.managers.metadata.MetadataManager(client=None, timeout=5)[source]

Provides an interface for the metadata service. This provides metadata about the resourse it is called from. See METADATA_ATTRIBUTES for full list of attributes.

Usage:

>>> from SoftLayer.metadata import MetadataManager
>>> meta = MetadataManager(client)
>>> meta.get('datacenter')
'dal05'
>>> meta.get('fqdn')
'test.example.com'
attribs = {'datacenter': {'call': 'Datacenter'}, 'domain': {'call': 'Domain'}, 'backend_mac': {'call': 'BackendMacAddresses'}, 'primary_ip': {'call': 'PrimaryIpAddress'}, 'primary_backend_ip': {'call': 'PrimaryBackendIpAddress'}, 'tags': {'call': 'Tags'}, 'primary_frontend_ip': {'call': 'PrimaryIpAddress'}, 'hostname': {'call': 'Hostname'}, 'fqdn': {'call': 'FullyQualifiedDomainName'}, 'user_data': {'call': 'UserMetadata'}, 'datacenter_id': {'call': 'DatacenterId'}, 'vlan_ids': {'call': 'VlanIds', 'param_req': True}, 'frontend_mac': {'call': 'FrontendMacAddresses'}, 'user_metadata': {'call': 'UserMetadata'}, 'provision_state': {'call': 'ProvisionState'}, 'router': {'call': 'Router', 'param_req': True}, 'vlans': {'call': 'Vlans', 'param_req': True}, 'id': {'call': 'Id'}}
get(name, param=None)[source]

Retreive a metadata attribute

Parameters:
  • name – name of the attribute to retrieve. See attribs
  • param – Required parameter for some attributes
make_request(path)[source]
private_network(**kwargs)[source]

Returns details about the private network

Parameters:
  • router (boolean) – True to return router details
  • vlans (boolean) – True to return vlan details
  • vlan_ids (boolean) – True to return vlan_ids
public_network(**kwargs)[source]

Returns details about the public network

Parameters:
  • router (boolean) – True to return router details
  • vlans (boolean) – True to return vlan details
  • vlan_ids (boolean) – True to return vlan_ids
metadata.METADATA_ATTRIBUTES = ['datacenter', 'domain', 'backend_mac', 'primary_ip', 'primary_backend_ip', 'tags', 'primary_frontend_ip', 'hostname', 'fqdn', 'user_data', 'datacenter_id', 'vlan_ids', 'frontend_mac', 'user_metadata', 'provision_state', 'router', 'vlans', 'id']

Previous topic

SoftLayer.messaging

Next topic

SoftLayer.SSL

This Page