Create and Assign Tags
/paas/api/v1.1/tags/{identityDomainId}/tags
Request
- application/json
-
identityDomainId: string
Identity domain ID for the Oracle Java Cloud Service account.
-
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.
object
-
serviceName:
string
Name of the service instance to tag (or untag).
-
serviceType(optional):
string
Type of service.
For example,
JaaS
for a Java Cloud Service instance andDBaaS
for a Database Cloud Service deployment.
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
object
-
details(optional):
object details
Groups details of a bad request, not found response, or conflict response.
object
-
issues(optional):
array issues
List of operation issues found.
-
message(optional):
string
Operation message.
Examples
The following example shows how to create tags and assign them in the same POST request using cURL.
Note: The command in this example uses 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
curl -i -X POST -u username:password -d @createassigntags.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags"
Example of Request Body
The following example shows the contents of the request body in JSON format.
At least one tag key/value pair must be specified. The request may contain a list of existing resources to which the new tag will be assigned.
{
"tags": [
{
"key": "environment",
"value": "qa"
}
],
"assignments": {
"services": [
{
"serviceType": "JaaS",
"serviceName": "MyJCSExample"
}
]
}
}
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK
Date: Fri, 05 Jan 2018 19:02:23 GMT
Content-Length: 142
Content-Type: application/vnd.com.oracle.oracloud.provisioning.Service+json
X-ORACLE-DMS-ECID: 1bcaf164-c5b5-4c70-b7d8-5a24c1e19493-00000a8a
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: *l/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/1450657
Content-Type: application/json
Example of Response Body
The following shows an example of the response body in JSON format.
One tag is created. The new tag is assigned to one service resource.
[
{
"key":"environment",
"value":"qa",
"assignments":{
"services":[
{
"serviceType":"JaaS",
"serviceName":"MyJCSExample"
}
]
}
}
]