TagManager
- class SoftLayer.managers.TagManager(client)[source]
Manager for Tag functions.
Methods
__init__
(client)delete_tag
(name)Calls SoftLayer_Tag::deleteTag
Calls SoftLayer_Tag::getAllTagTypes()
get_attached_tags
([mask])Calls SoftLayer_Tag::getAttachedTagsForCurrentUser()
get_resource_name
(resource, tag_type)Returns a string that names a resource
get_tag
(tag_id[, mask])Calls SoftLayer_Tag::getObject(id=tag_id)
get_tag_by_name
(tag_name[, mask])Calls SoftLayer_Tag::getTagByTagName(tag_name)
get_tag_references
(tag_id[, mask])Calls SoftLayer_Tag::getReferences(id=tag_id)
get_unattached_tags
([mask])Calls SoftLayer_Tag::getUnattachedTagsForCurrentUser()
list_tags
([mask])Returns a list of all tags for the Current User
reference_lookup
(resource_table_id, tag_type)Returns the SoftLayer Service for the corresponding type
set_tags
(tags, key_name, resource_id)Calls SoftLayer_Tag::setTags()
taggable_by_type
(tag_type)Returns a list of resources that can be tagged, that are of the given type
type_to_service
(tag_type)Returns the SoftLayer service for the given tag_type
- delete_tag(name)[source]
Calls SoftLayer_Tag::deleteTag
- Parameters:
name (string) – tag name to delete
- get_attached_tags(mask=None)[source]
Calls SoftLayer_Tag::getAttachedTagsForCurrentUser()
- Params string mask:
Mask to use.
- static get_resource_name(resource, tag_type)[source]
Returns a string that names a resource
- Parameters:
resource (dict) – A SoftLayer datatype for the given tag_type
tag_type (string) – Key name for the tag_type
- get_tag(tag_id, mask=None)[source]
Calls SoftLayer_Tag::getObject(id=tag_id)
- Params int tag_id:
Tag id to get object from
- Params string mask:
Mask to use.
- get_tag_by_name(tag_name, mask=None)[source]
Calls SoftLayer_Tag::getTagByTagName(tag_name)
- Params string tag_name:
Tag name to get object from
- Params string mask:
Mask to use.
- get_tag_references(tag_id, mask=None)[source]
Calls SoftLayer_Tag::getReferences(id=tag_id)
- Params int tag_id:
Tag id to get references from
- Params string mask:
Mask to use.
- get_unattached_tags(mask=None)[source]
Calls SoftLayer_Tag::getUnattachedTagsForCurrentUser()
- Params string mask:
Mask to use.
- list_tags(mask=None)[source]
Returns a list of all tags for the Current User
- Parameters:
mask (str) – Object mask to use if you do not want the default.
- reference_lookup(resource_table_id, tag_type)[source]
Returns the SoftLayer Service for the corresponding type
- Parameters:
resource_table_id (int) – Tag_Reference::resourceTableId
tag_type (string) – Tag_Reference->tagType->keyName
From SoftLayer_Tag::getAllTagTypes()
|Type |Service | | ----------------------------- | ------ | |Hardware |HARDWARE| |CCI |GUEST| |Account Document |ACCOUNT_DOCUMENT| |Ticket |TICKET| |Vlan Firewall |NETWORK_VLAN_FIREWALL| |Contract |CONTRACT| |Image Template |IMAGE_TEMPLATE| |Application Delivery Controller |APPLICATION_DELIVERY_CONTROLLER| |Vlan |NETWORK_VLAN| |Dedicated Host |DEDICATED_HOST|
- set_tags(tags, key_name, resource_id)[source]
Calls SoftLayer_Tag::setTags()
- Parameters:
tags (string) – List of tags.
key_name (string) – Key name of a tag type.
resource_id (int) – ID of the object being tagged.