Class GlobalTagging
- java.lang.Object
-
- com.ibm.cloud.sdk.core.service.BaseService
-
- com.ibm.cloud.platform_services.global_tagging.v1.GlobalTagging
-
public class GlobalTagging extends com.ibm.cloud.sdk.core.service.BaseService
Manage your tags with the Tagging API in IBM Cloud. You can attach, detach, delete, or list all of the tags in your billing account with the Tagging API. The tag name must be unique within a billing account. You can create tags in two formats: `key:value` or `label`. The tagging API supports three types of tag: `user` `service`, and `access` tags. `service` tags cannot be attached to IMS resources. `service` tags must be in the form `service_prefix:tag_label` where `service_prefix` identifies the Service owning the tag. `access` tags cannot be attached to IMS resources. They must be in the form `key:value`. You can replace all resource's tags using the `replace` query parameter in the attach operation. You can update the `value` of a resource's tag in the format `key:value`, using the `update` query parameter in the attach operation. API Version: 1.2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEFAULT_SERVICE_NAME
Default service name used when configuring the `GlobalTagging` client.static java.lang.String
DEFAULT_SERVICE_URL
Default service endpoint URL.
-
Constructor Summary
Constructors Constructor Description GlobalTagging(java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `GlobalTagging` client.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.ibm.cloud.sdk.core.http.ServiceCall<TagResults>
attachTag()
Attach tags.com.ibm.cloud.sdk.core.http.ServiceCall<TagResults>
attachTag(AttachTagOptions attachTagOptions)
Attach tags.com.ibm.cloud.sdk.core.http.ServiceCall<CreateTagResults>
createTag(CreateTagOptions createTagOptions)
Create an access management tag.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagResults>
deleteTag(DeleteTagOptions deleteTagOptions)
Delete an unused tag.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagsResult>
deleteTagAll()
Delete all unused tags.com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagsResult>
deleteTagAll(DeleteTagAllOptions deleteTagAllOptions)
Delete all unused tags.com.ibm.cloud.sdk.core.http.ServiceCall<TagResults>
detachTag()
Detach tags.com.ibm.cloud.sdk.core.http.ServiceCall<TagResults>
detachTag(DetachTagOptions detachTagOptions)
Detach tags.com.ibm.cloud.sdk.core.http.ServiceCall<TagList>
listTags()
Get all tags.com.ibm.cloud.sdk.core.http.ServiceCall<TagList>
listTags(ListTagsOptions listTagsOptions)
Get all tags.static GlobalTagging
newInstance()
Class method which constructs an instance of the `GlobalTagging` client.static GlobalTagging
newInstance(java.lang.String serviceName)
Class method which constructs an instance of the `GlobalTagging` client.-
Methods inherited from class com.ibm.cloud.sdk.core.service.BaseService
configureClient, configureService, constructServiceUrl, constructServiceURL, disableRetries, enableGzipCompression, enableRetries, getAuthenticator, getClient, getDefaultHeaders, getEndPoint, getName, getServiceUrl, isJsonMimeType, isJsonPatchMimeType, setClient, setDefaultHeaders, setEndPoint, setServiceUrl, toString
-
-
-
-
Field Detail
-
DEFAULT_SERVICE_NAME
public static final java.lang.String DEFAULT_SERVICE_NAME
Default service name used when configuring the `GlobalTagging` client.- See Also:
- Constant Field Values
-
DEFAULT_SERVICE_URL
public static final java.lang.String DEFAULT_SERVICE_URL
Default service endpoint URL.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlobalTagging
public GlobalTagging(java.lang.String serviceName, com.ibm.cloud.sdk.core.security.Authenticator authenticator)
Constructs an instance of the `GlobalTagging` client. The specified service name and authenticator are used to configure the client instance.- Parameters:
serviceName
- the service name to be used when configuring the client instanceauthenticator
- theAuthenticator
instance to be configured for this client
-
-
Method Detail
-
newInstance
public static GlobalTagging newInstance()
Class method which constructs an instance of the `GlobalTagging` client. The default service name is used to configure the client instance.- Returns:
- an instance of the `GlobalTagging` client using external configuration
-
newInstance
public static GlobalTagging newInstance(java.lang.String serviceName)
Class method which constructs an instance of the `GlobalTagging` client. The specified service name is used to configure the client instance.- Parameters:
serviceName
- the service name to be used when configuring the client instance- Returns:
- an instance of the `GlobalTagging` client using external configuration
-
listTags
public com.ibm.cloud.sdk.core.http.ServiceCall<TagList> listTags(ListTagsOptions listTagsOptions)
Get all tags. Lists all tags that are in a billing account. Use the `attached_to` parameter to return the list of tags that are attached to the specified resource.- Parameters:
listTagsOptions
- theListTagsOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeTagList
-
listTags
public com.ibm.cloud.sdk.core.http.ServiceCall<TagList> listTags()
Get all tags. Lists all tags that are in a billing account. Use the `attached_to` parameter to return the list of tags that are attached to the specified resource.- Returns:
- a
ServiceCall
with a result of typeTagList
-
createTag
public com.ibm.cloud.sdk.core.http.ServiceCall<CreateTagResults> createTag(CreateTagOptions createTagOptions)
Create an access management tag. Create an access management tag. To create an `access` tag, you must have the access listed in the [Granting users access to tag resources](https://cloud.ibm.com/docs/account?topic=account-access) documentation. `service` and `user` tags cannot be created upfront. They are created when they are attached for the first time to a resource.- Parameters:
createTagOptions
- theCreateTagOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeCreateTagResults
-
deleteTagAll
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagsResult> deleteTagAll(DeleteTagAllOptions deleteTagAllOptions)
Delete all unused tags. Delete the tags that are not attached to any resource.- Parameters:
deleteTagAllOptions
- theDeleteTagAllOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteTagsResult
-
deleteTagAll
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagsResult> deleteTagAll()
Delete all unused tags. Delete the tags that are not attached to any resource.- Returns:
- a
ServiceCall
with a result of typeDeleteTagsResult
-
deleteTag
public com.ibm.cloud.sdk.core.http.ServiceCall<DeleteTagResults> deleteTag(DeleteTagOptions deleteTagOptions)
Delete an unused tag. Delete an existing tag. A tag can be deleted only if it is not attached to any resource.- Parameters:
deleteTagOptions
- theDeleteTagOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeDeleteTagResults
-
attachTag
public com.ibm.cloud.sdk.core.http.ServiceCall<TagResults> attachTag(AttachTagOptions attachTagOptions)
Attach tags. 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).- Parameters:
attachTagOptions
- theAttachTagOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeTagResults
-
attachTag
public com.ibm.cloud.sdk.core.http.ServiceCall<TagResults> attachTag()
Attach tags. 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).- Returns:
- a
ServiceCall
with a result of typeTagResults
-
detachTag
public com.ibm.cloud.sdk.core.http.ServiceCall<TagResults> detachTag(DetachTagOptions detachTagOptions)
Detach tags. Detaches one or more tags from one or more resources.- Parameters:
detachTagOptions
- theDetachTagOptions
containing the options for the call- Returns:
- a
ServiceCall
with a result of typeTagResults
-
detachTag
public com.ibm.cloud.sdk.core.http.ServiceCall<TagResults> detachTag()
Detach tags. Detaches one or more tags from one or more resources.- Returns:
- a
ServiceCall
with a result of typeTagResults
-
-