Class 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.
      • Fields inherited from class com.ibm.cloud.sdk.core.service.BaseService

        PROPNAME_DISABLE_SSL, PROPNAME_ENABLE_GZIP, PROPNAME_ENABLE_RETRIES, PROPNAME_MAX_RETRIES, PROPNAME_RETRY_INTERVAL, PROPNAME_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.
    • 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 instance
        authenticator - the Authenticator 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 - the ListTagsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type TagList
      • 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 type TagList
      • 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 - the CreateTagOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type CreateTagResults
      • 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 - the DeleteTagAllOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type DeleteTagsResult
      • 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 type DeleteTagsResult
      • 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 - the DeleteTagOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type DeleteTagResults
      • 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 - the AttachTagOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type TagResults
      • 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 type TagResults
      • 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 - the DetachTagOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type TagResults
      • 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 type TagResults