Create an access management tag
POST /v3/tags
Create an access management tag. To create an `access` tag, you must have the access listed in the Granting users access to tag resources documentation. `service` and `user` tags cannot be created upfront. They are created when they are attached for the first time to a resource.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
This action applies only to access management tags.
ghost-tags.create-access-tag
Auditing
Calling this method generates the following auditing event.
global-search-tagging.tag.create
Request
Parameters
tagNames
Required *
string[]
An array of tag names to create.
Constraints:
- Min items: 1
- Max items: 100
impersonateUser
string
The user on whose behalf the create operation must be performed (for administrators only).
Constraints:
- Pattern:
/^.*-.*$/
transactionId
string
An alphanumeric string that can be used to trace a request across services. If not specified, it automatically generated with the prefix "gst-".
Constraints:
- Min length: 1
- Max length: 150
- Pattern:
/.*/
accountId
string
The ID of the billing account where the tag must be created. It is a required parameter if `impersonate_user` is set.
Constraints:
- Pattern:
/^[a-zA-Z0-9.]+$|^[*]{1}$/
tagType
string
The type of the tags you want to create. The only allowed value is `access`.
Allowed values: access
Default: access
Response
200 - The tag was created successfully.
results
array
Array of results of a create_tag request.
400 - Bad request
errors
array
Detailed errors list
401 - Unauthorized, wrong authorization token type, or IAM authorization token was not valid.
errors
array
Detailed errors list
429 - Too Many Requests
default - System problem or unexpected error.
Delete all unused tags
DELETE /v3/tags
Delete the tags that are not attached to any resource.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
This action applies only to access management tags.
ghost-tags.delete-access-tag
Auditing
Calling this method generates the following auditing event.
global-search-tagging.tags.delete
Request
Parameters
transactionId
string
An alphanumeric string that can be used to trace a request across services. If not specified, it automatically generated with the prefix "gst-".
Constraints:
- Min length: 1
- Max length: 150
- Pattern:
/.*/
providers
string
Select a provider. Supported values are `ghost` and `ims`.
Allowed values: ghost, ims
Default: ghost
impersonateUser
string
The user on whose behalf the delete all operation must be performed (for administrators only).
Constraints:
- Pattern:
/^.*-.*$/
accountId
string
The ID of the billing account to delete the tags for. If it is not set, then it is taken from the authorization token. It is a required parameter if `tag_type` is set to `service`.
Constraints:
- Pattern:
/^[a-zA-Z0-9.]+$|^[*]{1}$/
tagType
string
The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported for IMS resources (`providers` parameter set to `ims`).
Allowed values: user, service, access
Default: user
Response
200 - A results page that includes the list of tags that have been deleted.
total_count
integer
The number of tags that have been deleted.
errors
boolean
It is set to true if there is at least one tag operation in error.
items
array
The list of tag operation results.
400 - Bad request
errors
array
Detailed errors list
401 - Unauthorized, wrong authorization token type, or IAM authorization token was not valid.
errors
array
Detailed errors list
429 - Too Many Requests
default - System problem or unexpected error
Delete an unused tag
DELETE /v3/tags/{tag_name}
Delete an existing tag. A tag can be deleted only if it is not attached to any resource.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
This action applies only to access management tags.
ghost-tags.delete-access-tag
Auditing
Calling this method generates the following auditing event.
global-search-tagging.tag.delete
Request
Parameters
tagName
Required *
string
The name of tag to be deleted.
Constraints:
- Max length: 128
- Pattern:
/^[A-Za-z0-9:_ .-]+$/
transactionId
string
An alphanumeric string that can be used to trace a request across services. If not specified, it automatically generated with the prefix "gst-".
Constraints:
- Min length: 1
- Max length: 150
- Pattern:
/.*/
providers
string[]
Select a provider. Supported values are `ghost` and `ims`. To delete tags both in Global Search and Tagging and in IMS, use `ghost,ims`.
Allowed values: ghost, ims
Default: ["ghost"]
impersonateUser
string
The user on whose behalf the delete operation must be performed (for administrators only).
Constraints:
- Pattern:
/^.*-.*$/
accountId
string
The ID of the billing account to delete the tag for. It is a required parameter if `tag_type` is set to `service`, otherwise it is inferred from the authorization IAM token.
Constraints:
- Pattern:
/^[a-zA-Z0-9.]+$|^[*]{1}$/
tagType
string
The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported for IMS resources (`providers` parameter set to `ims`).
Allowed values: user, service, access
Default: user
Response
200 - Success message
results
array
Array of results of a delete_tag request.
400 - Bad request
errors
array
Detailed errors list
401 - Unauthorized, wrong authorization token type, or IAM authorization token was not valid.
errors
array
Detailed errors list
429 - Too Many Requests
default - System problem or unexpected error
Attach tags
POST /v3/tags/attach
Attaches one or more tags to one or more resources. Each resource can have no more than 1000 tags per each 'user' and 'service' type, and no more than 250 'access' tags (which is the account limit).
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
This action applies only to user tags. Because service tags are managed by IBM services. IAM actions do not apply to them.
To attach a `user` tag on a resource, you must have the access listed in the Granting users access to tag resources documentation.
To attach a `service` tag, you must be an authorized service. If that is the case, then you can attach a `service` tag with your registered `prefix` to any resource in any account. The account ID must be set through the `account_id` query parameter.
To attach an `access` tag, you must be the resource administrator within the account. You can attach only `access` tags that already exist.
In the case you want to replace all the list of user tags attached, you must have both the accesses to attach and detach user tags to the resource.
In the case you want to replace all the list of access tags attached, you must have both the accesses to attach and detach access tags to the resource.
global-search-tagging.tag.attach-user-tagglobal-search-tagging.tag.attach-access-tagglobal-search-tagging.tag.detach-user-tagglobal-search-tagging.tag.detach-access-tag
Auditing
Calling this method generates the following auditing event.
<serviceName>.tag.attach
Request
Parameters
resources
Required *
Resource[]
List of resources on which the tag or tags are attached.
Constraints:
- Min items: 1
- Max items: 100
tagName
string
The name of the tag to attach.
Constraints:
- Max length: 128
- Pattern:
/^([ ]*[A-Za-z0-9:_.-]+[ ]*)+$/
tagNames
string[]
An array of tag names to attach.
Constraints:
- Min items: 1
- Max items: 100
transactionId
string
An alphanumeric string that can be used to trace a request across services. If not specified, it automatically generated with the prefix "gst-".
Constraints:
- Min length: 1
- Max length: 150
- Pattern:
/.*/
impersonateUser
string
The user on whose behalf the attach operation must be performed (for administrators only).
Constraints:
- Pattern:
/^.*-.*$/
accountId
string
The ID of the billing account of the tagged resource. It is a required parameter if `tag_type` is set to `service`. Otherwise, it is inferred from the authorization IAM token.
Constraints:
- Pattern:
/^[a-zA-Z0-9.]+$|^[*]{1}$/
tagType
string
The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported for IMS resources.
Allowed values: user, service, access
Default: user
Response
200 - The array of tag attach operations result
results
array
Array of results of an attach_tag or detach_tag request.
400 - Bad request
errors
array
Detailed errors list
401 - Unauthorized, wrong authorization token type, or IAM authorization token was not valid.
errors
array
Detailed errors list
429 - Too Many Requests
default - System problem or unexpected error
Detach tags
POST /v3/tags/detach
Detaches one or more tags from one or more resources.
Authorization
To call this method, you must be assigned one or more IAM access roles that include the following action.
This action applies only to user tags. Because service tags are managed by IBM services, IAM actions do not apply to them.
To detach a `user` tag on a resource you must have the permissions listed in the Granting users access to tag resources documentation.
To detach a `service` tag, you must be an authorized Service. If that is the case, then you can detach a `service` tag with your registered `prefix` from any resource in any account. The account ID must be set through the `account_id` query parameter.
To detach an `access` tag, you must be the resource administrator within the account.
global-search-tagging.tag.detach-user-tagglobal-search-tagging.tag.detach-access-tag
Auditing
Calling this method generates the following auditing event.
<serviceName>.tag.detach
Request
Parameters
resources
Required *
Resource[]
List of resources on which the tag or tags are detached.
Constraints:
- Min items: 1
- Max items: 100
tagName
string
The name of the tag to detach.
Constraints:
- Max length: 128
- Pattern:
/^[A-Za-z0-9:_ .-]+$|^[*]{1}$/
tagNames
string[]
An array of tag names to detach.
Constraints:
- Min items: 1
- Max items: 100
transactionId
string
An alphanumeric string that can be used to trace a request across services. If not specified, it automatically generated with the prefix "gst-".
Constraints:
- Min length: 1
- Max length: 150
- Pattern:
/.*/
impersonateUser
string
The user on whose behalf the detach operation must be performed (for administrators only).
Constraints:
- Pattern:
/^.*-.*$/
accountId
string
The ID of the billing account of the untagged resource. It is a required parameter if `tag_type` is set to `service`, otherwise it is inferred from the authorization IAM token.
Constraints:
- Pattern:
/^[a-zA-Z0-9.]+$|^[*]{1}$/
tagType
string
The type of the tag. Supported values are `user`, `service` and `access`. `service` and `access` are not supported for IMS resources.
Allowed values: user, service, access
Default: user
Response
200 - The array of tag detach operations results.
results
array
Array of results of an attach_tag or detach_tag request.
400 - Bad request
errors
array
Detailed errors list
401 - Unauthorized, wrong authorization token type, or IAM authorization token was not valid.
errors
array
Detailed errors list