Delete a Tag

delete

/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.

Request

Path Parameters
Query Parameters
Header Parameters
Back to Top

Response

204 Response

No Content.

Successfully deleted the tag. There is no response body.

400 Response

Bad request.

An attempt was made to delete a tag that cannot be removed (for example, a system-provided tag cannot be deleted).

Body ()
Root Schema : failed-response
Type: object
Show Source
Nested Schema : details
Type: object
Groups details of a bad request, not found response, or conflict response.
Show Source
Nested Schema : issues
Type: array
List of operation issues found.
Show Source

404 Response

Not found.

No tag with the specified key/value was found.

409 Response

Conflict.

The tag is assigned to one or more resources, and the removeAssignments query parameter was not set to true.

Body ()
Root Schema : failed-response
Type: object
Show Source
Nested Schema : details
Type: object
Groups details of a bad request, not found response, or conflict response.
Show Source
Nested Schema : issues
Type: array
List of operation issues found.
Show Source
Back to Top

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]"
      ]
   }
}
Back to Top