Delete a Tag
/paas/api/v1.1/tags/{identityDomainId}/tags/{tagKey}/{tagValue}
Deletes the tag that has the specified key and value. The value may be an empty string to match a tag that has an empty value.
Set the optional ?removeAssignments
query parameter to true
to remove the tag and any existing assignments that match the specified key and value.
Note: This endpoint cannot be used to delete account tags of any type.
Request
-
identityDomainId: string
Identity domain ID for the MySQL Cloud Service account.
-
tagKey: string
Tag key.
-
tagValue: string
Tag value.
-
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/value pair.
-
X-ID-TENANT-NAME: string
Identity domain ID for the MySQL Cloud Service account.
Response
204 Response
Successfully deleted the tag. 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 tag with the specified key/value was found.
409 Response
The tag is 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 a tag with a specific key and value 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/myvalue?removeAssignments=true"
Example of Response Header and Body (successful)
The following shows an example of the response header. There is no response body upon a successful deletion.
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 tag 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]"
]
}
}