TMS API

The Tag Management Service Class

Tag Management Service (TMS) high-level interface is available through the tms member of a Connection object. The tms member will only be added if the otcextensions.sdk.register_otc_extensions(conn) method is called.

Predefined Tag Operations

class otcextensions.sdk.tms.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
predefined_tags(**query)

Retrieve a generator of PredefinedTags

Parameters:

query (dict) – Optional query parameters to be sent to limit the resources being returned. * key: Tag key * value: Tag value * limit: Number of query records * marker: Paging location identifier * order_field: Field for sorting * order_method: Sorting will be asc or desc

Returns:

A generator of backup PredefinedTag instances

create_predefined_tag(**attrs)

Create a new predefined tag with attrs

Parameters:

attrs (dict) – Keyword arguments which will be used to create a PredefinedTag

delete_predefined_tag(**attrs)

Delete a new predefined tag with attrs

Parameters:

attrs (dict) – Keyword arguments which will be used to delete a PredefinedTag

update_predefined_tag(**attrs)

Update a predefined tag

Parameters:

attrs (dict) – The attributes to update on the predefined tag

Returns:

The updated tag.

Return type:

PredefinedTag

Resource Tag Operations

class otcextensions.sdk.tms.v1._proxy.Proxy(session, statsd_client=None, statsd_prefix=None, prometheus_counter=None, prometheus_histogram=None, influxdb_config=None, influxdb_client=None, *args, **kwargs)
resource_tags(resource_id, resource_type, project_id=None)

Retrieve a generator of ResourceTags ‘project_id’, ‘resource_id’, ‘resource_type’

Parameters:
  • project_id – Optional ID of the project

  • resource_type – Mandatory type of the resource

  • resource_id – Mandatory id of the resource

Returns:

A generator of backup ResourceTag instances

create_resource_tag(**attrs)

Create a new resource tag with attrs

Parameters:

attrs (dict) – Keyword arguments which will be used to create a PredefinedTag

delete_resource_tag(**attrs)

Delete a new resource tag with attrs

Parameters:

attrs (dict) – Keyword arguments which will be used to delete a PredefinedTag