Delete All Tags by Key
/paas/api/v1.1/tags/{identityDomainId}/tags/{tagKey}
Set the optional ?removeAssignments
query parameter to true
to remove all tags and any existing assignments that match the specified tag key.
Request
-
identityDomainId: string
Identity domain ID for the Oracle Java Cloud Service account.
-
tagKey: string
Tag key.
-
removeAssignments(optional): boolean
Flag that specifies whether to allow (
true
) or not allow (false
) deletion if there are tag assignments that match the specified key.
-
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
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 were found.
409 Response
One or more tags are assigned to one or more resources, and the removeAssignments
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 all tags with a specific key by submitting a DELETE request on the REST resource 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 DELETE -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" "https://rest_server_url/paas/api/v1.1/tags/ExampleIdentityDomain/tags/mykey?removeAssignments=true"
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: Sat, 06 Jan 2018 16:46:06 GMT
Content-Length: 0
X-ORACLE-DMS-ECID: 1bcaf164-c5b5-4c70-b7d8-5a24c1e19493-0000c8dc
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 (conflict)
If there are assignments associated with the specified key and the ?removeAssignments
query parameter is not set to true
, you would get a 409 Conflict error and the following message:
{
"details":{
"message":"Tag deletion failed",
"issues":[
"[PSM-TAG-00014 Cannot delete a tag that has assignments]"
]
}
}