Class ResourceManager


  • public class ResourceManager
    extends com.ibm.cloud.sdk.core.service.BaseService
    Manage lifecycle of your Cloud resource groups using Resource Manager APIs. API Version: 2.0
    • Field Detail

      • DEFAULT_SERVICE_NAME

        public static final java.lang.String DEFAULT_SERVICE_NAME
        See Also:
        Constant Field Values
      • DEFAULT_SERVICE_URL

        public static final java.lang.String DEFAULT_SERVICE_URL
        See Also:
        Constant Field Values
    • Constructor Detail

      • ResourceManager

        public ResourceManager​(java.lang.String serviceName,
                               com.ibm.cloud.sdk.core.security.Authenticator authenticator)
        Constructs an instance of the `ResourceManager` 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 ResourceManager newInstance()
        Class method which constructs an instance of the `ResourceManager` client. The default service name is used to configure the client instance.
        Returns:
        an instance of the `ResourceManager` client using external configuration
      • newInstance

        public static ResourceManager newInstance​(java.lang.String serviceName)
        Class method which constructs an instance of the `ResourceManager` 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 `ResourceManager` client using external configuration
      • listResourceGroups

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResourceGroupList> listResourceGroups​(ListResourceGroupsOptions listResourceGroupsOptions)
        Get a list of all resource groups. Call this method to retrieve information about all resource groups and associated quotas in an account. The `id` returned in the response can be used to [create a resource instance later](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#create-resource-instance). The response can be filtered based on queryParams such as `account_id`, `name`, `default`, and more to narrow your search.Users need to be assigned IAM policies with the Viewer role or higher on the targeted resource groups.
        Parameters:
        listResourceGroupsOptions - the ListResourceGroupsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type ResourceGroupList
      • listResourceGroups

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResourceGroupList> listResourceGroups()
        Get a list of all resource groups. Call this method to retrieve information about all resource groups and associated quotas in an account. The `id` returned in the response can be used to [create a resource instance later](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#create-resource-instance). The response can be filtered based on queryParams such as `account_id`, `name`, `default`, and more to narrow your search.Users need to be assigned IAM policies with the Viewer role or higher on the targeted resource groups.
        Returns:
        a ServiceCall with a result of type ResourceGroupList
      • createResourceGroup

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResCreateResourceGroup> createResourceGroup​(CreateResourceGroupOptions createResourceGroupOptions)
        Create a resource group. Create a resource group in an account to organize your account resources in customizable groupings so that you can quickly assign users access to more than one resource at a time. To learn what makes a good resource group strategy, see [Best practices for organizing resources](https://cloud.ibm.com/docs/account?topic=account-account_setup). A default resource group is created when an account is created. If you have a Lite account or 30-day trial, you cannot create extra resource groups, but you can rename your default resource group. If you have a Pay-As-You-Go or Subscription account, you can create multiple resource groups. You must be assigned an IAM policy with the Administrator role on All Account Management services to create extra resource groups.
        Parameters:
        createResourceGroupOptions - the CreateResourceGroupOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type ResCreateResourceGroup
      • createResourceGroup

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResCreateResourceGroup> createResourceGroup()
        Create a resource group. Create a resource group in an account to organize your account resources in customizable groupings so that you can quickly assign users access to more than one resource at a time. To learn what makes a good resource group strategy, see [Best practices for organizing resources](https://cloud.ibm.com/docs/account?topic=account-account_setup). A default resource group is created when an account is created. If you have a Lite account or 30-day trial, you cannot create extra resource groups, but you can rename your default resource group. If you have a Pay-As-You-Go or Subscription account, you can create multiple resource groups. You must be assigned an IAM policy with the Administrator role on All Account Management services to create extra resource groups.
        Returns:
        a ServiceCall with a result of type ResCreateResourceGroup
      • getResourceGroup

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResourceGroup> getResourceGroup​(GetResourceGroupOptions getResourceGroupOptions)
        Get a resource group. Retrieve a resource group by alias ID. Call this method to get details about a particular resource group, like the name of the resource group, associated quotas, whether the state is active, the resource group ID and the CRN. The `id` returned in the response can be used to [create a resource instance later](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#create-resource-instance). Users need to be assigned an IAM policy with the Viewer role or higher on the targeted resource group.
        Parameters:
        getResourceGroupOptions - the GetResourceGroupOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type ResourceGroup
      • updateResourceGroup

        public com.ibm.cloud.sdk.core.http.ServiceCall<ResourceGroup> updateResourceGroup​(UpdateResourceGroupOptions updateResourceGroupOptions)
        Update a resource group. Update a resource group by the alias ID. Call this method to update information about an existing resource group. You can rename a resource group and activate or suspend a particular resource group. To update a resource group, users need to be assigned with IAM policies with the Editor role or higher.
        Parameters:
        updateResourceGroupOptions - the UpdateResourceGroupOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type ResourceGroup
      • deleteResourceGroup

        public com.ibm.cloud.sdk.core.http.ServiceCall<java.lang.Void> deleteResourceGroup​(DeleteResourceGroupOptions deleteResourceGroupOptions)
        Delete a resource group. Delete a resource group by the alias ID. You can delete a resource group only if the targeted resource group does not contain any resources or if it is not a default resource group. When a user creates an account, a default resource group is created in the account. If you want to delete a resource group that contains resources, first [delete the resource instances](https://cloud.ibm.com/apidocs/resource-controller/resource-controller?code=java#delete-resource-instance). Then, delete the resource group when all resource instances in the group are deleted. Users need to be assigned an IAM policy with the Editor role or higher on the targeted resource group.
        Parameters:
        deleteResourceGroupOptions - the DeleteResourceGroupOptions containing the options for the call
        Returns:
        a ServiceCall with a void result
      • listQuotaDefinitions

        public com.ibm.cloud.sdk.core.http.ServiceCall<QuotaDefinitionList> listQuotaDefinitions​(ListQuotaDefinitionsOptions listQuotaDefinitionsOptions)
        List quota definitions. Get a list of all quota definitions. Quotas for a resource group limit the number of apps, instances, and memory allowed for that specific resource group. Each resource group that you have on your account has a specific set of quotas. Standard quotas are for resource groups that are created by users with a Lite account, and Pay-As-You-Go quotas are for resource groups that are created with a Pay-As-You-Go account. This method provides list of all available quota definitions. No specific IAM policy needed.
        Parameters:
        listQuotaDefinitionsOptions - the ListQuotaDefinitionsOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type QuotaDefinitionList
      • listQuotaDefinitions

        public com.ibm.cloud.sdk.core.http.ServiceCall<QuotaDefinitionList> listQuotaDefinitions()
        List quota definitions. Get a list of all quota definitions. Quotas for a resource group limit the number of apps, instances, and memory allowed for that specific resource group. Each resource group that you have on your account has a specific set of quotas. Standard quotas are for resource groups that are created by users with a Lite account, and Pay-As-You-Go quotas are for resource groups that are created with a Pay-As-You-Go account. This method provides list of all available quota definitions. No specific IAM policy needed.
        Returns:
        a ServiceCall with a result of type QuotaDefinitionList
      • getQuotaDefinition

        public com.ibm.cloud.sdk.core.http.ServiceCall<QuotaDefinition> getQuotaDefinition​(GetQuotaDefinitionOptions getQuotaDefinitionOptions)
        Get a quota definition. Call this method to retrieve information about a particular quota by passing the quota ID. The response can be used to identify the quota type, Standard or Paid. Information about available resources, such as number of apps, number of service instances, and memory, are returned in the response. Quotas for a resource group limit the number of apps, instances, and memory allowed for that specific resource group. Each resource group that you have on your account has a specific set of quotas. Standard quotas are for resource groups that are created by users with a Lite account, and Pay-As-You-Go quotas are for resource groups that are created with a Pay-As-You-Go account. No specific IAM policy needed.
        Parameters:
        getQuotaDefinitionOptions - the GetQuotaDefinitionOptions containing the options for the call
        Returns:
        a ServiceCall with a result of type QuotaDefinition