Delete Multiple Tags

put

/paas/api/v1.1/tags/{identityDomainId}/tags

Deletes one or more tags.

Set the optional ?force query parameter to true to allow tags to be deleted even if they are assigned to resources.

Request

Supported Media Types
Path Parameters
Query Parameters
  • Flag that specifies whether to allow (true) or not allow (false) tags to be deleted if the tags are assigned to resources. Default is false (do not delete if the specified tags are assigned to resources). Set to true 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.

Header Parameters
Body ()
The request body defines the tags to delete.
Root Schema : deletetags-request
Type: object
Show Source
Nested Schema : tagsToDelete
Type: array
Groups the tags to delete. Each tag object is a key/value pair.
Show Source
Nested Schema : tagsdelete-request
Type: object
Show Source
Back to Top

Response

Supported Media Types

204 Response

No content.

Successfully deleted one or more tags. 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 tags with the specified key/value pair were found, and the force 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 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]"
        ]
    }
}
Back to Top