Help Center> Config> API Reference> API> Resource Recorder> Creating or Modifying the Resource Recorder

Creating or Modifying the Resource Recorder

Function

This API is used to create or modify the resource recorder. Only one resource recorder can exist.

URI

PUT /v1/resource-manager/domains/{domain_id}/tracker-config

Table 1 Path parameter

Parameter

Mandatory

Type

Description

domain_id

Yes

String

Specifies the account ID.

Maximum length: 36

Request Parameters

Table 2 Request body parameters

Parameter

Mandatory

Type

Description

channel

Yes

ChannelConfigBody object

Specifies configurations for the tracker channel.

selector

Yes

SelectorConfigBody object

Specifies the selector.

agency_name

Yes

String

Specifies the IAM agency name.

Table 3 ChannelConfigBody

Parameter

Mandatory

Type

Description

smn

No

TrackerSMNChannelConfigBody object

Specifies configurations for the SMN channel.

obs

No

TrackerOBSChannelConfigBody object

Specifies configurations for the OBS bucket.

Table 4 TrackerSMNChannelConfigBody

Parameter

Mandatory

Type

Description

region_id

Yes

String

Specifies the region ID.

project_id

Yes

String

Specifies the project ID.

topic_urn

Yes

String

Specifies the SMN topic URN.

Table 5 TrackerOBSChannelConfigBody

Parameter

Mandatory

Type

Description

bucket_name

Yes

String

Specifies the OBS bucket name.

region_id

Yes

String

Specifies the region ID.

Table 6 SelectorConfigBody

Parameter

Mandatory

Type

Description

all_supported

Yes

Boolean

Specifies whether to select all supported resources.

resource_types

Yes

Array of strings

Specifies the resource type list.

Response Parameters

Status code: 400

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Specifies the error code.

error_msg

String

Specifies the error message.

Example Request

Creating a resource recorder and enabling message pushing and dumping

PUT /v1/resource-manager/domains/{domain_id}/tracker-config

{
  "channel" : {
    "smn" : {
      "region_id" : "cn-north-4",
      "project_id" : "39c2af998c334ed6bcbb75b27318f7b5",
      "topic_urn" : "urn:smn:cn-north-4:39c2af998c334ed6bcbb75b27318f7b5:resource-manager-test"
    },
    "obs" : {
      "bucket_name" : "rms-snapshot",
      "region_id" : "cn-north-4"
    }
  },
  "selector" : {
    "all_supported" : true
  },
  "agency_name" : "rms_tracker_agency"
}

Example Response

None

Status Codes

Status Code

Description

200

Operation succeeded.

400

Invalid parameter.

403

Authentication failed or you do not have the operation permission.

404

Resource not found.

500

Internal server error.

Error Codes

See Error Codes.