View Resource Usage tags applied on an Account

get

/metering/api/v1/usage/{accountId}/tags

Retrieve all tags applied on usage posted for a given account.

Request

Path Parameters
Query Parameters
  • tagType can be NATIVE , NON-NATIVE or ALL. OCI tags are non-native
    Default Value: NATIVE
Back to Top

Response

Supported Media Types

200 Response

Success
Body ()
Root Schema : AccountUsageTags
Type: object
Title: AccountUsageTags
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : UsageTag
Type: object
Title: UsageTag
Show Source
Nested Schema : createdOn
Type: object

Default Response

Unexpected error.
Back to Top

Examples

cURL Command

The following example shows how to retrieve details about resource usage tags for a given account by submitting a GET request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -X GET 
     -u joe@example.com 
     -H "X-ID-TENANT-NAME:myDomain" 
     "https://itra.oraclecloud.com/metering/api/v1/usage/cacct-b08a16eb7b034d99b1bd6de5f62fd302/tags?tagType=ALL"

Example of Request Body

There is no request body to submit with the HTTP request.

Example of Response Body

The following example shows the response body in JSON format.

{
"accountId":"cacct-b08a16eb7b034d99b1bd6de5f62fd302",
"items":[
    {
        "tag":"ORCL:OCICompartment=ocid1.compartment.region1..aaaaaaaantw322yfvj55frntzszxe7khcfyvmg73bnccysxcr5zzybn4xboa",
        "tagType":"NON_NATIVE",
	      "createdOn":"2018-02-08T14:19:45.627"
    },

    {
        "tag":"ORCL:OCIService=Networking",
        "tagType":"NON_NATIVE",
	      "createdOn":"2018-02-08T14:19:45.627"
    },

    {
	      "tag":"ORCL:OCICompartment=ocid1.compartment.region1..aaaaaaaaqlq3e4bffx2z7y7uwdpk4jj3ruuh5kdfycgw6phbplp6dkdbtrra",
        "tagType":"NON_NATIVE",
        "createdOn":"2018-05-23T00:28:06.609"
	  },
	
	  {
	     "tag":"ORCL:OCIService=Block Storage",
	     "tagType":"NON_NATIVE",
	     "createdOn":"2018-05-23T00:28:06.609"
	  },
	
	  {
	     "tag":"ORCL:OCICompartmentName=ManagedCompartmentForPaaS",
	     "tagType":"NON_NATIVE","createdOn":"2018-05-23T00:35:29.367"
	  },
	
	  { 
       "tag":"ORCL:OCICompartmentName=dev",
	     "tagType":"NON_NATIVE",
	     "createdOn":"2018-05-23T01:17:47.486"
	  }
 ],
"canonicalLink":"/metering/api/v1/usage/cacct-b08a16eb7b034d99b1bd6de5f62fd302/tags?tagType=ALL"
}
Back to Top