Delete Multiple Tags
/paas/api/v1.1/tags/{identityDomainId}/tags
Set the optional ?force
query parameter to true
to allow tags to be deleted even if they are assigned to resources.
Request
- application/json
-
identityDomainId: string
Identity domain ID for the Oracle Java Cloud Service account.
-
force(optional): boolean
Flag that specifies whether to allow (
true
) or not allow (false
) tags to be deleted if the tags are assigned to resources. Default isfalse
(do not delete if the specified tags are assigned to resources). Set totrue
to allow tags to be deleted even if there are tag assignments.Also, the request will fail (
false
) or not fail (true
) if any of the specified tags are not found.
-
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
204 Response
Successfully deleted one or more tags. There is no response body.
400 Response
An attempt was made to delete a tag that cannot be removed (for example, a system-provided tag cannot be deleted).
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.
404 Response
No tags with the specified key/value pair were found, and the force
query parameter was not set to true
.
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 delete multiple tags (even if there are tag assignments) in one PUT 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 PUT -u username:password -d @deletemultipletags.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags?force=true"
Example of Request Body
The following shows an example of the request body in JSON format.
{
"tagsToDelete": [
{
"key": "environment",
"value": "qa-other"
},
{
"key": "environment",
"value": "qa"
}
]
}
Example of Response Header and Body (successful)
The following shows an example of the response header. There is no response body upon successful deletions.
HTTP/1.1 204 No Content
Date: Fri, 05 Jan 2018 23:26:42 GMT
Content-Length: 0
X-ORACLE-DMS-ECID: 1bcaf164-c5b5-4c70-b7d8-5a24c1e19493-000063fc
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: *ent-Type, api_key, Authorization, X-ID-TENANT-NAME, X-USER-IDENTITY-DOMAIN-NAME
Access-Control-Allow-Origin: *
Example of Response Body (not found)
If the status is 404 or 400, a response similar to the following is returned.
{
"details": {
"message": "Tag deletion failed",
"issues": [
"[PSM-TAG-00018 A tag with key [environment] and value [qa1] does not exist]",
"[PSM-TAG-00018 A tag with key [environment] and value [qa2] does not exist]"
]
}
}