List All Tags

get

/paas/api/v1.1/tags/{identityDomainId}/tags

This endpoint is not available on Oracle Cloud at Customer.

Returns all tags and tag assignments in the specified identity domain ID.

Use the optional ?services query parameter to list tags for one or more specific service instances.

Use the optional ?tagFilter query parameter to provide a search criteria based on tags.

Request

Path Parameters
Query Parameters
  • When set to a specific service type and service name in the format service_type.instance_name, the response includes tags and assignments for the specified instance only. Use a comma separated list to get information for two or more service instances.

    For example:

    • MySQLCS.ExampleInstance
    • MySQLCS.ExampleInstance,MySQLCS.MyInstance01
    • MySQLCS.ExampleInstance,DBaaS.MyDBInstance
  • An expression using tag keys and values for filtering search results. Only results that satisfy the expression are returned in a search.

    When creating your filter expression:

    • Use the percent sign (%) to match multiple characters.
    • Use the underscore character (_) to match a single character.
    • Precede a literal character by a backslash character (\) if a key or value contains a literal percent sign (%), apostrophe or single quote ('), or underscore (_).

    Valid expressions include:

    • 'foo':'bar' - Finds all tags and assignments that have a key of 'foo' and a value of 'bar'
    • 'ora\_%':'%prod%' - Finds all tags and assignments that have a key starting with 'ora_' and a value containing 'prod'.
    • 'haMode' - Finds all tags and assignments that have a tag key of 'haMode'
    • 'ora\_%' - Finds all tags and assignments that a tag key starting with 'ora_'
    • 'site':'pe_r' - Uses the underscore wildcard to wildcard-match only a single character. For example, site=pear or site=peer is a match. site=pepper is not a match.
    • 'foo':'' - Finds all tags and assignments that have a tag key of 'foo' and an empty string as the value.
    • 'accuracy':'100\%' - Uses the literal percent sign in a value, so that it is not interpreted as a wildcard match.
    • 'type':'Abe\'s test' - Uses the apostrophe (single quote) in a key or value.
    • 'key\_contains\_underscores':'value\_does\_too' - Uses underscores in a key or value, so that they are not interpreted as single-character wildcards.
Header Parameters

Response

Supported Media Types

200 Response

OK.
Body ()
The response body contains information about all tags and their assignments.
Root Schema : alltagsassignments-response
Type: object
The response body contains information about all tags and their assignments.
Show Source
Nested Schema : items
Type: array
Groups details of tags and their assignments.
Show Source
Nested Schema : tagsassignments-details
Type: object
Each object describes a tag and its assignments.
Show Source
Nested Schema : assignments
Type: object
Groups assignment details for this tag.
Show Source
Nested Schema : services
Type: array
Groups the service resources assigned with this tag.
Show Source
Nested Schema : serviceassignment-details
Type: object
Each object describes a service resource.
Show Source
  • Whether tag assignment or unassignment is in progress. Possible values: Assigning, Unassigning, Assigned

    This property is not shown when you use the Create and Assign Tags endpoint or Create and Delete Assignments endpoint.

  • Name of the service instance.
  • Type of service.

    For example, MySQL for a MySQL Cloud Service instance and DBaas for a Database Cloud Service deployment.

400 Response

Bad request.

If you get the message SM-UI-PROXY when you use the percent sign (%) to match multiple characters, this means the percent sign must be percent-encoded as %25. Try the command again using percent-encoding for the percent character.

Examples

Note: The commands in this example use the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain (or Cloud Account). See Send Requests.

cURL Command

The following example shows how to list all tags and their assignments for an identity domain ID, by submitting a GET request on the REST resource using cURL.

curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags"

The following command uses the query parameter to list tags for a specific instance.

curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?services=MySQLCS.MyExample"

The following command uses the query parameter to search for tags and assignments based on a tag filter expression.

curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/instances?tagFilter='dev%25'"

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Date: Fri, 05 Jan 2018 20:30:43 GMT
Content-Length: 1024
Content-Type: application/vnd.oracle.resource+json;type=collection
X-ORACLE-DMS-ECID: 1bcaf164-c5b5-4c70-b7d8-5a24c1e19493-00001d8f
X-Frame-Options: DENY
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
Access-Control-Allow-Headers: Content-Type, api_key, Authorization, X-ID-TENANT-NAME, X-USER-IDENTITY-DOMAIN-NAME
Access-Control-Allow-Origin: *

Example of Response Body

The following is an example of the response returned for all tags.

There are three tags. One tag does not have any assignments.

{
   "items":[
      {
         "key":"environment",
         "value":"development",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/environment/development"
            }
         ],
         "state": "Ready"
      },
      {
         "key":"environment",
         "value":"qa",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/environment/qa"
            }
         ],
         "state": "Ready"
      },
      {
         "key":"environment",
         "value":"qa-other",
         "readOnly":false,
         "assignments":{
            "services":[]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/environment/qa-other"
            }
         ],
         "state": "Ready"
      }
   ],
   "limit":200,
   "hasMore":false,
   "offset":0,
   "links":[
      {
         "rel":"first",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?offset=0"
      },
      {
         "rel":"last",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?offset=0"
      },
      {
         "rel":"canonical",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/"
      },
      {
         "rel":"self",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags"
      }
   ]
}

The following is an example of the response returned for one service instance.

{
   "items":[
      {
         "key":"environment",
         "value":"development",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/environment/development"
            }
         ],
         "state": "Ready"
      },
      {
         "key":"environment",
         "value":"qa",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/environment/qa"
            }
         ],
         "state": "Ready"
      }
   ],
   "limit":200,
   "hasMore":false,
   "offset":0,
   "links":[
      {
         "rel":"first",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?services=MySQLCS.MyExample&offset=0"
      },
      {
         "rel":"last",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?services=MySQLCS.MyExample&offset=0"
      },
      {
         "rel":"canonical",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/"
      },
      {
         "rel":"self",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?services=MySQLCS.MyExample"
      }
   ]
}

The following is an example of the response returned for tags that have a key starting with 'dev'.

{
   "items":[
      {
         "key":"development",
         "value":"hr",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/development/hr"
            }
         ],
         "state": "Ready"
      },
      {
         "key":"development",
         "value":"sales",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/development/sales"
            }
         ],
         "state": "Ready"
      },
      {
         "key":"development",
         "value":"",
         "readOnly":false,
         "assignments":{
            "services":[
               {
                  "serviceType":"MySQLCS",
                  "serviceName":"MyExample",
                  "assignmentState": "Assigned"
               }
            ]
         },
         "links":[
            {
               "rel":"canonical",
               "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/development/"
            }
         ],
         "state": "Ready"
      }
   ],
   "limit":200,
   "hasMore":false,
   "offset":0,
   "links":[
      {
         "rel":"first",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?tagFilter=%27dev%25%27&offset=0"
      },
      {
         "rel":"last",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?tagFilter=%27dev%25%27&offset=0"
      },
      {
         "rel":"canonical",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/"
      },
      {
         "rel":"self",
         "href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?tagFilter=%27dev%25%27"
      }
   ]
}