List All Tags
/paas/api/v1.1/tags/{identityDomainId}/tags
Set the ?outputLevel
query parameter to FULL
to return the service names of tag assignments along with the number of tag assignments.
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
-
identityDomainId: string
Identity domain ID for the Oracle Java Cloud Service account.
-
outputLevel(optional): string
Set to
FULL
to include the service names with the tag assignments. Otherwise only the number of service resources assigned with a tag is returned (default). -
services(optional): string
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:
JaaS.ExampleInstance
JaaS.ExampleInstance,JaaS.MyInstance01
JaaS.ExampleInstance,DBaaS.MyDBInstance
-
tagFilter(optional): string
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
orsite=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.
-
Authorization: string
Base64 encoded user name and password separated by a colon or OAuth access token obtained from Oracle Identity Cloud Service. See Authenticate.
-
X-ID-TENANT-NAME: string
Identity domain ID for the Oracle Java Cloud Service account.
Response
- application/json
200 Response
The response body contains information about all tags and their assignments.
object
-
assignmentState(optional):
string
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.
-
serviceName(optional):
string
Name of the service instance.
-
serviceType(optional):
string
Type of service.
For example,
JaaS
for a Java Cloud Service instance andDBaaS
for a Database Cloud Service deployment.
400 Response
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?outputLevel=FULL"
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=JaaS.MyJCSExample"
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/tags/ExampleIdentityDomain/tags?tagFilter='dev%25'&outputLevel=FULL"
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 when outputLevel=FULL.
{
"items":[
{
"key": "db",
"value": "atp",
"readOnly": false,
"assignments": {
"services": [
{
"serviceType": "JaaS",
"serviceName": "ExampleJaaSInstance",
"assignmentState": "Assigned"
}
]
},
"assignmentCounts": {
"services": 1
},
"links": [
{
"rel": "canonical",
"href": "https://jaas.oraclecloud.com:443/paas/api/v1.1/tags/ExampleIdentityDomain/tags/db/atp"
}
],
"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&outputLevel=FULL"
},
{
"rel":"last",
"href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?offset=0&outputLevel=FULL"
},
{
"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?outputLevel=FULL"
}
]
}
The following is an example of the response returned for one specific service instance.
{
"items":[
{
"key":"environment",
"value":"development",
"readOnly":false,
"assignmentCounts":{
"services": 0
},
"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,
"assignmentCounts":{
"services": 0
},
"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=JaaS.MyJCSExample&offset=0"
},
{
"rel":"last",
"href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?services=JaaS.MyJCSExample&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=JaaS.MyJCSExample"
}
]
}
The following is an example of the response returned for tags that have a key starting with 'dev' and also when outputLevel=FULL.
{
"items":[
{
"key":"development",
"value":"hr",
"readOnly":false,
"assignments":{
"services":[
{
"serviceType":"JaaS",
"serviceName":"MyJCSExample",
"assignmentState": "Assigned"
}
]
},
"assignmentCounts": {
"services": 1
},
"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":"JaaS",
"serviceName":"MyJCSExampleSales",
"assignmentState": "Assigned"
}
]
},
"assignmentCounts": {
"services": 1
},
"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":[]
},
"assignmentCounts": {
"services": 0
},
"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&outputLevel=FULL"
},
{
"rel":"last",
"href":"https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?tagFilter=%27dev%25%27&offset=0&outputLevel=FULL"
},
{
"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&outputLevel=FULL"
}
]
}