SoftLayer.metadata¶
Metadata Manager/helpers
license: | MIT, 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:
>>> import SoftLayer >>> client = SoftLayer.Client() >>> from SoftLayer import MetadataManager >>> meta = MetadataManager(client) >>> meta.get('datacenter') 'dal05' >>> meta.get('fqdn') 'test.example.com'
- get(name, param=None)[source]¶
Retreive a metadata attribute
Parameters: - name (string) – name of the attribute to retrieve. See attribs
- param – Required parameter for some attributes
- 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']¶