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: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        resource_id: Optional[str] = None,
        resource_plan_id: Optional[str] = None,
        type: Optional[str] = None,
        sub_type: Optional[str] = None,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        state: Optional[str] = None,
        updated_from: Optional[str] = None,
        updated_to: Optional[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:
  • End date inclusive filter.

    Examples:

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:
  • End date inclusive filter.

    Examples:
  • 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: Optional[List[str]] = None,
        allow_cleanup: Optional[bool] = None,
        parameters: Optional[dict] = None,
        entity_lock: Optional[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:
{
  "name": "ExampleResourceInstance",
  "resource_group": "13aa3ee48c3b44ddb64c05c79f7ab8ef",
  "resource_plan_id": "a10e4960-3685-11e9-b210-d663bd873d93",
  "target": "global"
}

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:
  • The deployment location where the instance should be hosted.

    Examples:
  • The ID of the resource group.

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

    Examples:
  • 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. Set the onetime_credentials property to specify whether newly created resource key credentials can be retrieved by using get resource key or get a list of all of the resource keys requests.

  • 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:
  • The deployment location where the instance should be hosted.

    Examples:
  • The ID of the resource group.

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

    Examples:
  • 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. Set the onetime_credentials property to specify whether newly created resource key credentials can be retrieved by using get resource key or get a list of all of the resource keys requests.

  • 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": ""
    }

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.

A resource instance.

Status Code

  • The resource instance 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.

  • 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: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": "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": ""
    }
  • {
      "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": "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": ""
    }

Delete a resource instance

Delete a resource instance by URL-encoded CRN or GUID. If the resource instance has any resource keys or aliases associated with it, use the recursive=true parameter to delete it.

Delete a resource instance by URL-encoded CRN or GUID. If the resource instance has any resource keys or aliases associated with it, use the recursive=true parameter to delete it.

Delete a resource instance by URL-encoded CRN or GUID. If the resource instance has any resource keys or aliases associated with it, use the recursive=true parameter to delete it.

Delete a resource instance by URL-encoded CRN or GUID. If the resource instance has any resource keys or aliases associated with it, use the recursive=true parameter to delete it.

Delete a resource instance by URL-encoded CRN or GUID. If the resource instance has any resource keys or aliases associated with it, use the recursive=true parameter to delete it.

DELETE /v2/resource_instances/{id}
(resourceController *ResourceControllerV2) DeleteResourceInstance(deleteResourceInstanceOptions *DeleteResourceInstanceOptions) (response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) DeleteResourceInstanceWithContext(ctx context.Context, deleteResourceInstanceOptions *DeleteResourceInstanceOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteResourceInstance(DeleteResourceInstanceOptions deleteResourceInstanceOptions)
deleteResourceInstance(params)
delete_resource_instance(
        self,
        id: str,
        *,
        recursive: Optional[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.delete

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.delete

Request

Instantiate the DeleteResourceInstanceOptions struct and set the fields to provide parameter values for the DeleteResourceInstance method.

Use the DeleteResourceInstanceOptions.Builder to create a DeleteResourceInstanceOptions object that contains the parameter values for the deleteResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

Query Parameters

  • Will delete resource bindings, keys and aliases associated with the instance.

    Default: false

WithContext method only

The DeleteResourceInstance options.

The deleteResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • Will delete resource bindings, keys and aliases associated with the instance.

    Default: false

parameters

  • The resource instance URL-encoded CRN or GUID.

  • Will delete resource bindings, keys and aliases associated with the instance.

    Default: false

  • curl -X DELETE   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94   -H "Authorization: Bearer <IAM token>"
  • deleteResourceInstanceOptions := resourceControllerService.NewDeleteResourceInstanceOptions(
      instanceGUID,
    )
    deleteResourceInstanceOptions.SetRecursive(false)
    
    response, err := resourceControllerService.DeleteResourceInstance(deleteResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
  • DeleteResourceInstanceOptions deleteResourceInstanceOptions = new DeleteResourceInstanceOptions.Builder()
      .id(instanceGuid)
      .recursive(false)
      .build();
    
    Response<Void> response = resourceControllerService.deleteResourceInstance(deleteResourceInstanceOptions).execute();
  • const params = {
      id: instanceGuid,
      recursive: false,
    };
    
    try {
      await resourceControllerService.deleteResourceInstance(params);
    } catch (err) {
      console.warn(err);
    }
  • response = resource_controller_service.delete_resource_instance(
      id=instance_guid,
      recursive=False
    )

Response

Status Code

  • Request to delete a resource has been accepted by the broker, and deletion 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.

  • Deleted

  • 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.

  • The resource could was previously deleted and is no longer available.

  • 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.

No Sample Response

This method does not specify any sample responses.

Update a resource instance

Use the resource instance URL-encoded CRN or GUID to make updates to the resource instance, like changing the name or plan.

Use the resource instance URL-encoded CRN or GUID to make updates to the resource instance, like changing the name or plan.

Use the resource instance URL-encoded CRN or GUID to make updates to the resource instance, like changing the name or plan.

Use the resource instance URL-encoded CRN or GUID to make updates to the resource instance, like changing the name or plan.

Use the resource instance URL-encoded CRN or GUID to make updates to the resource instance, like changing the name or plan.

PATCH /v2/resource_instances/{id}
(resourceController *ResourceControllerV2) UpdateResourceInstance(updateResourceInstanceOptions *UpdateResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) UpdateResourceInstanceWithContext(ctx context.Context, updateResourceInstanceOptions *UpdateResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> updateResourceInstance(UpdateResourceInstanceOptions updateResourceInstanceOptions)
updateResourceInstance(params)
update_resource_instance(
        self,
        id: str,
        *,
        name: Optional[str] = None,
        parameters: Optional[dict] = None,
        resource_plan_id: Optional[str] = None,
        allow_cleanup: Optional[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.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.update

Request

Instantiate the UpdateResourceInstanceOptions struct and set the fields to provide parameter values for the UpdateResourceInstance method.

Use the UpdateResourceInstanceOptions.Builder to create a UpdateResourceInstanceOptions object that contains the parameter values for the updateResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

Updated property values for a resource instance.

Examples:
{
  "name": "UpdatedExampleResourceInstance",
  "parameters": {
    "exampleProperty": "exampleValue"
  }
}

WithContext method only

The UpdateResourceInstance options.

The updateResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • The new 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:
  • The new configuration options for the instance. Set the onetime_credentials property to specify whether newly created resource key credentials can be retrieved by using get resource key or get a list of all of the resource keys requests.

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

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

parameters

  • The resource instance URL-encoded CRN or GUID.

  • The new 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:
  • The new configuration options for the instance. Set the onetime_credentials property to specify whether newly created resource key credentials can be retrieved by using get resource key or get a list of all of the resource keys requests.

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

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

  • curl -X PATCH   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance-new-binding-1",
        "resource_plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d"
      }'
  • parameters := map[string]interface{}{"exampleProperty": "exampleValue"}
    updateResourceInstanceOptions := resourceControllerService.NewUpdateResourceInstanceOptions(
      instanceGUID,
    )
    updateResourceInstanceOptions = updateResourceInstanceOptions.SetName(resourceInstanceUpdateName)
    updateResourceInstanceOptions = updateResourceInstanceOptions.SetParameters(parameters)
    
    resourceInstance, response, err := resourceControllerService.UpdateResourceInstance(updateResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceInstance, "", "  ")
    fmt.Println(string(b))
  • Map<String, Object> parameters = new HashMap<String, Object>();
    parameters.put("exampleProperty", "exampleValue");
    
    UpdateResourceInstanceOptions updateResourceInstanceOptions = new UpdateResourceInstanceOptions.Builder()
      .id(instanceGuid)
      .name(resourceInstanceUpdateName)
      .parameters(parameters)
      .build();
    
    Response<ResourceInstance> response = resourceControllerService.updateResourceInstance(updateResourceInstanceOptions).execute();
    ResourceInstance resourceInstance = response.getResult();
    
    System.out.println(resourceInstance);
  • const parameters = {
      'exampleParameter': 'exampleValue',
    };
    
    const params = {
      id: instanceGuid,
      name: resourceInstanceUpdateName,
      parameters: parameters,
    };
    
    try {
      const res = await resourceControllerService.updateResourceInstance(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • parameters = {
      'exampleProperty': 'exampleValue'
    }
    resource_instance = resource_controller_service.update_resource_instance(
      id=instance_guid,
      name=resource_instance_update_name,
      parameters=parameters
    ).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 requested changes have been applied

  • Request to update a resource has been accepted by the broker, and update 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.

  • The request could not be processed.

  • 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: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": "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": ""
    }
  • {
      "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": "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": ""
    }

Get a list of all resource aliases for the instance.

Retrieving a list of all resource aliases can help you find out who's using the resource instance.

Retrieving a list of all resource aliases can help you find out who's using the resource instance.

Retrieving a list of all resource aliases can help you find out who's using the resource instance.

Retrieving a list of all resource aliases can help you find out who's using the resource instance.

Retrieving a list of all resource aliases can help you find out who's using the resource instance.

GET /v2/resource_instances/{id}/resource_aliases
(resourceController *ResourceControllerV2) ListResourceAliasesForInstance(listResourceAliasesForInstanceOptions *ListResourceAliasesForInstanceOptions) (result *ResourceAliasesList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceAliasesForInstanceWithContext(ctx context.Context, listResourceAliasesForInstanceOptions *ListResourceAliasesForInstanceOptions) (result *ResourceAliasesList, response *core.DetailedResponse, err error)
ServiceCall<ResourceAliasesList> listResourceAliasesForInstance(ListResourceAliasesForInstanceOptions listResourceAliasesForInstanceOptions)
listResourceAliasesForInstance(params)
list_resource_aliases_for_instance(
        self,
        id: str,
        *,
        limit: Optional[int] = None,
        start: Optional[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.alias.retrieve

Auditing

Calling this method generates the following auditing event.

  • resource-controller.alias.retrieve

Request

Instantiate the ListResourceAliasesForInstanceOptions struct and set the fields to provide parameter values for the ListResourceAliasesForInstance method.

Use the ListResourceAliasesForInstanceOptions.Builder to create a ListResourceAliasesForInstanceOptions object that contains the parameter values for the listResourceAliasesForInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

Query Parameters

  • 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.

WithContext method only

The ListResourceAliasesForInstance options.

The listResourceAliasesForInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • 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.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • 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.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_aliases   -H "Authorization: Bearer <IAM token>"
  • listResourceAliasesForInstanceOptions := &resourcecontrollerv2.ListResourceAliasesForInstanceOptions{
      ID: &instanceGUID,
    }
    
    pager, err := resourceControllerService.NewResourceAliasesForInstancePager(listResourceAliasesForInstanceOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceAlias
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceAliasesForInstanceOptions listResourceAliasesForInstanceOptions = new ListResourceAliasesForInstanceOptions.Builder()
      .id(instanceGuid)
      .build();
    
    ResourceAliasesForInstancePager pager = new ResourceAliasesForInstancePager(resourceControllerService, listResourceAliasesForInstanceOptions);
    List<ResourceAlias> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceAlias> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      id: instanceGuid,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceAliasesForInstancePager(
        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 = ResourceAliasesForInstancePager(
      client=resource_controller_service,
      id=instance_guid,
    )
    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 aliases.

A list of resource aliases.

A list of resource aliases.

A list of resource aliases.

A list of resource aliases.

Status Code

  • The list of aliases 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.

  • 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
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "created_at": "2018-04-19T00:21:02.735586861Z",
          "updated_at": "2018-04-26T18:05:58.851303427Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "name": "my-instance-alias-1",
          "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
          "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
          "state": "active",
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
          "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "created_at": "2018-04-19T00:21:02.735586861Z",
          "updated_at": "2018-04-26T18:05:58.851303427Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "name": "my-instance-alias-1",
          "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
          "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
          "state": "active",
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
          "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
        }
      ]
    }

Get a list of all the resource keys for the instance.

You may have many resource keys for one resource instance. For example, you may have a different resource key for each user or each role.

You may have many resource keys for one resource instance. For example, you may have a different resource key for each user or each role.

You may have many resource keys for one resource instance. For example, you may have a different resource key for each user or each role.

You may have many resource keys for one resource instance. For example, you may have a different resource key for each user or each role.

You may have many resource keys for one resource instance. For example, you may have a different resource key for each user or each role.

GET /v2/resource_instances/{id}/resource_keys
(resourceController *ResourceControllerV2) ListResourceKeysForInstance(listResourceKeysForInstanceOptions *ListResourceKeysForInstanceOptions) (result *ResourceKeysList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceKeysForInstanceWithContext(ctx context.Context, listResourceKeysForInstanceOptions *ListResourceKeysForInstanceOptions) (result *ResourceKeysList, response *core.DetailedResponse, err error)
ServiceCall<ResourceKeysList> listResourceKeysForInstance(ListResourceKeysForInstanceOptions listResourceKeysForInstanceOptions)
listResourceKeysForInstance(params)
list_resource_keys_for_instance(
        self,
        id: str,
        *,
        limit: Optional[int] = None,
        start: Optional[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.key.retrieve

Auditing

Calling this method generates the following auditing event.

  • resource-controller.key.retrieve

Request

Instantiate the ListResourceKeysForInstanceOptions struct and set the fields to provide parameter values for the ListResourceKeysForInstance method.

Use the ListResourceKeysForInstanceOptions.Builder to create a ListResourceKeysForInstanceOptions object that contains the parameter values for the listResourceKeysForInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

Query Parameters

  • 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.

WithContext method only

The ListResourceKeysForInstance options.

The listResourceKeysForInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • 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.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • 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.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/resource_keys   -H "Authorization: Bearer <IAM token>"
  • listResourceKeysForInstanceOptions := &resourcecontrollerv2.ListResourceKeysForInstanceOptions{
      ID: &instanceGUID,
    }
    
    pager, err := resourceControllerService.NewResourceKeysForInstancePager(listResourceKeysForInstanceOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceKey
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceKeysForInstanceOptions listResourceKeysForInstanceOptions = new ListResourceKeysForInstanceOptions.Builder()
      .id(instanceGuid)
      .build();
    
    ResourceKeysForInstancePager pager = new ResourceKeysForInstancePager(resourceControllerService, listResourceKeysForInstanceOptions);
    List<ResourceKey> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceKey> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      id: instanceGuid,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceKeysForInstancePager(
        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 = ResourceKeysForInstancePager(
      client=resource_controller_service,
      id=instance_guid,
    )
    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 keys.

A list of resource keys.

A list of resource keys.

A list of resource keys.

A list of resource keys.

Status Code

  • The list of resource keys 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": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "apikey": "XXXX-YYYY-ZZZZ\"",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "apikey": "XXXX-YYYY-ZZZZ\"",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }

Lock a resource instance

Locks a resource instance. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings, or keys.

Locks a resource instance. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings, or keys.

Locks a resource instance. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings, or keys.

Locks a resource instance. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings, or keys.

Locks a resource instance. A locked instance can not be updated or deleted. It does not affect actions performed on child resources like aliases, bindings, or keys.

POST /v2/resource_instances/{id}/lock
(resourceController *ResourceControllerV2) LockResourceInstance(lockResourceInstanceOptions *LockResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) LockResourceInstanceWithContext(ctx context.Context, lockResourceInstanceOptions *LockResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> lockResourceInstance(LockResourceInstanceOptions lockResourceInstanceOptions)
lockResourceInstance(params)
lock_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.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.update

Request

Instantiate the LockResourceInstanceOptions struct and set the fields to provide parameter values for the LockResourceInstance method.

Use the LockResourceInstanceOptions.Builder to create a LockResourceInstanceOptions object that contains the parameter values for the lockResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

WithContext method only

The LockResourceInstance options.

The lockResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • curl -X POST   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/lock   -H "Authorization: Bearer <IAM token>"
  • lockResourceInstanceOptions := resourceControllerService.NewLockResourceInstanceOptions(
      instanceGUID,
    )
    
    resourceInstance, response, err := resourceControllerService.LockResourceInstance(lockResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceInstance, "", "  ")
    fmt.Println(string(b))
  • LockResourceInstanceOptions lockResourceInstanceOptions = new LockResourceInstanceOptions.Builder()
      .id(instanceGuid)
      .build();
    
    Response<ResourceInstance> response = resourceControllerService.lockResourceInstance(lockResourceInstanceOptions).execute();
    ResourceInstance resourceInstance = response.getResult();
    
    System.out.println(resourceInstance);
  • const params = {
      id: instanceGuid,
    };
    
    try {
      const res = await resourceControllerService.lockResourceInstance(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_instance = resource_controller_service.lock_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.

A resource instance.

Status Code

  • Successfully locked 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.

  • The request could not be processed.

  • 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: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": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "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": "",
      "locked": true
    }
  • {
      "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": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "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": "",
      "locked": true
    }

Unlock a resource instance

Unlock a resource instance to update or delete it. Unlocking a resource instance does not affect child resources like aliases, bindings or keys.

Unlock a resource instance to update or delete it. Unlocking a resource instance does not affect child resources like aliases, bindings or keys.

Unlock a resource instance to update or delete it. Unlocking a resource instance does not affect child resources like aliases, bindings or keys.

Unlock a resource instance to update or delete it. Unlocking a resource instance does not affect child resources like aliases, bindings or keys.

Unlock a resource instance to update or delete it. Unlocking a resource instance does not affect child resources like aliases, bindings or keys.

DELETE /v2/resource_instances/{id}/lock
(resourceController *ResourceControllerV2) UnlockResourceInstance(unlockResourceInstanceOptions *UnlockResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) UnlockResourceInstanceWithContext(ctx context.Context, unlockResourceInstanceOptions *UnlockResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> unlockResourceInstance(UnlockResourceInstanceOptions unlockResourceInstanceOptions)
unlockResourceInstance(params)
unlock_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.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.update

Request

Instantiate the UnlockResourceInstanceOptions struct and set the fields to provide parameter values for the UnlockResourceInstance method.

Use the UnlockResourceInstanceOptions.Builder to create a UnlockResourceInstanceOptions object that contains the parameter values for the unlockResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

WithContext method only

The UnlockResourceInstance options.

The unlockResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • curl -X DELETE   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/lock   -H "Authorization: Bearer <IAM token>"
  • unlockResourceInstanceOptions := resourceControllerService.NewUnlockResourceInstanceOptions(
      instanceGUID,
    )
    
    resourceInstance, response, err := resourceControllerService.UnlockResourceInstance(unlockResourceInstanceOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceInstance, "", "  ")
    fmt.Println(string(b))
  • UnlockResourceInstanceOptions unlockResourceInstanceOptions = new UnlockResourceInstanceOptions.Builder()
      .id(instanceGuid)
      .build();
    
    Response<ResourceInstance> response = resourceControllerService.unlockResourceInstance(unlockResourceInstanceOptions).execute();
    ResourceInstance resourceInstance = response.getResult();
    
    System.out.println(resourceInstance);
  • const params = {
      id: instanceGuid,
    };
    
    try {
      const res = await resourceControllerService.unlockResourceInstance(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_instance = resource_controller_service.unlock_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.

A resource instance.

Status Code

  • Successfully unlocked 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.

  • The request could not be processed.

  • 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: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": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "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": "",
      "locked": false
    }
  • {
      "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": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "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": "",
      "locked": false
    }

Cancel the in progress last operation of the resource instance

Cancel the in progress last operation of the resource instance. After successful cancellation, the resource instance is removed.

Cancel the in progress last operation of the resource instance. After successful cancellation, the resource instance is removed.

Cancel the in progress last operation of the resource instance. After successful cancellation, the resource instance is removed.

Cancel the in progress last operation of the resource instance. After successful cancellation, the resource instance is removed.

Cancel the in progress last operation of the resource instance. After successful cancellation, the resource instance is removed.

DELETE /v2/resource_instances/{id}/last_operation
(resourceController *ResourceControllerV2) CancelLastopResourceInstance(cancelLastopResourceInstanceOptions *CancelLastopResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) CancelLastopResourceInstanceWithContext(ctx context.Context, cancelLastopResourceInstanceOptions *CancelLastopResourceInstanceOptions) (result *ResourceInstance, response *core.DetailedResponse, err error)
ServiceCall<ResourceInstance> cancelLastopResourceInstance(CancelLastopResourceInstanceOptions cancelLastopResourceInstanceOptions)
cancelLastopResourceInstance(params)
cancel_lastop_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.delete

Auditing

Calling this method generates the following auditing event.

  • resource-controller.instance.delete

Request

Instantiate the CancelLastopResourceInstanceOptions struct and set the fields to provide parameter values for the CancelLastopResourceInstance method.

Use the CancelLastopResourceInstanceOptions.Builder to create a CancelLastopResourceInstanceOptions object that contains the parameter values for the cancelLastopResourceInstance method.

Path Parameters

  • The resource instance URL-encoded CRN or GUID.

WithContext method only

The CancelLastopResourceInstance options.

The cancelLastopResourceInstance options.

parameters

  • The resource instance URL-encoded CRN or GUID.

parameters

  • The resource instance URL-encoded CRN or GUID.

  • curl -X DELETE   https://resource-controller.cloud.ibm.com/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94/last_operation   -H 'Authorization: Bearer <>'
  • cancelLastopResourceInstanceOptions := resourceControllerService.NewCancelLastopResourceInstanceOptions(
      instanceGUID,
    )
    
    resourceInstance, response, err := resourceControllerService.CancelLastopResourceInstance(cancelLastopResourceInstanceOptions)
    if err != nil {
      fmt.Println("The instance is not cancelable.")
    } else {
      b, _ := json.MarshalIndent(resourceInstance, "", "  ")
      fmt.Println(string(b))
    }
  • resource_instance = resource_controller_service.cancel_lastop_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.

A resource instance.

Status Code

  • Successfully canceled the in progress last operation of the resource instance.

  • Last operation cancel request accepted.

  • 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.

  • The request could not be processed.

  • 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.

  • The Server has encountered BadGateway error while connecting to the external components. 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: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:22:53.302077457Z",
      "deleted_at": "2018-04-19T00:22:53.302077457Z",
      "created_by": "IBMid-5401023BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "IBMid-5500093BHN",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "global",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "removed",
      "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": "cancel",
        "state": "succeeded",
        "async": false,
        "description": "Last operation canceled",
        "cancelable": true,
        "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": "",
      "locked": false
    }
  • {
      "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:22:53.302077457Z",
      "deleted_at": "2018-04-19T00:22:53.302077457Z",
      "created_by": "IBMid-5401023BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "IBMid-5500093BHN",
      "scheduled_reclaim_at": null,
      "restored_at": null,
      "scheduled_reclaim_by": "",
      "restored_by": "",
      "name": "my-instance",
      "region_id": "global",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_plan_id": "744bfc56-d12c-4866-88d5-dac9139e0e5d",
      "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": "removed",
      "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": "cancel",
        "state": "succeeded",
        "async": false,
        "description": "Last operation canceled",
        "cancelable": true,
        "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": "",
      "locked": false
    }

Get a list of all of the resource keys.

View all of the resource keys that exist for all of your resource instances.

View all of the resource keys that exist for all of your resource instances.

View all of the resource keys that exist for all of your resource instances.

View all of the resource keys that exist for all of your resource instances.

View all of the resource keys that exist for all of your resource instances.

GET /v2/resource_keys
(resourceController *ResourceControllerV2) ListResourceKeys(listResourceKeysOptions *ListResourceKeysOptions) (result *ResourceKeysList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceKeysWithContext(ctx context.Context, listResourceKeysOptions *ListResourceKeysOptions) (result *ResourceKeysList, response *core.DetailedResponse, err error)
ServiceCall<ResourceKeysList> listResourceKeys(ListResourceKeysOptions listResourceKeysOptions)
listResourceKeys(params)
list_resource_keys(
        self,
        *,
        guid: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        resource_id: Optional[str] = None,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        updated_from: Optional[str] = None,
        updated_to: Optional[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.key.retrieve

Request

Instantiate the ListResourceKeysOptions struct and set the fields to provide parameter values for the ListResourceKeys method.

Use the ListResourceKeysOptions.Builder to create a ListResourceKeysOptions object that contains the parameter values for the listResourceKeys method.

Query Parameters

  • The GUID of the key.

  • The human-readable name of the key.

  • The ID of the resource group.

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

  • 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.

  • Start date inclusive filter.

    Example: 2021-01-01

  • End date inclusive filter.

    Example: 2021-01-01

WithContext method only

The ListResourceKeys options.

The listResourceKeys options.

parameters

  • The GUID of the key.

  • The human-readable name of the key.

  • The ID of the resource group.

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

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:

parameters

  • The GUID of the key.

  • The human-readable name of the key.

  • The ID of the resource group.

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

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:
  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_keys   -H "Authorization: Bearer <IAM token>"
  • listResourceKeysOptions := &resourcecontrollerv2.ListResourceKeysOptions{
      Name: &keyName,
    }
    
    pager, err := resourceControllerService.NewResourceKeysPager(listResourceKeysOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceKey
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceKeysOptions listResourceKeysOptions = new ListResourceKeysOptions.Builder()
      .name(keyName)
      .build();
    
    ResourceKeysPager pager = new ResourceKeysPager(resourceControllerService, listResourceKeysOptions);
    List<ResourceKey> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceKey> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      name: keyName,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceKeysPager(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 = ResourceKeysPager(
      client=resource_controller_service,
      name=key_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 keys.

A list of resource keys.

A list of resource keys.

A list of resource keys.

A list of resource keys.

Status Code

  • The list of resource keys 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": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "apikey": "XXXX-YYYY-ZZZZ\"",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "apikey": "XXXX-YYYY-ZZZZ\"",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "REDACTED": "REDACTED_EXPLICIT"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
          "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
          "created_at": "2018-07-02T22:03:43.837979455Z",
          "updated_at": "2018-07-02T22:03:43.837979455Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "name": "my-instance-key-1",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
          "state": "active",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "credentials": {
            "REDACTED": "REDACTED_EXPLICIT"
          },
          "iam_compatible": true,
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_alias_url": null
        }
      ]
    }

Create a new resource key

A resource key is a saved credential you can use to authenticate with a resource instance.

A resource key is a saved credential you can use to authenticate with a resource instance.

A resource key is a saved credential you can use to authenticate with a resource instance.

A resource key is a saved credential you can use to authenticate with a resource instance.

A resource key is a saved credential you can use to authenticate with a resource instance.

POST /v2/resource_keys
(resourceController *ResourceControllerV2) CreateResourceKey(createResourceKeyOptions *CreateResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) CreateResourceKeyWithContext(ctx context.Context, createResourceKeyOptions *CreateResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
ServiceCall<ResourceKey> createResourceKey(CreateResourceKeyOptions createResourceKeyOptions)
createResourceKey(params)
create_resource_key(
        self,
        name: str,
        source: str,
        *,
        parameters: Optional['ResourceKeyPostParameters'] = None,
        role: Optional[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.key.create

Auditing

Calling this method generates the following auditing event.

  • resource-controller.key.create

Request

Instantiate the CreateResourceKeyOptions struct and set the fields to provide parameter values for the CreateResourceKey method.

Use the CreateResourceKeyOptions.Builder to create a CreateResourceKeyOptions object that contains the parameter values for the createResourceKey method.

Property values for the new resource key.

Examples:
{
  "name": "ExampleResourceKey",
  "parameters": {
    "exampleParameter": "exampleValue"
  },
  "source": "381fd51a-f251-4f95-aff4-2b03fa8caa63"
}

WithContext method only

The CreateResourceKey options.

The createResourceKey options.

parameters

  • The name of the key.

    Examples:
  • The ID of resource instance or alias.

    Examples:
  • Configuration options represented as key-value pairs. Service defined options are passed through to the target resource brokers, whereas platform defined options are not.

  • The base IAM service role name (Reader, Writer, or Manager), or the service or custom role CRN. Refer to service’s documentation for supported roles.

    Default: Writer

parameters

  • The name of the key.

    Examples:
  • The ID of resource instance or alias.

    Examples:
  • Configuration options represented as key-value pairs. Service defined options are passed through to the target resource brokers, whereas platform defined options are not.

  • The base IAM service role name (Reader, Writer, or Manager), or the service or custom role CRN. Refer to service’s documentation for supported roles.

    Default: Writer

  • curl -X POST   https://resource-controller.cloud.ibm.com/v2/resource_keys   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'   -d '{
      "name": "my-instance-key-1",
      "source": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "role": "Writer"
    }'
  • createResourceKeyOptions := resourceControllerService.NewCreateResourceKeyOptions(
      keyName,
      instanceGUID,
    )
    
    parameters := &resourcecontrollerv2.ResourceKeyPostParameters{}
    parameters.SetProperty("exampleParameter", "exampleValue")
    createResourceKeyOptions.SetParameters(parameters)
    
    resourceKey, response, err := resourceControllerService.CreateResourceKey(createResourceKeyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceKey, "", "  ")
    fmt.Println(string(b))
  • ResourceKeyPostParameters parameters = new ResourceKeyPostParameters.Builder()
      .add("exampleParameter", "exampleValue")
      .build();
    CreateResourceKeyOptions createResourceKeyOptions = new CreateResourceKeyOptions.Builder()
      .name(keyName)
      .source(instanceGuid)
      .parameters(parameters)
      .build();
    
    Response<ResourceKey> response = resourceControllerService.createResourceKey(createResourceKeyOptions).execute();
    ResourceKey resourceKey = response.getResult();
    
    System.out.println(resourceKey);
  • const parameters = {
      'exampleParameter': 'exampleValue'
    };
    
    const params = {
      name: keyName,
      source: instanceGuid,
      parameters: parameters,
    };
    
    try {
      const res = await resourceControllerService.createResourceKey(params);
      instanceKeyGuid = res.result.guid;
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • parameters = {
      'exampleParameter': 'exampleValue'
    }
    resource_key = resource_controller_service.create_resource_key(
      name=key_name,
      source=instance_guid,
      parameters=parameters
    ).get_result()
    
    print(json.dumps(resource_key, indent=2))

Response

A resource key.

A resource key.

A resource key.

A resource key.

A resource key.

Status Code

  • Created

  • 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:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "name": "my-instance-key-1",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ\"",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "name": "my-instance-key-1",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ\"",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }

Get resource key

View the details of a resource key by URL-encoded CRN or GUID, like the credentials for the key and who created it.

View the details of a resource key by URL-encoded CRN or GUID, like the credentials for the key and who created it.

View the details of a resource key by URL-encoded CRN or GUID, like the credentials for the key and who created it.

View the details of a resource key by URL-encoded CRN or GUID, like the credentials for the key and who created it.

View the details of a resource key by URL-encoded CRN or GUID, like the credentials for the key and who created it.

GET /v2/resource_keys/{id}
(resourceController *ResourceControllerV2) GetResourceKey(getResourceKeyOptions *GetResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) GetResourceKeyWithContext(ctx context.Context, getResourceKeyOptions *GetResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
ServiceCall<ResourceKey> getResourceKey(GetResourceKeyOptions getResourceKeyOptions)
getResourceKey(params)
get_resource_key(
        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.key.retrieve

Request

Instantiate the GetResourceKeyOptions struct and set the fields to provide parameter values for the GetResourceKey method.

Use the GetResourceKeyOptions.Builder to create a GetResourceKeyOptions object that contains the parameter values for the getResourceKey method.

Path Parameters

  • The resource key URL-encoded CRN or GUID.

WithContext method only

The GetResourceKey options.

The getResourceKey options.

parameters

  • The resource key URL-encoded CRN or GUID.

parameters

  • The resource key URL-encoded CRN or GUID.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0   -H "Authorization: Bearer <IAM token>"
  • getResourceKeyOptions := resourceControllerService.NewGetResourceKeyOptions(
      instanceKeyGUID,
    )
    
    resourceKey, response, err := resourceControllerService.GetResourceKey(getResourceKeyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceKey, "", "  ")
    fmt.Println(string(b))
    if resourceKey.Credentials.Redacted != nil && (*resourceKey.Credentials.Redacted == "REDACTED" || *resourceKey.Credentials.Redacted == "REDACTED_EXPLICIT") {
      fmt.Println("Credentials are redacted with code:", *resourceKey.Credentials.Redacted, ".The User doesn't have the correct access to view the credentials. Refer to the API documentation for additional details.")
    }
  • GetResourceKeyOptions getResourceKeyOptions = new GetResourceKeyOptions.Builder()
      .id(instanceKeyGuid)
      .build();
    
    Response<ResourceKey> response = resourceControllerService.getResourceKey(getResourceKeyOptions).execute();
    ResourceKey resourceKey = response.getResult();
    
    System.out.println(resourceKey);
  • const params = {
      id: instanceKeyGuid,
    };
    
    try {
      const res = await resourceControllerService.getResourceKey(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_key = resource_controller_service.get_resource_key(
      id=instance_key_guid
    ).get_result()
    if resource_key.get('credentials') and resource_key.get('credentials').get('REDACTED'):
      print("Credentials are redacted with code:", resource_key.get('credentials').get('REDACTED'), ".The User doesn't have the correct access to view the credentials. Refer to the API documentation for additional details.")
    
    print(json.dumps(resource_key, indent=2))

Response

A resource key.

A resource key.

A resource key.

A resource key.

A resource key.

Status Code

  • The resource key 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.

  • 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:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "REDACTED": "REDACTED_EXPLICIT"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "REDACTED": "REDACTED_EXPLICIT"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }

Delete a resource key

Deleting a resource key does not affect any resource instance or resource alias associated with the key.

Deleting a resource key does not affect any resource instance or resource alias associated with the key.

Deleting a resource key does not affect any resource instance or resource alias associated with the key.

Deleting a resource key does not affect any resource instance or resource alias associated with the key.

Deleting a resource key does not affect any resource instance or resource alias associated with the key.

DELETE /v2/resource_keys/{id}
(resourceController *ResourceControllerV2) DeleteResourceKey(deleteResourceKeyOptions *DeleteResourceKeyOptions) (response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) DeleteResourceKeyWithContext(ctx context.Context, deleteResourceKeyOptions *DeleteResourceKeyOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteResourceKey(DeleteResourceKeyOptions deleteResourceKeyOptions)
deleteResourceKey(params)
delete_resource_key(
        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.key.delete

Auditing

Calling this method generates the following auditing event.

  • resource-controller.key.delete

Request

Instantiate the DeleteResourceKeyOptions struct and set the fields to provide parameter values for the DeleteResourceKey method.

Use the DeleteResourceKeyOptions.Builder to create a DeleteResourceKeyOptions object that contains the parameter values for the deleteResourceKey method.

Path Parameters

  • The resource key URL-encoded CRN or GUID.

WithContext method only

The DeleteResourceKey options.

The deleteResourceKey options.

parameters

  • The resource key URL-encoded CRN or GUID.

parameters

  • The resource key URL-encoded CRN or GUID.

  • curl -X DELETE   https://resource-controller.cloud.ibm.com/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0   -H "Authorization: Bearer <IAM token>"
  • deleteResourceKeyOptions := resourceControllerService.NewDeleteResourceKeyOptions(
      instanceKeyGUID,
    )
    
    response, err := resourceControllerService.DeleteResourceKey(deleteResourceKeyOptions)
    if err != nil {
      panic(err)
    }
  • DeleteResourceKeyOptions deleteResourceKeyOptions = new DeleteResourceKeyOptions.Builder()
      .id(instanceKeyGuid)
      .build();
    
    Response<Void> response = resourceControllerService.deleteResourceKey(deleteResourceKeyOptions).execute();
  • const params = {
      id: instanceKeyGuid,
    };
    
    try {
      await resourceControllerService.deleteResourceKey(params);
    } catch (err) {
      console.warn(err);
    }
  • response = resource_controller_service.delete_resource_key(
      id=instance_key_guid)

Response

Status Code

  • Deleted

  • 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.

  • The resource could was previously deleted and is no longer available.

  • 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.

No Sample Response

This method does not specify any sample responses.

Update a resource key

Use the resource key URL-encoded CRN or GUID to update the resource key.

Use the resource key URL-encoded CRN or GUID to update the resource key.

Use the resource key URL-encoded CRN or GUID to update the resource key.

Use the resource key URL-encoded CRN or GUID to update the resource key.

Use the resource key URL-encoded CRN or GUID to update the resource key.

PATCH /v2/resource_keys/{id}
(resourceController *ResourceControllerV2) UpdateResourceKey(updateResourceKeyOptions *UpdateResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) UpdateResourceKeyWithContext(ctx context.Context, updateResourceKeyOptions *UpdateResourceKeyOptions) (result *ResourceKey, response *core.DetailedResponse, err error)
ServiceCall<ResourceKey> updateResourceKey(UpdateResourceKeyOptions updateResourceKeyOptions)
updateResourceKey(params)
update_resource_key(
        self,
        id: str,
        name: 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.key.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.key.update

Request

Instantiate the UpdateResourceKeyOptions struct and set the fields to provide parameter values for the UpdateResourceKey method.

Use the UpdateResourceKeyOptions.Builder to create a UpdateResourceKeyOptions object that contains the parameter values for the updateResourceKey method.

Path Parameters

  • The resource key URL-encoded CRN or GUID.

Updated property values for the resource key.

Examples:
{
  "name": "UpdatedExampleResourceKey"
}

WithContext method only

The UpdateResourceKey options.

The updateResourceKey options.

parameters

  • The resource key URL-encoded CRN or GUID.

  • The new name of the key. 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:

parameters

  • The resource key URL-encoded CRN or GUID.

  • The new name of the key. 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:
  • curl -X PATCH   https://resource-controller.cloud.ibm.com/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance-new-key-1",
      }'
  • updateResourceKeyOptions := resourceControllerService.NewUpdateResourceKeyOptions(
      instanceKeyGUID,
      keyUpdateName,
    )
    
    resourceKey, response, err := resourceControllerService.UpdateResourceKey(updateResourceKeyOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceKey, "", "  ")
    fmt.Println(string(b))
  • UpdateResourceKeyOptions updateResourceKeyOptions = new UpdateResourceKeyOptions.Builder()
      .id(instanceKeyGuid)
      .name(keyUpdateName)
      .build();
    
    Response<ResourceKey> response = resourceControllerService.updateResourceKey(updateResourceKeyOptions).execute();
    ResourceKey resourceKey = response.getResult();
    
    System.out.println(resourceKey);
  • const params = {
      id: instanceKeyGuid,
      name: keyUpdateName,
    };
    
    try {
      const res = await resourceControllerService.updateResourceKey(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_key = resource_controller_service.update_resource_key(
      id=instance_key_guid,
      name=key_update_name
    ).get_result()
    
    print(json.dumps(resource_key, indent=2))

Response

A resource key.

A resource key.

A resource key.

A resource key.

A resource key.

Status Code

  • The resource key was successfully updated.

  • 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.

  • The request could not be processed.

  • 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:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-new-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "guid": "23693f48-aaa2-4079-b0c7-334846eff8d0",
      "url": "/v2/resource_keys/23693f48-aaa2-4079-b0c7-334846eff8d0",
      "created_at": "2018-07-02T22:03:43.837979455Z",
      "updated_at": "2018-07-02T22:03:43.837979455Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "name": "my-instance-new-key-1",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-key:23693f48-aaa2-4079-b0c7-334846eff8d0",
      "state": "active",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "credentials": {
        "apikey": "XXXX-YYYY-ZZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-key operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-23693f48-aaa2-4079-b0c7-334846eff8d0",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-64c29e4f-422d-468c-a11b-1a8f671b5c89",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_alias_url": null
    }

Get a list of all resource bindings

View all of the resource bindings that exist for all of your resource aliases.

View all of the resource bindings that exist for all of your resource aliases.

View all of the resource bindings that exist for all of your resource aliases.

View all of the resource bindings that exist for all of your resource aliases.

View all of the resource bindings that exist for all of your resource aliases.

GET /v2/resource_bindings
(resourceController *ResourceControllerV2) ListResourceBindings(listResourceBindingsOptions *ListResourceBindingsOptions) (result *ResourceBindingsList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceBindingsWithContext(ctx context.Context, listResourceBindingsOptions *ListResourceBindingsOptions) (result *ResourceBindingsList, response *core.DetailedResponse, err error)
ServiceCall<ResourceBindingsList> listResourceBindings(ListResourceBindingsOptions listResourceBindingsOptions)
listResourceBindings(params)
list_resource_bindings(
        self,
        *,
        guid: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        resource_id: Optional[str] = None,
        region_binding_id: Optional[str] = None,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        updated_from: Optional[str] = None,
        updated_to: Optional[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.binding.retrieve

Request

Instantiate the ListResourceBindingsOptions struct and set the fields to provide parameter values for the ListResourceBindings method.

Use the ListResourceBindingsOptions.Builder to create a ListResourceBindingsOptions object that contains the parameter values for the listResourceBindings method.

Query Parameters

  • The GUID of the binding.

  • The human-readable name of the binding.

  • The ID of the resource group.

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

  • The ID of the binding in the target environment. For example, service_binding_id in a given IBM Cloud environment.

  • 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.

  • Start date inclusive filter.

    Example: 2021-01-01

  • End date inclusive filter.

    Example: 2021-01-01

WithContext method only

The ListResourceBindings options.

The listResourceBindings options.

parameters

  • The GUID of the binding.

  • The human-readable name of the binding.

  • The ID of the resource group.

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

  • The ID of the binding in the target environment. For example, service_binding_id in a given IBM Cloud environment.

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:

parameters

  • The GUID of the binding.

  • The human-readable name of the binding.

  • The ID of the resource group.

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

  • The ID of the binding in the target environment. For example, service_binding_id in a given IBM Cloud environment.

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:
  • curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_bindings -H "Authorization: Bearer <IAM token>"
  • listResourceBindingsOptions := &resourcecontrollerv2.ListResourceBindingsOptions{
      Name: &bindingName,
    }
    
    pager, err := resourceControllerService.NewResourceBindingsPager(listResourceBindingsOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceBinding
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceBindingsOptions listResourceBindingsOptions = new ListResourceBindingsOptions.Builder()
      .name(bindingName)
      .build();
    
    ResourceBindingsPager pager = new ResourceBindingsPager(resourceControllerService, listResourceBindingsOptions);
    List<ResourceBinding> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceBinding> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      name: bindingName,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceBindingsPager(
        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 = ResourceBindingsPager(
      client=resource_controller_service,
      name=binding_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 bindings.

A list of resource bindings.

A list of resource bindings.

A list of resource bindings.

A list of resource bindings.

Status Code

  • The list of resource bindings 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": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "apikey": "XXX-YYY-ZZZ",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "apikey": "XXX-YYY-ZZZ",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "REDACTED": "REDACTED_EXPLICIT"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "REDACTED": "REDACTED_EXPLICIT"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }

Create a new resource binding

A resource binding connects credentials to a resource alias. The credentials are in the form of a resource key.

A resource binding connects credentials to a resource alias. The credentials are in the form of a resource key.

A resource binding connects credentials to a resource alias. The credentials are in the form of a resource key.

A resource binding connects credentials to a resource alias. The credentials are in the form of a resource key.

A resource binding connects credentials to a resource alias. The credentials are in the form of a resource key.

POST /v2/resource_bindings
(resourceController *ResourceControllerV2) CreateResourceBinding(createResourceBindingOptions *CreateResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) CreateResourceBindingWithContext(ctx context.Context, createResourceBindingOptions *CreateResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
ServiceCall<ResourceBinding> createResourceBinding(CreateResourceBindingOptions createResourceBindingOptions)
createResourceBinding(params)
create_resource_binding(
        self,
        source: str,
        target: str,
        *,
        name: Optional[str] = None,
        parameters: Optional['ResourceBindingPostParameters'] = None,
        role: Optional[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.binding.create

Auditing

Calling this method generates the following auditing event.

  • resource-controller.binding.create

Request

Instantiate the CreateResourceBindingOptions struct and set the fields to provide parameter values for the CreateResourceBinding method.

Use the CreateResourceBindingOptions.Builder to create a CreateResourceBindingOptions object that contains the parameter values for the createResourceBinding method.

Property values for the new resource binding.

Examples:
{
  "name": "ExampleResourceBinding",
  "parameters": {
    "exampleParameter": "exampleValue"
  },
  "source": "faaec9d8-ec64-44d8-ab83-868632fac6a2",
  "target": "crn:v1:staging:public:bluemix:us-south:s/e1773b6e-17b4-40c8-b5ed-d2a1c4b620d7::cf-application:8d9457e0-1303-4f32-b4b3-5525575f6205"
}

WithContext method only

The CreateResourceBinding options.

The createResourceBinding options.

parameters

  • The ID of resource alias.

    Examples:
  • The CRN of application to bind to in a specific environment, for example, Dallas YP, CFEE instance.

    Examples:
  • The name of the binding. 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:
  • Configuration options represented as key-value pairs. Service defined options are passed through to the target resource brokers, whereas platform defined options are not.

  • The base IAM service role name (Reader, Writer, or Manager), or the service or custom role CRN. Refer to service’s documentation for supported roles.

    Default: Writer

parameters

  • The ID of resource alias.

    Examples:
  • The CRN of application to bind to in a specific environment, for example, Dallas YP, CFEE instance.

    Examples:
  • The name of the binding. 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:
  • Configuration options represented as key-value pairs. Service defined options are passed through to the target resource brokers, whereas platform defined options are not.

  • The base IAM service role name (Reader, Writer, or Manager), or the service or custom role CRN. Refer to service’s documentation for supported roles.

    Default: Writer

  • curl -X POST   https://resource-controller.cloud.ibm.com/v2/resource_bindings   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance-binding-1",
        "source": "8d7af921-b136-4078-9666-081bd8470d94",
        "target": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
        "role": "Writer"
      }'
  • createResourceBindingOptions := resourceControllerService.NewCreateResourceBindingOptions(
      aliasGUID,
      bindingTargetCRN,
    )
    createResourceBindingOptions = createResourceBindingOptions.SetName(bindingName)
    
    parameters := &resourcecontrollerv2.ResourceBindingPostParameters{}
    parameters.SetProperty("exampleParameter", "exampleValue")
    createResourceBindingOptions.SetParameters(parameters)
    
    resourceBinding, response, err := resourceControllerService.CreateResourceBinding(createResourceBindingOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceBinding, "", "  ")
    fmt.Println(string(b))
  • ResourceBindingPostParameters parameters = new ResourceBindingPostParameters.Builder()
      .add("exampleParameter", "exampleValue")
      .build();
    CreateResourceBindingOptions createResourceBindingOptions = new CreateResourceBindingOptions.Builder()
      .source(aliasGuid)
      .target(bindingTargetCRN)
      .name(bindingName)
      .parameters(parameters)
      .build();
    
    Response<ResourceBinding> response = resourceControllerService.createResourceBinding(createResourceBindingOptions).execute();
    ResourceBinding resourceBinding = response.getResult();
    
    System.out.println(resourceBinding);
  • const parameters = {
      'exampleParameter': 'exampleValue'
    };
    
    const params = {
      name: bindingName,
      source: aliasGuid,
      target: bindingTargetCRN,
      parameters: parameters,
    };
    
    try {
      const res = await resourceControllerService.createResourceBinding(params);
      bindingGuid = res.result.guid;
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • parameters = {
      'exampleParameter': 'exampleValue'
    }
    resource_binding = resource_controller_service.create_resource_binding(
      source=alias_guid,
      target=binding_target_crn,
      name=binding_name,
      parameters=parameters
    ).get_result()
    
    print(json.dumps(resource_binding, indent=2))

Response

A resource binding.

A resource binding.

A resource binding.

A resource binding.

A resource binding.

Status Code

  • Resource binding has been created

  • 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.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }

Get a resource binding

View a resource binding and all of its details, like who created it, the credential, and the resource alias that the binding is associated with.

View a resource binding and all of its details, like who created it, the credential, and the resource alias that the binding is associated with.

View a resource binding and all of its details, like who created it, the credential, and the resource alias that the binding is associated with.

View a resource binding and all of its details, like who created it, the credential, and the resource alias that the binding is associated with.

View a resource binding and all of its details, like who created it, the credential, and the resource alias that the binding is associated with.

GET /v2/resource_bindings/{id}
(resourceController *ResourceControllerV2) GetResourceBinding(getResourceBindingOptions *GetResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) GetResourceBindingWithContext(ctx context.Context, getResourceBindingOptions *GetResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
ServiceCall<ResourceBinding> getResourceBinding(GetResourceBindingOptions getResourceBindingOptions)
getResourceBinding(params)
get_resource_binding(
        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.binding.retrieve

Request

Instantiate the GetResourceBindingOptions struct and set the fields to provide parameter values for the GetResourceBinding method.

Use the GetResourceBindingOptions.Builder to create a GetResourceBindingOptions object that contains the parameter values for the getResourceBinding method.

Path Parameters

  • The resource binding URL-encoded CRN or GUID.

WithContext method only

The GetResourceBinding options.

The getResourceBinding options.

parameters

  • The resource binding URL-encoded CRN or GUID.

parameters

  • The resource binding URL-encoded CRN or GUID.

  • curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa -H "Authorization: Bearer <IAM token>"
  • getResourceBindingOptions := resourceControllerService.NewGetResourceBindingOptions(
      bindingGUID,
    )
    
    resourceBinding, response, err := resourceControllerService.GetResourceBinding(getResourceBindingOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceBinding, "", "  ")
    fmt.Println(string(b))
    
    if resourceBinding.Credentials.Redacted != nil && (*resourceBinding.Credentials.Redacted == "REDACTED" || *resourceBinding.Credentials.Redacted == "REDACTED_EXPLICIT") {
      fmt.Println("Credentials are redacted with code:", *resourceBinding.Credentials.Redacted, ".The User doesn't have the correct access to view the credentials. Refer to the API documentation for additional details.")
    }
  • GetResourceBindingOptions getResourceBindingOptions = new GetResourceBindingOptions.Builder()
      .id(bindingGuid)
      .build();
    
    Response<ResourceBinding> response = resourceControllerService.getResourceBinding(getResourceBindingOptions).execute();
    ResourceBinding resourceBinding = response.getResult();
    
    System.out.println(resourceBinding);
  • const params = {
      id: bindingGuid,
    };
    
    try {
      const res = await resourceControllerService.getResourceBinding(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_binding = resource_controller_service.get_resource_binding(
      id=binding_guid
    ).get_result()
    if resource_binding.get('credentials') and resource_binding.get('credentials').get('REDACTED'):
      print("Credentials are redacted with code:", resource_binding.get('credentials').get('REDACTED'), ".The User doesn't have the correct access to view the credentials. Refer to the API documentation for additional details.")
    print(json.dumps(resource_binding, indent=2))

Response

A resource binding.

A resource binding.

A resource binding.

A resource binding.

A resource binding.

Status Code

  • The resource binding 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.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "REDACTED": "REDACTED_EXPLICIT"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "REDACTED": "REDACTED_EXPLICIT"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }

Delete a resource binding

Deleting a resource binding does not affect the resource alias that the binding is associated with.

Deleting a resource binding does not affect the resource alias that the binding is associated with.

Deleting a resource binding does not affect the resource alias that the binding is associated with.

Deleting a resource binding does not affect the resource alias that the binding is associated with.

Deleting a resource binding does not affect the resource alias that the binding is associated with.

DELETE /v2/resource_bindings/{id}
(resourceController *ResourceControllerV2) DeleteResourceBinding(deleteResourceBindingOptions *DeleteResourceBindingOptions) (response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) DeleteResourceBindingWithContext(ctx context.Context, deleteResourceBindingOptions *DeleteResourceBindingOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteResourceBinding(DeleteResourceBindingOptions deleteResourceBindingOptions)
deleteResourceBinding(params)
delete_resource_binding(
        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.binding.delete

Auditing

Calling this method generates the following auditing event.

  • resource-controller.binding.delete

Request

Instantiate the DeleteResourceBindingOptions struct and set the fields to provide parameter values for the DeleteResourceBinding method.

Use the DeleteResourceBindingOptions.Builder to create a DeleteResourceBindingOptions object that contains the parameter values for the deleteResourceBinding method.

Path Parameters

  • The resource binding URL-encoded CRN or GUID.

WithContext method only

The DeleteResourceBinding options.

The deleteResourceBinding options.

parameters

  • The resource binding URL-encoded CRN or GUID.

parameters

  • The resource binding URL-encoded CRN or GUID.

  • curl -X DELETE https://resource-controller.cloud.ibm.com/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa -H "Authorization: Bearer <IAM token>"
  • deleteResourceBindingOptions := resourceControllerService.NewDeleteResourceBindingOptions(
      bindingGUID,
    )
    
    response, err := resourceControllerService.DeleteResourceBinding(deleteResourceBindingOptions)
    if err != nil {
      panic(err)
    }
  • DeleteResourceBindingOptions deleteResourceBindingOptions = new DeleteResourceBindingOptions.Builder()
      .id(bindingGuid)
      .build();
    
    Response<Void> response = resourceControllerService.deleteResourceBinding(deleteResourceBindingOptions).execute();
  • const params = {
      id: bindingGuid,
    };
    
    try {
      await resourceControllerService.deleteResourceBinding(params);
    } catch (err) {
      console.warn(err);
    }
  • response = resource_controller_service.delete_resource_binding(
      id=binding_guid)

Response

Status Code

  • Successfully deleted binding.

  • 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.

  • The resource could was previously deleted and is no longer available.

  • 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.

No Sample Response

This method does not specify any sample responses.

Update a resource binding

Use the resource binding URL-encoded CRN or GUID to update the resource binding.

Use the resource binding URL-encoded CRN or GUID to update the resource binding.

Use the resource binding URL-encoded CRN or GUID to update the resource binding.

Use the resource binding URL-encoded CRN or GUID to update the resource binding.

Use the resource binding URL-encoded CRN or GUID to update the resource binding.

PATCH /v2/resource_bindings/{id}
(resourceController *ResourceControllerV2) UpdateResourceBinding(updateResourceBindingOptions *UpdateResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) UpdateResourceBindingWithContext(ctx context.Context, updateResourceBindingOptions *UpdateResourceBindingOptions) (result *ResourceBinding, response *core.DetailedResponse, err error)
ServiceCall<ResourceBinding> updateResourceBinding(UpdateResourceBindingOptions updateResourceBindingOptions)
updateResourceBinding(params)
update_resource_binding(
        self,
        id: str,
        name: 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.binding.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.binding.update

Request

Instantiate the UpdateResourceBindingOptions struct and set the fields to provide parameter values for the UpdateResourceBinding method.

Use the UpdateResourceBindingOptions.Builder to create a UpdateResourceBindingOptions object that contains the parameter values for the updateResourceBinding method.

Path Parameters

  • The resource binding URL-encoded CRN or GUID.

Updated property values for the resource binding.

Examples:
{
  "name": "UpdatedExampleResourceBinding"
}

WithContext method only

The UpdateResourceBinding options.

The updateResourceBinding options.

parameters

  • The resource binding URL-encoded CRN or GUID.

  • The new name of the binding. 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:

parameters

  • The resource binding URL-encoded CRN or GUID.

  • The new name of the binding. 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:
  • curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa -H "Authorization: Bearer <IAM token>"
      -H 'Content-Type: application/json'   -d '{
      "name": "my-instance-new-binding-1"
      }'
  • updateResourceBindingOptions := resourceControllerService.NewUpdateResourceBindingOptions(
      bindingGUID,
      bindingUpdateName,
    )
    
    resourceBinding, response, err := resourceControllerService.UpdateResourceBinding(updateResourceBindingOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceBinding, "", "  ")
    fmt.Println(string(b))
  • UpdateResourceBindingOptions updateResourceBindingOptions = new UpdateResourceBindingOptions.Builder()
      .id(bindingGuid)
      .name(bindingUpdateName)
      .build();
    
    Response<ResourceBinding> response = resourceControllerService.updateResourceBinding(updateResourceBindingOptions).execute();
    ResourceBinding resourceBinding = response.getResult();
    
    System.out.println(resourceBinding);
  • const params = {
      id: bindingGuid,
      name: bindingUpdateName,
    };
    
    try {
      const res = await resourceControllerService.updateResourceBinding(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_binding = resource_controller_service.update_resource_binding(
      id=binding_guid,
      name=binding_update_name
    ).get_result()
    
    print(json.dumps(resource_binding, indent=2))

Response

A resource binding.

A resource binding.

A resource binding.

A resource binding.

A resource binding.

Status Code

  • Successfully updated binding.

  • 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.

  • The request could not be processed.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "guid": "25b88996-c117-484a-a233-0db73e9177fa",
      "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
      "created_at": "2018-09-24T15:26:06.849531355Z",
      "updated_at": "2018-09-24T15:26:06.849531355Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
      "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
      "parameters": {
        "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
      },
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
      "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "state": "active",
      "credentials": {
        "apikey": "XXX-YYY-ZZZ",
        "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
        "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
        "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
        "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
        "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
        "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
      },
      "iam_compatible": true,
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "migrated": false,
      "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
    }

Get a list of all resource aliases

View all of the resource aliases that exist for every resource instance.

View all of the resource aliases that exist for every resource instance.

View all of the resource aliases that exist for every resource instance.

View all of the resource aliases that exist for every resource instance.

View all of the resource aliases that exist for every resource instance.

GET /v2/resource_aliases
(resourceController *ResourceControllerV2) ListResourceAliases(listResourceAliasesOptions *ListResourceAliasesOptions) (result *ResourceAliasesList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceAliasesWithContext(ctx context.Context, listResourceAliasesOptions *ListResourceAliasesOptions) (result *ResourceAliasesList, response *core.DetailedResponse, err error)
ServiceCall<ResourceAliasesList> listResourceAliases(ListResourceAliasesOptions listResourceAliasesOptions)
listResourceAliases(params)
list_resource_aliases(
        self,
        *,
        guid: Optional[str] = None,
        name: Optional[str] = None,
        resource_instance_id: Optional[str] = None,
        region_instance_id: Optional[str] = None,
        resource_id: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        limit: Optional[int] = None,
        start: Optional[str] = None,
        updated_from: Optional[str] = None,
        updated_to: Optional[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.alias.retrieve

Request

Instantiate the ListResourceAliasesOptions struct and set the fields to provide parameter values for the ListResourceAliases method.

Use the ListResourceAliasesOptions.Builder to create a ListResourceAliasesOptions object that contains the parameter values for the listResourceAliases method.

Query Parameters

  • The GUID of the alias.

  • The human-readable name of the alias.

  • The ID of the resource instance.

  • The ID of the instance in the target environment. For example, service_instance_id in a given IBM Cloud environment.

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

  • The ID of the resource group.

  • 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.

  • Start date inclusive filter.

    Example: 2021-01-01

  • End date inclusive filter.

    Example: 2021-01-01

WithContext method only

The ListResourceAliases options.

The listResourceAliases options.

parameters

  • The GUID of the alias.

  • The human-readable name of the alias.

  • The ID of the resource instance.

  • The ID of the instance in the target environment. For example, service_instance_id in a given IBM Cloud environment.

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

  • The ID of the resource group.

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:

parameters

  • The GUID of the alias.

  • The human-readable name of the alias.

  • The ID of the resource instance.

  • The ID of the instance in the target environment. For example, service_instance_id in a given IBM Cloud environment.

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

  • The ID of the resource group.

  • 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.

  • Start date inclusive filter.

    Examples:
  • End date inclusive filter.

    Examples:
  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_aliases   -H "Authorization: Bearer <IAM token>" \
  • listResourceAliasesOptions := &resourcecontrollerv2.ListResourceAliasesOptions{
      Name: &aliasName,
    }
    
    pager, err := resourceControllerService.NewResourceAliasesPager(listResourceAliasesOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceAlias
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceAliasesOptions listResourceAliasesOptions = new ListResourceAliasesOptions.Builder()
      .name(aliasName)
      .build();
    
    ResourceAliasesPager pager = new ResourceAliasesPager(resourceControllerService, listResourceAliasesOptions);
    List<ResourceAlias> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceAlias> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      name: aliasName,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceAliasesPager(
        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 = ResourceAliasesPager(
      client=resource_controller_service,
      name=alias_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 aliases.

A list of resource aliases.

A list of resource aliases.

A list of resource aliases.

A list of resource aliases.

Status Code

  • The list of aliases 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.

  • 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
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "created_at": "2018-04-19T00:21:02.735586861Z",
          "updated_at": "2018-04-26T18:05:58.851303427Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "name": "my-instance-alias-1",
          "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
          "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
          "state": "active",
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
          "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "created_at": "2018-04-19T00:21:02.735586861Z",
          "updated_at": "2018-04-26T18:05:58.851303427Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "name": "my-instance-alias-1",
          "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
          "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
          "state": "active",
          "migrated": false,
          "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
          "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
          "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
        }
      ]
    }

Create a new resource alias

Alias a resource instance into a targeted environment's (name)space.

Alias a resource instance into a targeted environment's (name)space.

Alias a resource instance into a targeted environment's (name)space.

Alias a resource instance into a targeted environment's (name)space.

Alias a resource instance into a targeted environment's (name)space.

POST /v2/resource_aliases
(resourceController *ResourceControllerV2) CreateResourceAlias(createResourceAliasOptions *CreateResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) CreateResourceAliasWithContext(ctx context.Context, createResourceAliasOptions *CreateResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
ServiceCall<ResourceAlias> createResourceAlias(CreateResourceAliasOptions createResourceAliasOptions)
createResourceAlias(params)
create_resource_alias(
        self,
        name: str,
        source: str,
        target: 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.alias.create

Auditing

Calling this method generates the following auditing event.

  • resource-controller.alias.create

Request

Instantiate the CreateResourceAliasOptions struct and set the fields to provide parameter values for the CreateResourceAlias method.

Use the CreateResourceAliasOptions.Builder to create a CreateResourceAliasOptions object that contains the parameter values for the createResourceAlias method.

Property values for the new resource alias.

Examples:
{
  "name": "ExampleResourceAlias",
  "source": "381fd51a-f251-4f95-aff4-2b03fa8caa63",
  "target": "crn:v1:bluemix:public:bluemix:us-south:o/d35d4f0e-5076-4c89-9361-2522894b6548::cf-space:e1773b6e-17b4-40c8-b5ed-d2a1c4b620d7"
}

WithContext method only

The CreateResourceAlias options.

The createResourceAlias options.

parameters

  • The name of the alias. 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:
  • The ID of resource instance.

    Examples:
  • The CRN of target name(space) in a specific environment, for example, space in Dallas YP, CFEE instance etc.

    Examples:

parameters

  • The name of the alias. 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:
  • The ID of resource instance.

    Examples:
  • The CRN of target name(space) in a specific environment, for example, space in Dallas YP, CFEE instance etc.

    Examples:
  • curl -X POST   https://resource-controller.cloud.ibm.com/v2/resource_aliases   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance-alias-1",
        "source": "8d7af921-b136-4078-9666-081bd8470d94",
        "target": "crn:v1:cf:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e"
      }'
  • createResourceAliasOptions := resourceControllerService.NewCreateResourceAliasOptions(
      aliasName,
      instanceGUID,
      aliasTargetCRN,
    )
    
    resourceAlias, response, err := resourceControllerService.CreateResourceAlias(createResourceAliasOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceAlias, "", "  ")
    fmt.Println(string(b))
  • CreateResourceAliasOptions createResourceAliasOptions = new CreateResourceAliasOptions.Builder()
      .name(aliasName)
      .source(instanceGuid)
      .target(aliasTargetCRN)
      .build();
    
    Response<ResourceAlias> response = resourceControllerService.createResourceAlias(createResourceAliasOptions).execute();
    ResourceAlias resourceAlias = response.getResult();
    
    System.out.println(resourceAlias);
  • const params = {
      name: aliasName,
      source: instanceGuid,
      target: aliasTargetCRN,
    };
    
    try {
      const res = await resourceControllerService.createResourceAlias(params);
      aliasGuid = res.result.guid;
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_alias = resource_controller_service.create_resource_alias(
      name=alias_name,
      source=instance_guid,
      target=alias_target_crn
    ).get_result()
    
    print(json.dumps(resource_alias, indent=2))

Response

A resource alias.

A resource alias.

A resource alias.

A resource alias.

A resource alias.

Status Code

  • Alias has been created.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:cf:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:cf:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }

Get a resource alias

View a resource alias and all of its details, like who created it and the resource instance that it's associated with.

View a resource alias and all of its details, like who created it and the resource instance that it's associated with.

View a resource alias and all of its details, like who created it and the resource instance that it's associated with.

View a resource alias and all of its details, like who created it and the resource instance that it's associated with.

View a resource alias and all of its details, like who created it and the resource instance that it's associated with.

GET /v2/resource_aliases/{id}
(resourceController *ResourceControllerV2) GetResourceAlias(getResourceAliasOptions *GetResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) GetResourceAliasWithContext(ctx context.Context, getResourceAliasOptions *GetResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
ServiceCall<ResourceAlias> getResourceAlias(GetResourceAliasOptions getResourceAliasOptions)
getResourceAlias(params)
get_resource_alias(
        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.alias.retrieve

Request

Instantiate the GetResourceAliasOptions struct and set the fields to provide parameter values for the GetResourceAlias method.

Use the GetResourceAliasOptions.Builder to create a GetResourceAliasOptions object that contains the parameter values for the getResourceAlias method.

Path Parameters

  • The resource alias URL-encoded CRN or GUID.

WithContext method only

The GetResourceAlias options.

The getResourceAlias options.

parameters

  • The resource alias URL-encoded CRN or GUID.

parameters

  • The resource alias URL-encoded CRN or GUID.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4   -H "Authorization: Bearer <IAM token>" \
  • getResourceAliasOptions := resourceControllerService.NewGetResourceAliasOptions(
      aliasGUID,
    )
    
    resourceAlias, response, err := resourceControllerService.GetResourceAlias(getResourceAliasOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceAlias, "", "  ")
    fmt.Println(string(b))
  • GetResourceAliasOptions getResourceAliasOptions = new GetResourceAliasOptions.Builder()
      .id(aliasGuid)
      .build();
    
    Response<ResourceAlias> response = resourceControllerService.getResourceAlias(getResourceAliasOptions).execute();
    ResourceAlias resourceAlias = response.getResult();
    
    System.out.println(resourceAlias);
  • const params = {
      id: aliasGuid,
    };
    
    try {
      const res = await resourceControllerService.getResourceAlias(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_alias = resource_controller_service.get_resource_alias(
      id=alias_guid
    ).get_result()
    
    print(json.dumps(resource_alias, indent=2))

Response

A resource alias.

A resource alias.

A resource alias.

A resource alias.

A resource alias.

Status Code

  • The alias 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.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }

Delete a resource alias

Delete a resource alias by URL-encoded CRN or GUID. If the resource alias has any resource keys or bindings associated with it, use the recursive=true parameter to delete it.

Delete a resource alias by URL-encoded CRN or GUID. If the resource alias has any resource keys or bindings associated with it, use the recursive=true parameter to delete it.

Delete a resource alias by URL-encoded CRN or GUID. If the resource alias has any resource keys or bindings associated with it, use the recursive=true parameter to delete it.

Delete a resource alias by URL-encoded CRN or GUID. If the resource alias has any resource keys or bindings associated with it, use the recursive=true parameter to delete it.

Delete a resource alias by URL-encoded CRN or GUID. If the resource alias has any resource keys or bindings associated with it, use the recursive=true parameter to delete it.

DELETE /v2/resource_aliases/{id}
(resourceController *ResourceControllerV2) DeleteResourceAlias(deleteResourceAliasOptions *DeleteResourceAliasOptions) (response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) DeleteResourceAliasWithContext(ctx context.Context, deleteResourceAliasOptions *DeleteResourceAliasOptions) (response *core.DetailedResponse, err error)
ServiceCall<Void> deleteResourceAlias(DeleteResourceAliasOptions deleteResourceAliasOptions)
deleteResourceAlias(params)
delete_resource_alias(
        self,
        id: str,
        *,
        recursive: Optional[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.alias.delete

Auditing

Calling this method generates the following auditing event.

  • resource-controller.alias.delete

Request

Instantiate the DeleteResourceAliasOptions struct and set the fields to provide parameter values for the DeleteResourceAlias method.

Use the DeleteResourceAliasOptions.Builder to create a DeleteResourceAliasOptions object that contains the parameter values for the deleteResourceAlias method.

Path Parameters

  • The resource alias URL-encoded CRN or GUID.

Query Parameters

  • Deletes the resource bindings and keys associated with the alias.

    Default: false

WithContext method only

The DeleteResourceAlias options.

The deleteResourceAlias options.

parameters

  • The resource alias URL-encoded CRN or GUID.

  • Deletes the resource bindings and keys associated with the alias.

    Default: false

parameters

  • The resource alias URL-encoded CRN or GUID.

  • Deletes the resource bindings and keys associated with the alias.

    Default: false

  • curl -X DELETE   https://resource-controller.cloud.ibm.com/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4   -H "Authorization: Bearer <IAM token>" \
  • deleteResourceAliasOptions := resourceControllerService.NewDeleteResourceAliasOptions(
      aliasGUID,
    )
    
    response, err := resourceControllerService.DeleteResourceAlias(deleteResourceAliasOptions)
    if err != nil {
      panic(err)
    }
  • DeleteResourceAliasOptions deleteResourceAliasOptions = new DeleteResourceAliasOptions.Builder()
      .id(aliasGuid)
      .build();
    
    Response<Void> response = resourceControllerService.deleteResourceAlias(deleteResourceAliasOptions).execute();
  • const params = {
      id: aliasGuid,
    };
    
    try {
      await resourceControllerService.deleteResourceAlias(params);
    } catch (err) {
      console.warn(err);
    }
  • response = resource_controller_service.delete_resource_alias(
      id=alias_guid
    )

Response

Status Code

  • Successfully deleted alias.

  • 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.

  • The resource could was previously deleted and is no longer available.

  • 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.

No Sample Response

This method does not specify any sample responses.

Update a resource alias

Use the resource alias URL-encoded CRN or GUID to update the resource alias.

Use the resource alias URL-encoded CRN or GUID to update the resource alias.

Use the resource alias URL-encoded CRN or GUID to update the resource alias.

Use the resource alias URL-encoded CRN or GUID to update the resource alias.

Use the resource alias URL-encoded CRN or GUID to update the resource alias.

PATCH /v2/resource_aliases/{id}
(resourceController *ResourceControllerV2) UpdateResourceAlias(updateResourceAliasOptions *UpdateResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) UpdateResourceAliasWithContext(ctx context.Context, updateResourceAliasOptions *UpdateResourceAliasOptions) (result *ResourceAlias, response *core.DetailedResponse, err error)
ServiceCall<ResourceAlias> updateResourceAlias(UpdateResourceAliasOptions updateResourceAliasOptions)
updateResourceAlias(params)
update_resource_alias(
        self,
        id: str,
        name: 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.alias.update

Auditing

Calling this method generates the following auditing event.

  • resource-controller.alias.update

Request

Instantiate the UpdateResourceAliasOptions struct and set the fields to provide parameter values for the UpdateResourceAlias method.

Use the UpdateResourceAliasOptions.Builder to create a UpdateResourceAliasOptions object that contains the parameter values for the updateResourceAlias method.

Path Parameters

  • The resource alias URL-encoded CRN or GUID.

Updated property values for a resource alias.

Examples:
{
  "name": "UpdatedExampleResourceAlias"
}

WithContext method only

The UpdateResourceAlias options.

The updateResourceAlias options.

parameters

  • The resource alias URL-encoded CRN or GUID.

  • The new name of the alias. 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:

parameters

  • The resource alias URL-encoded CRN or GUID.

  • The new name of the alias. 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:
  • curl -X PATCH   https://resource-controller.cloud.ibm.com/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "name": "my-instance-new-alias-1"
      }'
  • updateResourceAliasOptions := resourceControllerService.NewUpdateResourceAliasOptions(
      aliasGUID,
      aliasUpdateName,
    )
    
    resourceAlias, response, err := resourceControllerService.UpdateResourceAlias(updateResourceAliasOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(resourceAlias, "", "  ")
    fmt.Println(string(b))
  • UpdateResourceAliasOptions updateResourceAliasOptions = new UpdateResourceAliasOptions.Builder()
      .id(aliasGuid)
      .name(aliasUpdateName)
      .build();
    
    Response<ResourceAlias> response = resourceControllerService.updateResourceAlias(updateResourceAliasOptions).execute();
    ResourceAlias resourceAlias = response.getResult();
    
    System.out.println(resourceAlias);
  • const params = {
      id: aliasGuid,
      name: aliasUpdateName,
    };
    
    try {
      const res = await resourceControllerService.updateResourceAlias(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • resource_alias = resource_controller_service.update_resource_alias(
      id=alias_guid,
      name=alias_update_name
    ).get_result()
    
    print(json.dumps(resource_alias, indent=2))

Response

A resource alias.

A resource alias.

A resource alias.

A resource alias.

A resource alias.

Status Code

  • Successfully updated alias.

  • 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.

  • The request could not be processed.

  • 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:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-new-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }
  • {
      "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "guid": "267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "created_at": "2018-04-19T00:21:02.735586861Z",
      "updated_at": "2018-04-26T18:05:58.851303427Z",
      "deleted_at": null,
      "created_by": "IBMid-5500093BHN",
      "updated_by": "IBMid-5500093BHN",
      "deleted_by": "",
      "name": "my-instance-new-alias-1",
      "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
      "target_crn": "crn:v1:bluemix:public:cf:eu-gb:o/e242c7f0-9eb7-4541-ad3e-b5f5a45a1498::cf-space:f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e",
      "account_id": "4329073d16d2f3663f74bfa955259139",
      "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
      "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
      "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
      "region_instance_id": "3ea43c9c-c987-481e-9fff-283dcec927a3",
      "region_instance_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e:3ea43c9c-c987-481e-9fff-283dcec927a3:cf-service-instance:",
      "state": "active",
      "migrated": false,
      "resource_instance_url": "/v2/resource_instances/8d7af921-b136-4078-9666-081bd8470d94",
      "resource_bindings_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings",
      "resource_keys_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_keys"
    }

Get a list of all resource bindings for the alias

View all of the resource bindings associated with a specific resource alias.

View all of the resource bindings associated with a specific resource alias.

View all of the resource bindings associated with a specific resource alias.

View all of the resource bindings associated with a specific resource alias.

View all of the resource bindings associated with a specific resource alias.

GET /v2/resource_aliases/{id}/resource_bindings
(resourceController *ResourceControllerV2) ListResourceBindingsForAlias(listResourceBindingsForAliasOptions *ListResourceBindingsForAliasOptions) (result *ResourceBindingsList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListResourceBindingsForAliasWithContext(ctx context.Context, listResourceBindingsForAliasOptions *ListResourceBindingsForAliasOptions) (result *ResourceBindingsList, response *core.DetailedResponse, err error)
ServiceCall<ResourceBindingsList> listResourceBindingsForAlias(ListResourceBindingsForAliasOptions listResourceBindingsForAliasOptions)
listResourceBindingsForAlias(params)
list_resource_bindings_for_alias(
        self,
        id: str,
        *,
        limit: Optional[int] = None,
        start: Optional[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.binding.retrieve

Request

Instantiate the ListResourceBindingsForAliasOptions struct and set the fields to provide parameter values for the ListResourceBindingsForAlias method.

Use the ListResourceBindingsForAliasOptions.Builder to create a ListResourceBindingsForAliasOptions object that contains the parameter values for the listResourceBindingsForAlias method.

Path Parameters

  • The resource alias URL-encoded CRN or GUID.

Query Parameters

  • 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.

WithContext method only

The ListResourceBindingsForAlias options.

The listResourceBindingsForAlias options.

parameters

  • The resource alias URL-encoded CRN or GUID.

  • 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.

parameters

  • The resource alias URL-encoded CRN or GUID.

  • 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.

  • curl -X GET https://resource-controller.cloud.ibm.com/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4/resource_bindings -H "Authorization: Bearer <IAM token>"
  • listResourceBindingsForAliasOptions := &resourcecontrollerv2.ListResourceBindingsForAliasOptions{
      ID: &aliasGUID,
    }
    
    pager, err := resourceControllerService.NewResourceBindingsForAliasPager(listResourceBindingsForAliasOptions)
    if err != nil {
      panic(err)
    }
    
    var allResults []resourcecontrollerv2.ResourceBinding
    for pager.HasNext() {
      nextPage, err := pager.GetNext()
      if err != nil {
        panic(err)
      }
      allResults = append(allResults, nextPage...)
    }
    b, _ := json.MarshalIndent(allResults, "", "  ")
    fmt.Println(string(b))
  • ListResourceBindingsForAliasOptions listResourceBindingsForAliasOptions = new ListResourceBindingsForAliasOptions.Builder()
      .id(aliasGuid)
      .build();
    
    ResourceBindingsForAliasPager pager = new ResourceBindingsForAliasPager(resourceControllerService, listResourceBindingsForAliasOptions);
    List<ResourceBinding> allResults = new ArrayList<>();
    while (pager.hasNext()) {
      List<ResourceBinding> nextPage = pager.getNext();
      allResults.addAll(nextPage);
    }
    
    System.out.println(GsonSingleton.getGson().toJson(allResults));
  • const params = {
      id: aliasGuid,
    };
    
    const allResults = [];
    try {
      const pager = new ResourceControllerV2.ResourceBindingsForAliasPager(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 = ResourceBindingsForAliasPager(
      client=resource_controller_service,
      id=alias_guid,
    )
    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 bindings.

A list of resource bindings.

A list of resource bindings.

A list of resource bindings.

A list of resource bindings.

Status Code

  • The list of resource bindings 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": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "apikey": "XXX-YYY-ZZZ",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }
  • {
      "rows_count": 1,
      "next_url": null,
      "resources": [
        {
          "id": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "guid": "25b88996-c117-484a-a233-0db73e9177fa",
          "url": "/v2/resource_bindings/25b88996-c117-484a-a233-0db73e9177fa",
          "created_at": "2018-09-24T15:26:06.849531355Z",
          "updated_at": "2018-09-24T15:26:06.849531355Z",
          "deleted_at": null,
          "created_by": "IBMid-5500093BHN",
          "updated_by": "IBMid-5500093BHN",
          "deleted_by": "",
          "source_crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-alias:267bf377-7fa2-43f6-94ec-09103a8e89d4",
          "target_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-application:b04ddee1-2838-449a-96d3-02a03179e991",
          "role": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
          "parameters": {
            "role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer"
          },
          "crn": "crn:v1:bluemix:public:cloud-object-storage:eu-gb:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94:resource-binding:25b88996-c117-484a-a233-0db73e9177fa",
          "region_binding_id": "684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "region_binding_crn": "crn:v1:bluemix:public:cf:eu-gb:s/f5038ca8-9d28-42a1-9e57-9b9fdd66bf8e::cf-service-binding:684e7a0a-074f-4f97-ba5b-c0f57419fd84",
          "account_id": "4329073d16d2f3663f74bfa955259139",
          "resource_group_id": "0be5ad401ae913d8ff665d92680664ed",
          "state": "active",
          "credentials": {
            "apikey": "XXX-YYY-ZZZ",
            "endpoints": "https://cos-service-armada-s.us-south.containers.mybluemix.net/endpoints",
            "iam_apikey_description": "Auto generated apikey during resource-bind operation for Instance - crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::",
            "iam_apikey_name": "auto-generated-apikey-25b88996-c117-484a-a233-0db73e9177fa",
            "iam_role_crn": "crn:v1:bluemix:public:iam::::serviceRole:Writer",
            "iam_serviceid_crn": "crn:v1:bluemix:public:iam-identity::a/4329073d16d2f3663f74bfa955259139::serviceid:ServiceId-512311d5-ec96-42ea-92f4-efe5b29f7a71",
            "resource_instance_id": "crn:v1:bluemix:public:cloud-object-storage:global:a/4329073d16d2f3663f74bfa955259139:8d7af921-b136-4078-9666-081bd8470d94::"
          },
          "iam_compatible": true,
          "resource_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "migrated": false,
          "resource_alias_url": "/v2/resource_aliases/267bf377-7fa2-43f6-94ec-09103a8e89d4"
        }
      ]
    }

Get a list of all reclamations

View all of the resource reclamations that exist for every resource instance.

View all of the resource reclamations that exist for every resource instance.

View all of the resource reclamations that exist for every resource instance.

View all of the resource reclamations that exist for every resource instance.

View all of the resource reclamations that exist for every resource instance.

GET /v1/reclamations
(resourceController *ResourceControllerV2) ListReclamations(listReclamationsOptions *ListReclamationsOptions) (result *ReclamationsList, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) ListReclamationsWithContext(ctx context.Context, listReclamationsOptions *ListReclamationsOptions) (result *ReclamationsList, response *core.DetailedResponse, err error)
ServiceCall<ReclamationsList> listReclamations(ListReclamationsOptions listReclamationsOptions)
listReclamations(params)
list_reclamations(
        self,
        *,
        account_id: Optional[str] = None,
        resource_instance_id: Optional[str] = None,
        resource_group_id: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse

Request

Instantiate the ListReclamationsOptions struct and set the fields to provide parameter values for the ListReclamations method.

Use the ListReclamationsOptions.Builder to create a ListReclamationsOptions object that contains the parameter values for the listReclamations method.

Query Parameters

  • An alpha-numeric value identifying the account ID.

  • The GUID of the resource instance.

  • The ID of the resource group.

WithContext method only

The ListReclamations options.

The listReclamations options.

parameters

  • An alpha-numeric value identifying the account ID.

  • The GUID of the resource instance.

  • The ID of the resource group.

parameters

  • An alpha-numeric value identifying the account ID.

  • The GUID of the resource instance.

  • The ID of the resource group.

  • curl -X GET   https://resource-controller.cloud.ibm.com/v1/reclamations?account_id=b80a8b513ae24e178438b7a18bd8d609   -H "Authorization: Bearer <IAM token>"
  • listReclamationsOptions := resourceControllerService.NewListReclamationsOptions()
    listReclamationsOptions = listReclamationsOptions.SetResourceGroupID(resourceGroupID)
    reclamationsList, response, err := resourceControllerService.ListReclamations(listReclamationsOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(reclamationsList, "", "  ")
    fmt.Println(string(b))
  • ListReclamationsOptions listReclamationsOptions = new ListReclamationsOptions.Builder()
      .accountId(accountId)
      .build();
    
    Response<ReclamationsList> response = resourceControllerService.listReclamations(listReclamationsOptions).execute();
    ReclamationsList reclamationsList = response.getResult();
    
    System.out.println(reclamationsList);
  • const params = {
      accountId: accountId,
    };
    
    try {
      const res = await resourceControllerService.listReclamations(params);
      var resources = res.result.resources;
      resources.forEach(reclaim => {
        if (reclaim.resource_instance_id.toString() === instanceGuid) {
          reclamationId = reclaim.id;
        }
      });
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • reclamations_list = resource_controller_service.list_reclamations(
      account_id=account_id
    ).get_result()
    
    print(json.dumps(reclamations_list, indent=2))

Response

A list of reclamations.

A list of reclamations.

A list of reclamations.

A list of reclamations.

A list of reclamations.

Status Code

  • The list of reclamations 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.

  • 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
  • {
      "resources": [
        {
          "id": "8b551a81-4af3-47bd-b543-b6e3d512a3db",
          "entity_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "entity_type_id": "98941610-5a79-4778-8b1b-ad115857296b",
          "entity_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/b80a8b513ae24e178438b7a18bd8d609:ef8353b4-92d0-456b-a4fb-a15c01ff86a6::",
          "resource_instance_id": "ef8353b4-92d0-456b-a4fb-a15c01ff86a6",
          "resource_group_id": "e7d14b0586ed4bcc9f82fc5e05099292",
          "account_id": "b80a8b513ae24e178438b7a18bd8d609",
          "policy_id": "6c59484f-dad8-4753-92fd-662fcd4968dc",
          "state": "SCHEDULED",
          "target_time": "2019-06-25T10:01:18Z",
          "created_at": "2019-06-18T10:01:18.847689692Z",
          "created_by": ""
        }
      ]
    }
  • {
      "resources": [
        {
          "id": "8b551a81-4af3-47bd-b543-b6e3d512a3db",
          "entity_id": "dff97f5c-bc5e-4455-b470-411c3edbe49c",
          "entity_type_id": "98941610-5a79-4778-8b1b-ad115857296b",
          "entity_crn": "crn:v1:bluemix:public:cloud-object-storage:global:a/b80a8b513ae24e178438b7a18bd8d609:ef8353b4-92d0-456b-a4fb-a15c01ff86a6::",
          "resource_instance_id": "ef8353b4-92d0-456b-a4fb-a15c01ff86a6",
          "resource_group_id": "e7d14b0586ed4bcc9f82fc5e05099292",
          "account_id": "b80a8b513ae24e178438b7a18bd8d609",
          "policy_id": "6c59484f-dad8-4753-92fd-662fcd4968dc",
          "state": "SCHEDULED",
          "target_time": "2019-06-25T10:01:18Z",
          "created_at": "2019-06-18T10:01:18.847689692Z",
          "created_by": ""
        }
      ]
    }

Perform a reclamation action

Reclaim a resource instance so that it can no longer be used, or restore the resource instance so that it's usable again.

Reclaim a resource instance so that it can no longer be used, or restore the resource instance so that it's usable again.

Reclaim a resource instance so that it can no longer be used, or restore the resource instance so that it's usable again.

Reclaim a resource instance so that it can no longer be used, or restore the resource instance so that it's usable again.

Reclaim a resource instance so that it can no longer be used, or restore the resource instance so that it's usable again.

POST /v1/reclamations/{id}/actions/{action_name}
(resourceController *ResourceControllerV2) RunReclamationAction(runReclamationActionOptions *RunReclamationActionOptions) (result *Reclamation, response *core.DetailedResponse, err error)
(resourceController *ResourceControllerV2) RunReclamationActionWithContext(ctx context.Context, runReclamationActionOptions *RunReclamationActionOptions) (result *Reclamation, response *core.DetailedResponse, err error)
ServiceCall<Reclamation> runReclamationAction(RunReclamationActionOptions runReclamationActionOptions)
runReclamationAction(params)
run_reclamation_action(
        self,
        id: str,
        action_name: str,
        *,
        request_by: Optional[str] = None,
        comment: Optional[str] = None,
        **kwargs,
    ) -> DetailedResponse

Request

Instantiate the RunReclamationActionOptions struct and set the fields to provide parameter values for the RunReclamationAction method.

Use the RunReclamationActionOptions.Builder to create a RunReclamationActionOptions object that contains the parameter values for the runReclamationAction method.

Path Parameters

  • The ID associated with the reclamation.

  • The reclamation action name. Specify reclaim to delete a resource, or restore to restore a resource.

Perform a reclamation action.

WithContext method only

The RunReclamationAction options.

The runReclamationAction options.

parameters

  • The ID associated with the reclamation.

  • The reclamation action name. Specify reclaim to delete a resource, or restore to restore a resource.

  • The request initiator, if different from the request token.

  • A comment to describe the action.

parameters

  • The ID associated with the reclamation.

  • The reclamation action name. Specify reclaim to delete a resource, or restore to restore a resource.

  • The request initiator, if different from the request token.

  • A comment to describe the action.

  • curl -X POST   https://resource-controller.cloud.ibm.com/v1/reclamations/0114be9024c6eede47d08a85ac0c5c43/actions/restore   -H "Authorization: Bearer <IAM token>"   -H 'Content-Type: application/json'     -d '{
        "request_by": "bar",
        "comment": "restore resource instance 614fc866-1d4f-4c9e-973e-637f1089a6a1"
      }'
  • runReclamationActionOptions := resourceControllerService.NewRunReclamationActionOptions(
      reclamationID,
      "reclaim",
    )
    
    reclamation, response, err := resourceControllerService.RunReclamationAction(runReclamationActionOptions)
    if err != nil {
      panic(err)
    }
    b, _ := json.MarshalIndent(reclamation, "", "  ")
    fmt.Println(string(b))
  • RunReclamationActionOptions runReclamationActionOptions = new RunReclamationActionOptions.Builder()
      .id(reclamationId)
      .actionName("reclaim")
      .build();
    
    Response<Reclamation> response = resourceControllerService.runReclamationAction(runReclamationActionOptions).execute();
    Reclamation reclamation = response.getResult();
    
    System.out.println(reclamation);
  • const params = {
      id: reclamationId,
      actionName: 'reclaim',
    };
    
    try {
      const res = await resourceControllerService.runReclamationAction(params);
      console.log(JSON.stringify(res.result, null, 2));
    } catch (err) {
      console.warn(err);
    }
  • reclamation = resource_controller_service.run_reclamation_action(
      id=reclamation_id,
      action_name='reclaim'
    ).get_result()
    
    print(json.dumps(reclamation, indent=2))

Response

A reclamation.

A reclamation.

A reclamation.

A reclamation.

A reclamation.

Status Code

  • The reclamation action, such as restore or reclaim, was successfully performed.

  • 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": "0114be9024c6eede47d08a85ac0c5c43",
      "entity_id": "cloudant",
      "entity_type_id": "98941610-5a79-4778-8b1b-ad115857296b",
      "entity_crn": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/b80a8b513ae24e178438b7a18btest:614fc866-1d4f-4c9e-973e-637f10test::",
      "resource_instance_id": "614fc866-1d4f-4c9e-973e-637f1089a6a1",
      "resource_group_id": "74f5b3fdbea64fbaafe3e1d9d41test",
      "account_id": "b80a8b513ae24e178438b7a18btest",
      "policy_id": "6c59484f-dad8-4753-92fd-662fcd4968dc",
      "state": "RESTORING",
      "target_time": "2019-06-24T07:29:56Z",
      "custom_properties": {
        "request_by": "bar",
        "comment": "restore resource instance 614fc866-1d4f-4c9e-973e-637f1089a6a1"
      },
      "created_at": "2019-06-17T07:29:56.761106722Z",
      "created_by": "foo",
      "updated_at": "2019-06-20T08:27:46.749153Z",
      "updated_by": "bar"
    }
  • {
      "id": "0114be9024c6eede47d08a85ac0c5c43",
      "entity_id": "cloudant",
      "entity_type_id": "98941610-5a79-4778-8b1b-ad115857296b",
      "entity_crn": "crn:v1:bluemix:public:cloudantnosqldb:us-south:a/b80a8b513ae24e178438b7a18btest:614fc866-1d4f-4c9e-973e-637f10test::",
      "resource_instance_id": "614fc866-1d4f-4c9e-973e-637f1089a6a1",
      "resource_group_id": "74f5b3fdbea64fbaafe3e1d9d41test",
      "account_id": "b80a8b513ae24e178438b7a18btest",
      "policy_id": "6c59484f-dad8-4753-92fd-662fcd4968dc",
      "state": "RESTORING",
      "target_time": "2019-06-24T07:29:56Z",
      "custom_properties": {
        "request_by": "bar",
        "comment": "restore resource instance 614fc866-1d4f-4c9e-973e-637f1089a6a1"
      },
      "created_at": "2019-06-17T07:29:56.761106722Z",
      "created_by": "foo",
      "updated_at": "2019-06-20T08:27:46.749153Z",
      "updated_by": "bar"
    }
id=curlclassName=tab-item-selected