Skip to main content

cost_tracking_tags

Creates, updates, deletes, gets or lists a cost_tracking_tags resource.

Overview​

Namecost_tracking_tags
TypeResource
Idoci.identity.cost_tracking_tags

Fields​

The following fields are returned by SELECT queries:

A tag definition that belongs to a specific tag namespace. "Defined tags" must be set up in your tenancy before<br />you can apply them to resources.<br />For more information, see [Managing Tags and Tag Namespaces](/Content/Identity/Concepts/taggingoverview.htm).<br /><br />Warning: Oracle recommends that you avoid using any confidential information when you supply string values<br />using the API.<br />

NameDatatypeDescription
idstringThe OCID of the tag definition.
namestringThe name assigned to the tag during creation. This is the tag key definition. The name must be unique within the tag namespace and cannot be changed.
compartmentIdstringThe OCID of the compartment that contains the tag definition.
definedTagsobjectDefined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: &#123;"Operations": &#123;"CostCenter": "42"&#125;&#125;
descriptionstringThe description you assign to the tag.
freeformTagsobjectFree-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](/Content/General/Concepts/resourcetags.htm). Example: &#123;"Department": "Finance"&#125;
isCostTrackingbooleanIndicates whether the tag is enabled for cost tracking.
isRetiredbooleanIndicates whether the tag is retired. See [Retiring Key Definitions and Namespace Definitions](/Content/Tagging/Tasks/managingtagsandtagnamespaces.htm#retiringkeys).
lifecycleStatestringThe tag's current state. After creating a tag, make sure its lifecycleState is ACTIVE before using it. After retiring a tag, make sure its lifecycleState is INACTIVE before using it. If you delete a tag, you cannot delete another tag until the deleted tag's lifecycleState changes from DELETING to DELETED. (ACTIVE, INACTIVE, DELETING, DELETED)
systemTagsobjectThe system tags for this resource. Each key is predefined and scoped to a namespace. Example: &#123;"orcl-cloud": &#123;"free-tier-retained": "true"&#125;&#125;
tagNamespaceIdstringThe OCID of the namespace that contains the tag definition.
tagNamespaceNamestringThe name of the tag namespace that contains the tag definition.
timeCreatedstring (date-time)Date and time the tag was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
validatorobjectValidates a definedTag value. Each validator performs validation steps in addition to the standard validation for definedTag values. For more information, see [Limits on Tags](/Content/Tagging/Concepts/taggingoverview.htm#limits). If you define a validator after a value has been set for a defined tag, then any updates that attempt to change the value must pass the additional validation defined by the current rule. Previously set values (even those that would fail the current validation) are not updated. You can still update other attributes to resources that contain a non-valid defined tag. To clear the validator call UpdateTag with [DefaultTagDefinitionValidator](/api/#/en/identity/latest/datatypes/DefaultTagDefinitionValidator).

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectcompartmentId, regionpage, limitLists all the tags enabled for cost-tracking in the specified tenancy. For information about<br />cost-tracking tags, see [Using Cost-tracking Tags](/Content/Tagging/Tasks/usingcosttrackingtags.htm).<br />

Parameters​

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
compartmentIdstringThe OCID of the compartment (remember that the tenancy is simply the root compartment).
regionstringOCI region identifier (e.g. us-ashburn-1, ap-sydney-1); resolves from OCI_REGION when not supplied in the query. (default: us-ashburn-1, x-stackQL-envVar: OCI_REGION)
limitintegerThe maximum number of items to return in a paginated "List" call.
pagestringThe value of the opc-next-page response header from the previous "List" call.

SELECT examples​

Lists all the tags enabled for cost-tracking in the specified tenancy. For information about<br />cost-tracking tags, see [Using Cost-tracking Tags](/Content/Tagging/Tasks/usingcosttrackingtags.htm).<br />

SELECT
id,
name,
compartmentId,
definedTags,
description,
freeformTags,
isCostTracking,
isRetired,
lifecycleState,
systemTags,
tagNamespaceId,
tagNamespaceName,
timeCreated,
validator
FROM oci.identity.cost_tracking_tags
WHERE compartmentId = '{{ compartmentId }}' -- required
AND region = '{{ region }}' -- required
AND page = '{{ page }}'
AND limit = '{{ limit }}'
;