Help Center/ Cloud Operations Center/ API Reference/ API/ Application Resource Management/ Resource Views/ Creating a Cross-Account Resource View in CloudCMDB
Updated on 2025-10-24 GMT+08:00

Creating a Cross-Account Resource View in CloudCMDB

Function

To perform unified and automatic O&M operations on resources of other accounts in an organization, avoid repeated labor input caused by multi-account operations, and reduce risks such as omission caused by manual operations, the cross-account resource view capability of CloudCMDB is provided to manage resource information.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions Policies and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, the following identity policy-based permissions are required.

    Action

    Access Level

    Resource Type (*: required)

    Condition Key

    Alias

    Dependencies

    coc:resourceView:create

    Write

    resourceView *

    -

    -

    -

URI

POST /v1/resource/views

Request Parameters

Table 1 Request body parameters

Parameter

Mandatory

Type

Description

organization_unit_ids

Yes

Array of strings

Definition:

List of IDs of OUs aggregated by the view.

Constraints:

N/A

Value range:

N/A

Default value:

N/A

resource_types

Yes

Array of strings

Definition:

Resource type.

Constraints:

N/A

Value range:

There are many resource types. Select a resource type based on the actual service. The common resource types are as follows:

  • cloudservers: Elastic Cloud Servers (ECSs)

  • servers: bare metal server (BMSs)

  • clusters: Cloud Container Engine (CCE) instances

  • instances: cloud database instances

Default value:

N/A

view_type

Yes

String

Definition:

View type.

Constraints:

N/A

Value range:

Currently, only organization is supported.

Default value:

N/A

organization_id

No

String

Definition:

Organization ID.

Constraints:

N/A

Value range:

ID of the organization to which the view belongs.

Default value:

N/A

name

Yes

String

Definition:

View name.

Constraints:

N/A

Value range:

The value can contain 3 to 50 characters, including letters, digits, hyphens (-), and underscores (_).

Default value:

N/A

Response Parameters

Status code: 200

Table 2 Response body parameters

Parameter

Type

Description

data

String

Definition:

View ID.

Value range:

The value contains 1 to 32 characters.

Example Requests

This API is used to create a CloudCMDB cross-account resource view.

POST https://{Endpoint}/v1/resource/views

{
  "name" : "Test view",
  "view_type" : "organizational",
  "organization_id" : "o-xuglfowux9ks92yrt7q4yc3ubsy6mjhd",
  "organization_unit_ids" : [ "r-mxc9k8s74gj2hu96yhn5i6kd8i9wh8k7" ],
  "resource_types" : [ "ecs.cloudservers", "bms.servers", "fgs.functions", "hcss.l-instance", "as.scalingGroups", "ims.images", "cph.cloudphoneservers", "deh.dedicatedhosts" ]
}

Example Responses

Status code: 200

The view is created.

{
  "data" : "686b63cb101fbf1cdab37803"
}

Status Codes

Status Code

Description

200

The view is created.

Error Codes

See Error Codes.