Help Center/ Cloud Operations Center/ API Reference/ API/ Application Resource Management/ Resource Views/ Creating a Cross-Account Resource View in CloudCMDB
Updated on 2025-12-05 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.

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

Range

N/A

Default value

N/A

resource_types

Yes

Array of strings

Definition

Resource type.

Constraints

N/A

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 Servers (BMSs)

  • clusters: Cloud Container Engine (CCE)

  • instances: cloud database instances

Default value

N/A

view_type

Yes

String

Definition

View type.

Constraints

N/A

Range

Currently, only organization is supported.

Default value

N/A

organization_id

No

String

Definition

Organization ID.

Constraints

N/A

Range

ID of the organization to which the view belongs.

Default value

N/A

name

Yes

String

Definition

View name.

Constraints

N/A

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.

Range

The value is a string. It contains 1 to 32 characters.

Example Requests

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.