跳转至

资源转交

1. 接口说明

将资源拥有者转移给新的用户或账号。

2、 接口URL

POST http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/resourceVersion/transfer

anymetrics_host:anymetrics_port 获取方式请参考:调用方式

3、 请求参数

3.1、 公共请求参数(HEADERS)

参数 类型 是否必选 描述
tenant-id String 租户 ID,用于标识资源所属租户
auth-type String 认证方式,用于设置身份认证方式
UID:使用 UID 进行身份认证
TOKEN:使用 TOKEN 进行身份认证
ACCOUNT:使用ACCOUNT 进行身份认证
APIKEY:使用APIKEY 进行身份认证,详情见:API Key 管理
auth-value String 与 auth-type 对应的认证值

3.1.1 公共参数获取方式

tenant-id 与 auth-value:在 Aloudata CAN 顶部导航栏选择指标应用,左边菜单栏选择 API 集成。在 API 集成界面获取取到tenant-id 与auth-value。

3.2. 请求体参数

参数 类型 是否必选 描述
resourceIds Array 需要转交的资源 ID 列表
resourceType String 资源类型,例如 METRIC
targetOwner.identityType String USER_ACCOUNT:id 为账号;其他:为 userId
targetOwner.id String 目标拥有者账号 / 用户 ID

4. 请求示例

curl --location 'http://localhost:8083/anymetrics/api/v1/resourceVersion/transfer' \
--header 'tenant-id: tn_xxx' \
--header 'auth-value: 492376865890107392' \
--header 'auth-type: UID' \
--header 'Content-Type: application/json' \
--data '{
  "resourceIds": [
    "mc2db8445b3a7148b7bc6ba8b853aa44"
  ],
  "resourceType": "METRIC",
  "targetOwner": {
    "identityType": "USER_ACCOUNT",
    "id": "canlll"
  }
}'