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.BaseServiceManage 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 and Cloud Foundry resources. They must be in the form `key:value`. API Version: 1.2.0
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringDEFAULT_SERVICE_NAMEDefault service name used when configuring the `GlobalTagging` client.static java.lang.StringDEFAULT_SERVICE_URLDefault 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(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(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 GlobalTaggingnewInstance()Class method which constructs an instance of the `GlobalTagging` client.static GlobalTaggingnewInstance(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- theAuthenticatorinstance 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- theListTagsOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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
ServiceCallwith 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- theCreateTagOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theDeleteTagAllOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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
ServiceCallwith 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- theDeleteTagOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theAttachTagOptionscontaining the options for the call- Returns:
- a
ServiceCallwith 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- theDetachTagOptionscontaining the options for the call- Returns:
- a
ServiceCallwith a result of typeTagResults
-
-