IBM Cloud API Docs

Introduction

The resource controller is the next-generation IBM Cloud® platform provisioning layer that manages the lifecycle of IBM Cloud resources in a customer account. A resource is an instance of a service like Cloudant, a Cloud Foundry application, a virtual machine, a container, a software image, or a data set.

The resource controller provides APIs to help you manage the following elements of your resource lifecycle:

  • Catalog management
  • Provisioning (creating an instance)
  • Updating a resource instance
  • Binding (creating access credentials)
  • Resource keys
  • Unbinding (removing access credentials)
  • De-provisioning (deleting an instance)
  • Dashboard SSO

Resources are provisioned globally in an account scope. The resource controller supports both synchronous and asynchronous provisioning of resources.

Resources are created by the resource controller within resource groups. A resource group belongs to an account. All IBM Cloud resources must be provisioned within a resource group. If an account is suspended, the corresponding resource group is suspended as well, and all resources within the resource group are suspended.

Installing the Java SDK

Maven

<dependency>
	<groupId>com.ibm.cloud</groupId>
	<artifactId>resource-controller</artifactId>
	<version>{version}</version>
</dependency>

Gradle

'com.ibm.cloud:resource-controller:{version}'

Replace {version} in these examples with the release version.

View on GitHub

Installing the Go SDK

Go modules (recommended): Add the following import in your code, and then run go build or go mod tidy

import (
	"github.com/IBM/platform-services-go-sdk/resourcecontrollerv2"
)

Go get

go get -u github.com/IBM/platform-services-go-sdk/resourcecontrollerv2

View on GitHub

Installation

npm install @ibm-cloud/platform-services

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-node-sdk

Installation

pip install --upgrade "ibm-platform-services"

For more installation options, view this project in GitHub. https://github.com/IBM/platform-services-python-sdk

Resource instances

The resource controller can provision or create an instance. Provisioning reserves a resource on a service, and the reserved resource is a service instance. A resource instance can vary by service. Examples include a single database on a multi-tenant server, a dedicated cluster, or an account on a web application.

Resource bindings and keys

A resource binding is the representation of an association between an application and a resource (service) instance. Often, resource bindings contain the credentials (keys) that the application uses to communicate with the resource instance. Keys are credentials that are used to connect (bind) a service to another application.

After a credential is created for a service, it can be viewed at any time for users that require them. However, all users must have the correct level of access to see the details of a credential. For more information, see Viewing a credential.

Resource aliases

You can think of an alias as a symlink in computing terms. It represents an entity that points back to a resource instance for you to define different access controls on it. Similar to symlinks, you can also create multiple aliases to a single resource instance and manage each one separately.

For example, you can create an instance of a service and then reuse that instance in both London and Dallas by creating aliases in both regions. This enables you to bind keys (credentials) to applications that run in those regions and use the same logical instance.

API endpoint

https://resource-controller.cloud.ibm.com

API endpoint

https://resource-controller.cloud.ibm.com

API endpoint

https://resource-controller.cloud.ibm.com

API endpoint

https://resource-controller.cloud.ibm.com

API endpoint

https://resource-controller.cloud.ibm.com

Using the SDK

With the Java SDK, you can build a service client for the Resource Controller by implementing the ResourceController class within the com.ibm.cloud.platform_services.resource_controller.v2 package. To construct the client, you can set your options programmatically, or you can define external configuration properties to be used by your application.

The examples that are provided on this page demonstrate how to build a service client by using these two options. For more information and detailed examples, check out the IBM Cloud SDK Common project on GitHub.

With the Go SDK, you can build a service client for the Resource Controller by implementing the ResourceControllerV2 class within the resourcecontrollerv2 package. To construct the client, you can set your options programmatically, or you can define external configuration properties to be used by your application.

The examples that are provided on this page demonstrate how to build a service client by using these two options. For more information and detailed examples, check out the IBM Cloud SDK Common project on GitHub.

With the Node.js SDK, you can build a service client for the Resource Controller by implementing the ResourceControllerV2 class within the resource-controller/v2 module. To construct the client, you can set your options programmatically, or you can define external configuration properties to be used by your application.

The examples that are provided on this page demonstrate how to build a service client by using these two options. For more information and detailed examples, check out the IBM Cloud SDK Common project on GitHub.

With the Python SDK, you can build a service client for the Resource Controller by implementing the ResourceControllerV2 class within the ibm-platform-services module. To construct the client, you can set your options programmatically, or you can define external configuration properties to be used by your application.

The examples that are provided on this page demonstrate how to build a service client by using these two options. For more information and detailed examples, check out the IBM Cloud SDK Common project on GitHub.

Endpoint URLs

The Resource Controller API uses the following global endpoint URL for all regions. When you call the API, add the path for each method to form the complete API endpoint for your requests.

https://resource-controller.cloud.ibm.com

If you enabled service endpoints in your account, you can send API requests over the IBM Cloud private network at the following base endpoint URLs. For more information, see Enabling VRF and service endpoints.

  • Private endpoint URL for VPC infrastructure (only available in US regions): https://private.resource-controller.cloud.ibm.com
  • Private endpoint URLs for classic and non-US region VPC infrastructure:
    • Dallas: https://private.us-south.resource-controller.cloud.ibm.com
    • Washington DC: https://private.us-east.resource-controller.cloud.ibm.com

Example API request

curl -X {request_method} "https://resource-controller.cloud.ibm.com/{method_endpoint}"

Replace {request_method} and {method_endpoint} in this example with the values for your particular API call.

Authentication

To work with the API, you must use an IBM Cloud Identity and Access Management (IAM) access token. The token is used to determine the actions that a user or service ID has access to when they use the API.

Obtaining an IAM token for an authenticated user or service ID is described in the IAM Identity Services API documentation.

To use the API, add a valid IAM token to the HTTP Authorization request header, for example, -H 'Authorization: Bearer <TOKEN>'.

When you use the SDK, configure an IAM authenticator with the IAM API key. The authenticator automatically obtains the IAM access token for the API key and includes it with each request. You can construct an authenticator in either of two ways:

  • Programmatically by constructing an IAM authenticator instance and supplying your IAM API key
  • By defining the API key in external configuration properties and then using the SDK authenticator factory to construct an IAM authenticator that uses the configured IAM API key

In this example of using external configuration properties, an IAM authenticator instance is created with the configured API key, and then the service client is constructed with this authenticator instance and the configured service URL.

For more information, see the Authentication section of the IBM Cloud SDK Common documentation.

For more information, see IAM authentication with the SDK.

For more information, see IAM authentication with the SDK.

For more information, see IAM authentication with the SDK.

For more information, see IAM authentication with the SDK.

To retrieve your access token:

curl -X POST
https://iam.cloud.ibm.com/identity/token
  -H "Content-Type: application/x-www-form-urlencoded"
  -H "Accept: application/json"
  -d "grant_type=urn%3Aibm%3Aparams%3Aoauth%3Agrant-type%3Aapikey&apikey=<API_KEY>"

Replace <API_KEY> with your service credentials. Then, use the full IAM token value that is prefixed by the Bearer token type to authenticate your API requests.

To retrieve your instance ID:

ibmcloud resource service-instance <instance_name> --id

Replace <instance_name> with the unique alias that you assigned to your service instance.

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export RESOURCE_CONTROLLER_APIKEY=<API_KEY>

Example of constructing the service client

import com.ibm.cloud.platform_services.resource_controller.v2.ResourceController;
...
ResourceController resourceControllerService = ResourceController.newInstance();

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export RESOURCE_CONTROLLER_APIKEY=<API_KEY>

Example of constructing the service client

import {
    "github.com/IBM/platform-services-go-sdk/resourcecontrollerv2"
}
...
resourceControllerServiceOptions := &resourcecontrollerv2.ResourceControllerV2Options{}
resourceControllerService, err := resourcecontrollerv2.NewResourceControllerV2UsingExternalConfig(resourceControllerServiceOptions)

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export RESOURCE_CONTROLLER_APIKEY=<API_KEY>

Example of constructing the service client

from ibm_platform_services import ResourceControllerV2
...
resource_controller_service = ResourceControllerV2.new_instance()

Setting client options through external configuration

Example environment variables, where <API_KEY> is your IAM API key

export RESOURCE_CONTROLLER_APIKEY=<API_KEY>

Example of constructing the service client

const ResourceControllerV2 = require('ibm-platform-services/resource-controller/v2');
...
const resourceControllerService = ResourceControllerV2.newInstance({});

# Error handling {: #errors}

This API uses standard HTTP response codes to indicate whether a method completed successfully. A `200` response indicates success. A `400` type response indicates a failure, and a `500` type response indicates an internal system error.  

Additionally, each response includes a `Transaction-Id` header that can be referenced when you contact [IBM Cloud support](https://www.ibm.com/cloud/support).

| HTTP Error Code | Description           | Recovery |
|-----------------|-----------------------|----------|
| `200`           | Success               | The request was successful. |
| `400`           | Bad Request           | The input parameters in the request body are either incomplete or in the wrong format. Be sure to include all required parameters in your request. |
| `401`           | Unauthorized          | You are not authorized to make this request. Log in to IBM Cloud and try again. If this error persists, contact the account owner to check your permissions.	|
| `403`           | Forbidden             | The supplied authentication is not authorized to access '{namespace}'. |
| `404`           | Not Found             | The requested resource could not be found. |
| `409`           | Conflict              | The entity is already in the requested state. |
| `410`           | Gone                  | The resource is valid but was removed in a previous call. |
| `500`           | Internal Server Error | *Offering_name* is unavailable. Your request could not be processed. Wait a few minutes and try again. |

# Auditing {: #auditing}

You can monitor API activity within your account by using the IBM Cloud Activity Tracker service. When an API method is called, an event is generated that you can then track and audit from within Activity Tracker. For methods that generate these events, the specific event type is listed with each individual method. 

For more information about how to track Account and Billing activity, see [Auditing events for account management](/docs/activity-tracker?topic=activity-tracker-at_events_acc_mgt).

# Pagination {: #pagination}

Some API requests might return a large number of results. To avoid performance issues, these results are returned one page at a time, with a limited number of results on each page. GET requests for the following resources use pagination:

   * /v2/resource_instances
   * /v2/resource_bindings
   * /v2/resource_keys
   * /v2/resource_aliases

The default page and max size is 100 objects. To use a different page size, use the `limit` query parameter.

For any request that uses pagination, the response includes a `next_url` object that specifies pagination information. `next_url` is the URL for requesting the next page of results. The `next_url` property is null if there are no more results, and retains the same `limit` parameter that is used for the initial request.

# Rate limiting {: #rate-limiting}

Rate limits for API requests are enforced on a per-caller basis. If the number of requests for a particular method and endpoint reaches the request limit within the specified time window, no further requests are accepted until the timer expires. After the timer expires, a new time window begins with the next accepted request.

The response to each HTTP request includes headers you can use to determine whether you are close to the rate limit:

   * X-RateLimit-Reset: the time the current timer expires (in UNIX epoch time)
   * X-RateLimit-Remaining: the number of remaining requests in the current time window
   * X-RateLimit-Limit: the total number of requests allowed within the time window

An HTTP status code of 429 indicates that the rate limit was exceeded.

The number of allowed requests, and the length of the time window, vary by method and endpoint. The reference information for each endpoint specifies the rate limit that applies.


# Related APIs {: #related-apis}

When you work with the resource controller endpoints, it might be helpful to be aware of the IBM Cloud OSB APIs used to create your service broker.

* [IBM Cloud Open Service Broker](/apidocs/resource-controller/ibm-cloud-osb-api)
* [IBM Cloud Resource Manager](/apidocs/resource-controller/resource-manager)

Methods

Get a list of all resource instances

View a list of all available resource instances. Resources is a broad term that could mean anything from a service instance to a virtual machine associated with the customer account.

View a list of all available resource instances. Resources is a broad term that could mean anything from a service instance to a virtual machine associated with the customer account.

View a list of all available resource instances. Resources is a broad term that could mean anything from a service instance to a virtual machine associated with the customer account.

View a list of all available resource instances. Resources is a broad term that could mean anything from a service instance to a virtual machine associated with the customer account.

View a list of all available resource instances. Resources is a broad term that could mean anything from a service instance to a virtual machine associated with the customer account.

GET /v2/resource_instances
(resourceController *ResourceControllerV2) ListResourceInstances(listResourceInstancesOptions *ListResourceInstancesOptions) (result *ResourceInstancesList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceInstancesWithContext(ctx context.Context, listResourceInstancesOptions *ListResourceInstancesOptions) (result *ResourceInstancesList, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstancesList> listResourceInstances(ListResourceInstancesOptions listResourceInstancesOptions)
listResourceInstances(params)
list_resource_instances(
        self,
        *,
        guid: str = None,
        name: str = None,
        resource_group_id: str = None,
        resource_id: str = None,
        resource_plan_id: str = None,
        type: str = None,
        sub_type: str = None,
        limit: int = None,
        start: str = None,
        state: str = None,
        updated_from: str = None,
        updated_to: str = None,
        **kwargs,
    ) -> DetailedResponse

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • resource-controller.instance.retrieve

Request

Instantiate the ListResourceInstancesOptions struct and set the fields to provide parameter values for the ListResourceInstances method.

Use the ListResourceInstancesOptions.Builder to create a ListResourceInstancesOptions object that contains the parameter values for the listResourceInstances method.

Query Parameters

  • The GUID of the instance.

  • The human-readable name of the instance.

  • The ID of the resource group.

  • The unique ID of the offering. This value is provided by and stored in the global catalog.

  • The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.

  • The type of the instance, for example, service_instance.

  • The sub-type of instance, for example, kms.

  • Limit on how many items should be returned.

    Possible values: value ≤ 100

    Default: 100

  • An optional token that indicates the beginning of the page of results to be returned. Any additional query parameters are ignored if a page token is present. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the 'next_url' field of the operation response.

  • The state of the instance. If not specified, instances in state active and provisioning are returned.

    Allowable values: [active,inactive,failed,pending_reclamation,provisioning,pre_provisioning,removed]

  • Start date inclusive filter.

    Example: 2021-01-01

  • End date inclusive filter.

    Example: 2021-01-01

WithContext method only

The ListResourceInstances options.

The listResourceInstances options.

parameters

  • The GUID of the instance.

  • The human-readable name of the instance.

  • The ID of the resource group.

  • The unique ID of the offering. This value is provided by and stored in the global catalog.

  • The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.

  • The type of the instance, for example, service_instance.

  • The sub-type of instance, for example, kms.

  • Limit on how many items should be returned.

    Possible values: value ≤ 100

    Default: 100

  • An optional token that indicates the beginning of the page of results to be returned. Any additional query parameters are ignored if a page token is present. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the 'next_url' field of the operation response.

  • The state of the instance. If not specified, instances in state active and provisioning are returned.

    Allowable values: [active,inactive,failed,pending_reclamation,provisioning,pre_provisioning,removed]

  • Start date inclusive filter.

    Examples:
    value
    _source
    _lines
    _html
  • End date inclusive filter.

    Examples:
    value
    _source
    _lines
    _html

parameters

  • The GUID of the instance.

  • The human-readable name of the instance.

  • The ID of the resource group.

  • The unique ID of the offering. This value is provided by and stored in the global catalog.

  • The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.

  • The type of the instance, for example, service_instance.

  • The sub-type of instance, for example, kms.

  • Limit on how many items should be returned.

    Possible values: value ≤ 100

    Default: 100

  • An optional token that indicates the beginning of the page of results to be returned. Any additional query parameters are ignored if a page token is present. If omitted, the first page of results is returned. This value is obtained from the 'start' query parameter in the 'next_url' field of the operation response.

  • The state of the instance. If not specified, instances in state active and provisioning are returned.

    Allowable values: [active,inactive,failed,pending_reclamation,provisioning,pre_provisioning,removed]

  • Start date inclusive filter.

    Examples:
    value
    _source
    _lines
    _html
  • End date inclusive filter.

    Examples:
    value
    _source
    _lines
    _html
  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_instances   -H "Authorization: Bearer <IAM token>"
  • listResourceInstancesOptions := &resourcecontrollerv2.ListResourceInstancesOptions{
      Name: &resourceInstanceName,
    }
    
    pager, err := resourceControllerService.NewResourceInstancesPager(listResourceInstancesOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceInstance
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceInstancesOptions listResourceInstancesOptions = new ListResourceInstancesOptions.Builder()
      .name(resourceInstanceName)
      .build();
    
    ResourceInstancesPager pager =
        new ResourceInstancesPager(resourceControllerService, listResourceInstancesOptions);
    List<ResourceInstance> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceInstance> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      name: resourceInstanceName,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceInstancesPager(
        resourceControllerService, params);
      while (pager.hasNext()) {
        const nextPage = await pager.getNext();
        expect(nextPage).not.toBeNull();
        allResults.push(...nextPage);
      }
      console.log(JSON.stringify(allResults, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • all_results = []
    pager = ResourceInstancesPager(
      client=resource_controller_service,
      name=resource_instance_name,
    )
    while pager.has_next():
      next_page = pager.get_next()
      assert next_page is not None
      all_results.extend(next_page)
    
    print(json.dumps(all_results, indent=2))

Response

A list of resource instances.

A list of resource instances.

A list of resource instances.

A list of resource instances.

A list of resource instances.

Status Code

  • The list of resource instances was successfully retrieved.

  • Your access token is invalid or authentication of your token failed.

  • Your access token is valid but does not have the necessary permissions to access this resource.

  • Too many requests. Wait a few minutes and try again.

  • Your request could not be processed. Try again later. If the problem persists, note the transaction-id in the response header and contact IBM Cloud support.

Example responses
  • {
      "rows_count": 1,
      "next_url": "/v2/resource_instances?start=bmV4dF9kb2NpZD1nMUFBQUFGVGVKekxZV0JnWU1sZ1RtSFFTa2xLemk5S2RVaEpNdFZMeXRWTlR0Wk5TVTNKVEU0c1NVMHhNckRVUzg3SkwwMUp6Q3ZSeTBzdHlRSHFZVW9TQUpKSjh2X19fODhDODkyY1N0XzlxWGc5Z1NGeFJ4YXFlZWJFbWFjQU1rOGZ5Ynl5eE5Pdml6NHdKREV3YU5pUVoyUUF5TWg0WkNjLU43cTQ0UUxJU0QyMUxISjhuY2NDSkJrV0FDbWdxZXZoTGsxbTRGQUNHOXMtSnlzTEFONl9iU2cmbGltaXQ9NSZhY2NvdW50X2lkPTQzMjkwNzNkMTZkMmYzNjYzZjc0YmZhOTU1MjU5MTM5",
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "guid": "8d7af921-b136-4078-9666-081bd8470d94",
          "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "created_at": "2018-04-19T00:18:53.302077457Z",
          "updated_at": "2018-04-19T00:18:53.302077457Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "scheduled_reclaim_at": null,
          "restored_at": null,
          "scheduled_reclaim_by": "",
          "restored_by": "",
          "name": "my-instance",
          "region_id": "global",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
          "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "allow_cleanup": true,
          "state": "active",
          "type": "service_instance",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "dashboard_url": "/objectstorage/crn%3Av1%3Abluemix%3Apublic%3Acloud-object-storage%3Aglobal%3Aa%2F4329073d16d2f3663f74bfa955259139%3A8d7af921-b136-4078-9666-081bd8470d94%3A%3A",
          "last_operation": null,
          "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
          "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
          "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
          "plan_history": [
            {
              "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
              "start_date": "2018-04-19T00:18:53.302077457Z"
            }
          ],
          "migrated": false,
          "controlled_by": ""
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": "/v2/resource_instances?start=bmV4dF9kb2NpZD1nMUFBQUFGVGVKekxZV0JnWU1sZ1RtSFFTa2xLemk5S2RVaEpNdFZMeXRWTlR0Wk5TVTNKVEU0c1NVMHhNckRVUzg3SkwwMUp6Q3ZSeTBzdHlRSHFZVW9TQUpKSjh2X19fODhDODkyY1N0XzlxWGc5Z1NGeFJ4YXFlZWJFbWFjQU1rOGZ5Ynl5eE5Pdml6NHdKREV3YU5pUVoyUUF5TWg0WkNjLU43cTQ0UUxJU0QyMUxISjhuY2NDSkJrV0FDbWdxZXZoTGsxbTRGQUNHOXMtSnlzTEFONl9iU2cmbGltaXQ9NSZhY2NvdW50X2lkPTQzMjkwNzNkMTZkMmYzNjYzZjc0YmZhOTU1MjU5MTM5",
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "guid": "8d7af921-b136-4078-9666-081bd8470d94",
          "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "created_at": "2018-04-19T00:18:53.302077457Z",
          "updated_at": "2018-04-19T00:18:53.302077457Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "scheduled_reclaim_at": null,
          "restored_at": null,
          "scheduled_reclaim_by": "",
          "restored_by": "",
          "name": "my-instance",
          "region_id": "global",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
          "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "allow_cleanup": true,
          "state": "active",
          "type": "service_instance",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "dashboard_url": "/objectstorage/crn%3Av1%3Abluemix%3Apublic%3Acloud-object-storage%3Aglobal%3Aa%2F4329073d16d2f3663f74bfa955259139%3A8d7af921-b136-4078-9666-081bd8470d94%3A%3A",
          "last_operation": null,
          "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
          "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
          "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
          "plan_history": [
            {
              "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
              "start_date": "2018-04-19T00:18:53.302077457Z"
            }
          ],
          "migrated": false,
          "controlled_by": ""
        }
      ]
    }

Create (provision) a new resource instance

When you provision a service you get an instance of that service. An instance represents the resource with which you create, and additionally, represents a chargeable record of which billing can occur.

When you provision a service you get an instance of that service. An instance represents the resource with which you create, and additionally, represents a chargeable record of which billing can occur.

When you provision a service you get an instance of that service. An instance represents the resource with which you create, and additionally, represents a chargeable record of which billing can occur.

When you provision a service you get an instance of that service. An instance represents the resource with which you create, and additionally, represents a chargeable record of which billing can occur.

When you provision a service you get an instance of that service. An instance represents the resource with which you create, and additionally, represents a chargeable record of which billing can occur.

POST /v2/resource_instances
(resourceController *ResourceControllerV2) CreateResourceInstance(createResourceInstanceOptions *CreateResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) CreateResourceInstanceWithContext(ctx context.Context, createResourceInstanceOptions *CreateResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> createResourceInstance(CreateResourceInstanceOptions createResourceInstanceOptions)
createResourceInstance(params)
create_resource_instance(
        self,
        name: str,
        target: str,
        resource_group: str,
        resource_plan_id: str,
        *,
        tags: List[str] = None,
        allow_cleanup: bool = None,
        parameters: dict = None,
        entity_lock: bool = None,
        **kwargs,
    ) -> DetailedResponse

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • resource-controller.instance.create

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.create

Request

Instantiate the CreateResourceInstanceOptions struct and set the fields to provide parameter values for the CreateResourceInstance method.

Use the CreateResourceInstanceOptions.Builder to create a CreateResourceInstanceOptions object that contains the parameter values for the createResourceInstance method.

Custom Headers

  • Indicates if the resource instance is locked for further update or delete operations. It does not affect actions performed on child resources like aliases, bindings or keys. False by default.

    Default: false

Property values for the new resource instance.

Examples:
View

WithContext method only

The CreateResourceInstance options.

The createResourceInstance options.

parameters

  • The name of the instance. Must be 180 characters or less and cannot include any special characters other than (space) - . _ :.

    Possible values: Value must match regular expression /^([^[:ascii:]]|[a-zA-Z0-9-._: ])+$/

    Examples:
    value
    _source
    _lines
    _html
  • The deployment location where the instance should be hosted.

    Examples:
    value
    _source
    _lines
    _html
  • The ID of the resource group.

    Examples:
    value
    _source
    _lines
    _html
  • The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.

    Examples:
    value
    _source
    _lines
    _html
  • Tags that are attached to the instance after provisioning. These tags can be searched and managed through the Tagging API in IBM Cloud.

  • A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.

    Default: false

  • Configuration options represented as key-value pairs that are passed through to the target resource brokers.

  • Indicates if the resource instance is locked for further update or delete operations. It does not affect actions performed on child resources like aliases, bindings or keys. False by default.

    Default: false

parameters

  • The name of the instance. Must be 180 characters or less and cannot include any special characters other than (space) - . _ :.

    Possible values: Value must match regular expression /^([^[:ascii:]]|[a-zA-Z0-9-._: ])+$/

    Examples:
    value
    _source
    _lines
    _html
  • The deployment location where the instance should be hosted.

    Examples:
    value
    _source
    _lines
    _html
  • The ID of the resource group.

    Examples:
    value
    _source
    _lines
    _html
  • The unique ID of the plan associated with the offering. This value is provided by and stored in the global catalog.

    Examples:
    value
    _source
    _lines
    _html
  • Tags that are attached to the instance after provisioning. These tags can be searched and managed through the Tagging API in IBM Cloud.

  • A boolean that dictates if the resource instance should be deleted (cleaned up) during the processing of a region instance delete call.

    Default: false

  • Configuration options represented as key-value pairs that are passed through to the target resource brokers.

  • Indicates if the resource instance is locked for further update or delete operations. It does not affect actions performed on child resources like aliases, bindings or keys. False by default.

    Default: false

  • curl -X POST   https://resource-controller.cloud.ibm.com/v2/resource_instances   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance",
        "target": "us-south",
        "resource_group": "5c49eabc-f5e8-5881-a37e-2d100a33b3df",
        "resource_plan_id": "cloudant-standard",
        "tags": [
          "my-tag"
        ]
      }'
  • createResourceInstanceOptions := resourceControllerService.NewCreateResourceInstanceOptions(
      resourceInstanceName,
      targetRegion,
      resourceGroup,
      resourcePlanID,
    )
    
    resourceInstance, response, err := resourceControllerService.CreateResourceInstance(createResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
    
    b, _ := json.MarshalIndent(resourceInstance, "", "  ")
    fmt.Println(string(b))
  • CreateResourceInstanceOptions createResourceInstanceOptions = new CreateResourceInstanceOptions.Builder()
      .name(resourceInstanceName)
      .target(targetRegion)
      .resourceGroup(resourceGroup)
      .resourcePlanId(resourcePlanId)
      .build();
    
    Response<ResourceInstance> response = resourceControllerService.createResourceInstance(createResourceInstanceOptions).execute();
    ResourceInstance resourceInstance = response.getResult();
    
    System.out.println(resourceInstance);
  • const params = {
      name: resourceInstanceName,
      target: targetRegion,
      resourceGroup: resourceGroupGuid,
      resourcePlanId: resourcePlanId,
    };
    
    try {
      const res = await resourceControllerService.createResourceInstance(params)
      instanceGuid = res.result.guid;
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_instance = resource_controller_service.create_resource_instance(
      name=resource_instance_name,
      target=target_region,
      resource_group=resource_group,
      resource_plan_id=resource_plan_id
    ).get_result()
    
    print(json.dumps(resource_instance, indent=2))

Response

A resource instance.

A resource instance.

A resource instance.

A resource instance.

A resource instance.

Status Code

  • The resource instance was provisioned.

  • Request to provision a resource has been accepted by the broker, and provisioning is in progress. This triggers the platform to poll the service's broker for operation status. Users can call get_resource_instance to get the current state of the instance.

  • The request could not be understood due to malformed syntax.

  • Your access token is invalid or authentication of your token failed.

  • Your access token is valid but does not have the necessary permissions to access this resource.

  • The resource could not be found.

  • Too many requests. Wait a few minutes and try again.

  • Your request could not be processed. Try again later. If the problem persists, note the transaction-id in the response header and contact IBM Cloud support.

Example responses
  • {
      "id": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/d86af7367f70fba4f306d3c19c7344b2:b723751c-69c1-4e4b-a4dc-ccfccf6c20a0::",
      "guid": "8d7af921-b136-4078-9666-081bd8470d94",
      "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "created_at": "2018-04-19T00:18:53.302077457Z",
      "updated_at": "2018-04-19T00:18:53.302077457Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "us-south",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "cloudant-standard",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
      "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
      "crn": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/d86af7367f70fba4f306d3c19c7344b2:b723751c-69c1-4e4b-a4dc-ccfccf6c20a0::",
      "allow_cleanup": false,
      "state": "active",
      "type": "service_instance",
      "resource_id": "cloudant",
      "dashboard_url": "https://dashboard.cloudantnosqldb.cloud.ibm.com/rc/account/crn%3Av1%3Abluemix%3Apublic%3Acloudantnosqldb%3Aus-south%3Aa%2Fd86af7367f70fba4f306d3c19c7344b2%3Ab723751c-69c1-4e4b-a4dc-ccfccf6c20a0%3A%3A",
      "last_operation": null,
      "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
      "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
      "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
      "plan_history": [
        {
          "resource_plan_id": "cloudant-standard",
          "start_date": "2018-04-19T00:18:53.302077457Z"
        }
      ],
      "migrated": false,
      "controlled_by": ""
    }
  • {
      "id": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/d86af7367f70fba4f306d3c19c7344b2:b723751c-69c1-4e4b-a4dc-ccfccf6c20a0::",
      "guid": "8d7af921-b136-4078-9666-081bd8470d94",
      "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "created_at": "2018-04-19T00:18:53.302077457Z",
      "updated_at": "2018-04-19T00:18:53.302077457Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "us-south",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "cloudant-standard",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
      "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
      "crn": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/d86af7367f70fba4f306d3c19c7344b2:b723751c-69c1-4e4b-a4dc-ccfccf6c20a0::",
      "allow_cleanup": false,
      "state": "active",
      "type": "service_instance",
      "resource_id": "cloudant",
      "dashboard_url": "https://dashboard.cloudantnosqldb.cloud.ibm.com/rc/account/crn%3Av1%3Abluemix%3Apublic%3Acloudantnosqldb%3Aus-south%3Aa%2Fd86af7367f70fba4f306d3c19c7344b2%3Ab723751c-69c1-4e4b-a4dc-ccfccf6c20a0%3A%3A",
      "last_operation": null,
      "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
      "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
      "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
      "plan_history": [
        {
          "resource_plan_id": "cloudant-standard",
          "start_date": "2018-04-19T00:18:53.302077457Z"
        }
      ],
      "migrated": false,
      "controlled_by": ""
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "guid": "8d7af921-b136-4078-9666-081bd8470d94",
      "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "created_at": "2018-04-19T00:18:53.302077457Z",
      "updated_at": "2018-04-19T00:18:53.302077457Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "global",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
      "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "allow_cleanup": false,
      "state": "provisioning",
      "type": "service_instance",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "dashboard_url": "/objectstorage/crn%3Av1%3Abluemix%3Apublic%3Acloud-object-storage%3Aglobal%3Aa%2F4329073d16d2f3663f74bfa955259139%3A8d7af921-b136-4078-9666-081bd8470d94%3A%3A",
      "last_operation": {
        "type": "create",
        "state": "in progress",
        "async": true,
        "description": "Started create instance operation",
        "cancelable": false,
        "poll": true
      },
      "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
      "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
      "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
      "plan_history": [
        {
          "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
          "start_date": "2018-04-19T00:18:53.302077457Z"
        }
      ],
      "migrated": false,
      "controlled_by": ""
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "guid": "8d7af921-b136-4078-9666-081bd8470d94",
      "url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "created_at": "2018-04-19T00:18:53.302077457Z",
      "updated_at": "2018-04-19T00:18:53.302077457Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "global",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_group_crn": "crn:v1:bluemix:public:resource-controller::a/4329073d16d2f3663f74bfa955259139::resource-group:0be5ad401ae913d8ff665d92680664ed",
      "target_crn": "crn:v1:bluemix:public:resource-catalog::a/9e16d1fed8aa7e1bd73e7a9d23434a5a::deployment:2fdf0c08-2d32-4f46-84b5-32e0c92fffd8%3Aglobal",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "allow_cleanup": false,
      "state": "provisioning",
      "type": "service_instance",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "dashboard_url": "/objectstorage/crn%3Av1%3Abluemix%3Apublic%3Acloud-object-storage%3Aglobal%3Aa%2F4329073d16d2f3663f74bfa955259139%3A8d7af921-b136-4078-9666-081bd8470d94%3A%3A",
      "last_operation": {
        "type": "create",
        "state": "in progress",
        "async": true,
        "description": "Started create instance operation",
        "cancelable": false,
        "poll": true
      },
      "resource_aliases_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases",
      "resource_bindings_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_bindings",
      "resource_keys_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys",
      "plan_history": [
        {
          "resource_plan_id": "2fdf0c08-2d32-4f46-84b5-32e0c92fffd8",
          "start_date": "2018-04-19T00:18:53.302077457Z"
        }
      ],
      "migrated": false,
      "controlled_by": ""
    }

Get a resource instance

Retrieve a resource instance by URL-encoded CRN or GUID. Find more details on a particular instance, like when it was provisioned and who provisioned it.

Retrieve a resource instance by URL-encoded CRN or GUID. Find more details on a particular instance, like when it was provisioned and who provisioned it.

Retrieve a resource instance by URL-encoded CRN or GUID. Find more details on a particular instance, like when it was provisioned and who provisioned it.

Retrieve a resource instance by URL-encoded CRN or GUID. Find more details on a particular instance, like when it was provisioned and who provisioned it.

Retrieve a resource instance by URL-encoded CRN or GUID. Find more details on a particular instance, like when it was provisioned and who provisioned it.

GET /v2/resource_instances/{id}
(resourceController *ResourceControllerV2) GetResourceInstance(getResourceInstanceOptions *GetResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) GetResourceInstanceWithContext(ctx context.Context, getResourceInstanceOptions *GetResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> getResourceInstance(GetResourceInstanceOptions getResourceInstanceOptions)
getResourceInstance(params)
get_resource_instance(
        self,
        id: str,
        **kwargs,
    ) -> DetailedResponse

Authorization

To call this method, you must be assigned one or more IAM access roles that include the following action. You can check your access by going to Users > User > Access.

  • resource-controller.instance.retrieve

Request

Instantiate the GetResourceInstanceOptions struct and set the fields to provide parameter values for the GetResourceInstance method.

Use the GetResourceInstanceOptions.Builder to create a GetResourceInstanceOptions object that contains the parameter values for the getResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

WithContext method only

The GetResourceInstance options.

The getResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94   -H "Authorization: Bearer <IAM token>" \
  • getResourceInstanceOptions := resourceControllerService.NewGetResourceInstanceOptions(
      instanceGUID,
    )
    
    resourceInstance, response, err := resourceControllerService.GetResourceInstance(getResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceInstance, "", "  ")
    fmt.Println(string(b))
  • GetResourceInstanceOptions getResourceInstanceOptions = new GetResourceInstanceOptions.Builder()
      .id(instanceGuid)
      .build();
    
    Response<ResourceInstance> response = resourceControllerService.getResourceInstance(getResourceInstanceOptions).execute();
    ResourceInstance resourceInstance = response.getResult();
    
    System.out.println(resourceInstance);
  • const params = {
      id: instanceGuid,
    };
    
    try {
      const res = await resourceControllerService.getResourceInstance(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_instance = resource_controller_service.get_resource_instance(
      id=instance_guid
    ).get_result()
    
    print(json.dumps(resource_instance, indent=2))

Response

A resource instance.

A resource instance.

A resource instance.

A resource instance.