From ac420175c88ae7f5d119056b2dadc9eccbba9e3b Mon Sep 17 00:00:00 2001 From: kookouse Date: Tue, 10 Dec 2024 16:59:20 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E8=B4=A6=E5=8D=95=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E6=8E=A5=E5=8F=A3=E6=96=87=E6=A1=A3=E8=A1=A5?= =?UTF-8?q?=E5=85=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/account/add_root_account.md.md | 99 ++++ .../resource/account/get_main_account.md.md | 109 +++++ .../docs/resource/account/get_root_account.md | 201 ++++++++ .../resource/account/list_main_account.md | 199 ++++++++ .../resource/account/list_root_account.md | 181 +++++++ .../resource/account/update_root_account.md | 83 ++++ .../resource/bill/confirm_adjustment_item.md | 43 ++ .../bill/confirm_root_account_summarys.md | 47 ++ .../resource/bill/create_adjustment_item.md | 84 ++++ .../resource/bill/delete_adjustment_item.md | 43 ++ .../export_bill_adjustment_item.md | 0 .../{account => bill}/export_bill_item.md | 0 .../export_bill_main_account_summarys.md | 0 .../export_bill_root_account_summarys.md | 0 .../{account => bill}/export_biz_summary.md | 0 .../{account => bill}/import_bill_items.md | 0 .../import_bill_items_preview.md | 0 .../resource/bill/list_adjustment_item.md | 151 ++++++ .../docs/resource/bill/list_bill_item.md | 447 ++++++++++++++++++ .../{account => bill}/list_biz_summary.md | 0 .../docs/resource/bill/list_exchange_rate.md | 107 +++++ .../bill/list_main_account_summarys.md | 230 +++++++++ .../bill/list_root_account_summarys.md | 215 +++++++++ .../resource/bill/list_sync_bill_record.md | 182 +++++++ .../bill/reaccount_root_account_summarys.md | 47 ++ .../bill/sum_main_account_summarys.md | 168 +++++++ .../bill/sum_root_account_summarys.md | 163 +++++++ .../docs/resource/bill/sync_bill_record.md | 56 +++ .../resource/bill/update_adjustment_item.md | 60 +++ ...ete_application_for_create_main_account.md | 73 +++ ...ate_application_for_create_main_account.md | 96 ++++ ...ate_application_for_update_main_account.md | 46 ++ 32 files changed, 3130 insertions(+) create mode 100644 docs/api-docs/web-server/docs/resource/account/add_root_account.md.md create mode 100644 docs/api-docs/web-server/docs/resource/account/get_main_account.md.md create mode 100644 docs/api-docs/web-server/docs/resource/account/get_root_account.md create mode 100644 docs/api-docs/web-server/docs/resource/account/list_main_account.md create mode 100644 docs/api-docs/web-server/docs/resource/account/list_root_account.md create mode 100644 docs/api-docs/web-server/docs/resource/account/update_root_account.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/confirm_adjustment_item.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/confirm_root_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/create_adjustment_item.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/delete_adjustment_item.md rename docs/api-docs/web-server/docs/resource/{account => bill}/export_bill_adjustment_item.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/export_bill_item.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/export_bill_main_account_summarys.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/export_bill_root_account_summarys.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/export_biz_summary.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/import_bill_items.md (100%) rename docs/api-docs/web-server/docs/resource/{account => bill}/import_bill_items_preview.md (100%) create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_adjustment_item.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_bill_item.md rename docs/api-docs/web-server/docs/resource/{account => bill}/list_biz_summary.md (100%) create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_exchange_rate.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_main_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_root_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/list_sync_bill_record.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/reaccount_root_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/sum_main_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/sum_root_account_summarys.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/sync_bill_record.md create mode 100644 docs/api-docs/web-server/docs/resource/bill/update_adjustment_item.md create mode 100644 docs/api-docs/web-server/docs/resource/complete_application_for_create_main_account.md create mode 100644 docs/api-docs/web-server/docs/resource/create_application_for_create_main_account.md create mode 100644 docs/api-docs/web-server/docs/resource/create_application_for_update_main_account.md diff --git a/docs/api-docs/web-server/docs/resource/account/add_root_account.md.md b/docs/api-docs/web-server/docs/resource/account/add_root_account.md.md new file mode 100644 index 0000000000..1dd245ff7a --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/add_root_account.md.md @@ -0,0 +1,99 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:一级账号管理。 +- 该接口功能描述:一级账号录入。 + +### URL + +POST /api/v1/account/root_accounts/add + +### 请求参数 +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------------|--------|----|--------| +| name | string | 是 | 名字 | +| vendor | string | 是 | 云厂商 | +| email | string | 是 | 邮箱 | +| managers | string | 是 | 负责人 | +| bak_managers | string | 是 | 备份负责人 | +| site | string | 是 | 站点 | +| dept_id | int | 是 | 组织架构ID | +| memo | string | 否 | 备忘录 | +| extension | object | 否 | 扩展字段 | + +#### extension字段说明 + +##### aws + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------------------|--------|----|---------| +| cloud_account_id | string | 是 | 云账号ID | +| cloud_iam_username | string | 是 | 云IAM用户名 | +| cloud_secret_id | string | 是 | 云密钥ID | +| cloud_secret_key | string | 是 | 云密钥KEY | + +##### gcp + +| 参数名称 | 参数类型 | 必选 | 描述 | +|----------------------------|--------|----|----------| +| cloud_project_name | string | 是 | 云项目名 | +| cloud_project_id | string | 是 | 云项目ID | +| cloud_service_account_id | string | 是 | 云服务账号ID | +| cloud_service_account_name | string | 是 | 云服务账号名 | +| cloud_service_secret_id | string | 是 | 云服务密钥ID | +| cloud_service_secret_key | string | 是 | 云服务密钥KEY | + +##### azure +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|--------| +| display_name_name | string | 是 | 显示名称名 | +| cloud_tenant_id | string | 是 | 云租户ID | +| cloud_subscription_id | string | 是 | 云订阅ID | +| cloud_subscription_name | string | 是 | 云订阅名 | +| cloud_application_id | string | 是 | 云应用ID | +| cloud_application_name | string | 是 | 云应用名 | +| cloud_client_secret_key | string | 是 | 云客户端密钥 | + + +##### huawei +| 参数名称 | 参数类型 | 必选 | 描述 | +|------------------------|--------|----|----------| +| cloud_sub_account_name | string | 是 | 二级账号名 | +| cloud_sub_account_id | string | 是 | 二级账号ID | +| cloud_secret_id | string | 是 | 云密钥ID | +| cloud_secret_key | string | 是 | 云密钥KEY | +| cloud_iam_user_id | string | 是 | 云IAM用户ID | +| cloud_iam_username | string | 是 | 云IAM用户名 | + +##### zenlayer/kaopu +| 参数名称 | 参数类型 | 必选 | 描述 | +|------------------|--------|----|-------| +| cloud_account_id | string | 是 | 云账号ID | + + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxx" + } +} + +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | array | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------------------|--------------|-----------| +| id | string | AccountID | diff --git a/docs/api-docs/web-server/docs/resource/account/get_main_account.md.md b/docs/api-docs/web-server/docs/resource/account/get_main_account.md.md new file mode 100644 index 0000000000..1c9c97ee2c --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/get_main_account.md.md @@ -0,0 +1,109 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:二级账号查看权限。 +- 该接口功能描述:获取二级账号。 + +### URL + +POST /api/v1/account/main_accounts/{account_id} + +## 请求参数 +| 参数名称 | 参数类型 | 必选 | 描述 | +|------------|--------|----|---------| +| account_id | string | 是 | 二级账号ID。 | + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxx", // id + "vendor": "aws", // string,云厂商 + "email": "xxxx@tencent.com", // 邮箱 + "cloud_id": "xxx", // 云账号id + "parent_account_name": "xxx", // 所属一级账号名 + "parent_account_id": "xxxx", // 所属一级账号id + "site": "international", // string,站点 + "business_type": "internal", // string,业务类型 + "managers": ["xxx","xxx"], // string,负责人 + "bak_managers": ["xxx","xxx"], // string,备份负责人 + "dept_id": 1234, // int,组织架构ID + "op_product_id": 1234, // int,运营产品ID + "bk_biz_id": 1312, // int,业务ID + "status": "xxxx", // string,账号状态 + "memo": "xxxxx", // string,备忘录 + "creator": "xx", // string,创建者 + "reviser": "", // string,修改者 + "created_at": "", // string,创建时间 + "updated_at": "", // string,修改时间 + "extension": {} // 混合云差异字段,见extension说明 + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | array | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------------------|--------------|------------| +| id | string | 资源ID | +| vendor | string | 云厂商 | +| email | string | 邮箱 | +| cloud_id | string | 云ID | +| parent_account_name | string | 父账号名称 | +| parent_account_id | string | 父账号ID | +| site | string | 站点 | +| business_type | string | 业务类型 | +| status | string | 状态 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| dept_id | int | 部门ID | +| op_product_id | int | 运营产品ID | +| bk_biz_id | int | 业务ID | +| status | string | 状态 | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展字段 | + +#### extension + +##### aws + +| 参数名称 | 参数类型 | 描述 | +|-------------------------|--------|--------| +| cloud_main_account_name | string | 二级账号名 | +| cloud_main_account_id | string | 二级账号ID | + +##### gcp + +| 参数名称 | 参数类型 | 描述 | +|--------------------|--------|-------| +| cloud_project_name | string | 云项目名 | +| cloud_project_id | string | 云项目ID | + +##### azure + +| 参数名称 | 参数类型 | 描述 | +|-------------------------|--------|------| +| cloud_subscription_name | string | 订阅名 | +| cloud_subscription_id | string | 订阅ID | + +##### huawei/zenlayer/kaopu +| 参数名称 | 参数类型 | 描述 | +|-------------------------|--------|--------| +| cloud_main_account_name | string | 二级账号名 | +| cloud_main_account_id | string | 二级账号ID | + diff --git a/docs/api-docs/web-server/docs/resource/account/get_root_account.md b/docs/api-docs/web-server/docs/resource/account/get_root_account.md new file mode 100644 index 0000000000..6ab8c1ce0d --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/get_root_account.md @@ -0,0 +1,201 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:一级账号管理。 +- 该接口功能描述:获取一级账号。 + +### URL + +GET /api/v1/account/root_accounts/{account_id} + +### 请求参数 + +| 参数名称 | 是否必选 | 类型 | 描述 | +|------------|------|--------|--------| +| account_id | 是 | string | 二级账号ID | + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxx", // id + "name": "xxx", // 名字 + "vendor": "aws", // string,云厂商 + "cloud_id": "xxxx", // string,云ID + "email": "xxxx@tencent.com", // 邮箱 + "managers": ["xxx","xxx"], // string,负责人,最大5个 + "bak_managers": ["xxx","xxx"],// string,备份负责人 + "site": "international", // string,站点 + "dept_id": 1234, // int,组织架构ID + "memo": "xxxxx", // string,备忘录 + "creator": "xx", // string,创建者 + "reviser": "", // string,修改者 + "created_at": "", // string,创建时间 + "updated_at": "" // string,修改时间 + "extension": {} + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------------------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 不同的vendor会有不同的响应 | + +#### vendor=aws, data说明 + +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展信息 | + +##### extension说明 + +| 参数名称 | 参数类型 | 描述 | +|--------------------|--------|---------| +| cloud_account_id | string | 云账号ID | +| cloud_iam_username | string | 云IAM用户名 | +| cloud_secret_id | string | 云密钥ID | +| cloud_secret_key | string | 云密钥KEY | + +#### vendor=gcp + +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展信息 | + +##### extension说明 + +| 参数名称 | 参数类型 | 描述 | +|----------------------------|--------|----------| +| cloud_project_name | string | 云项目名 | +| cloud_project_id | string | 云项目ID | +| cloud_service_account_id | string | 云服务账号ID | +| cloud_service_account_name | string | 云服务账号名 | +| cloud_service_secret_id | string | 云服务密钥ID | +| cloud_service_secret_key | string | 云服务密钥KEY | +| cloud_billing_account | string | 云账单账号 | +| cloud_organization | string | 云组织 | + + +#### vendor=huawei +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展信息 | + +##### extension说明 + +| 参数名称 | 参数类型 | 描述 | +|------------------------|--------|----------| +| cloud_sub_account_name | string | 二级账号名 | +| cloud_sub_account_id | string | 二级账号ID | +| cloud_secret_id | string | 云密钥ID | +| cloud_secret_key | string | 云密钥KEY | +| cloud_iam_user_id | string | 云IAM用户ID | +| cloud_iam_username | string | 云IAM用户名 | + +#### vendor=azure + +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展信息 | + +##### extension说明 + +| 参数名称 | 参数类型 | 描述 | +|-------------------------|--------|----------| +| display_name_name | string | 显示名称名 | +| cloud_tenant_id | string | 云租户ID | +| cloud_subscription_id | string | 云订阅ID | +| cloud_subscription_name | string | 云订阅名 | +| cloud_application_id | string | 云应用ID | +| cloud_application_name | string | 云应用名 | +| cloud_client_secret_id | string | 云客户端密钥ID | +| cloud_client_secret_key | string | 云客户端密钥 | + +#### vendor=kaopu/zenlayer + +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | +| extension | object | 扩展信息 | + +##### extension说明 + +| 参数名称 | 参数类型 | 描述 | +|------------------|--------|-------| +| cloud_account_id | string | 云账号ID | diff --git a/docs/api-docs/web-server/docs/resource/account/list_main_account.md b/docs/api-docs/web-server/docs/resource/account/list_main_account.md new file mode 100644 index 0000000000..2a40415d85 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/list_main_account.md @@ -0,0 +1,199 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:二级账号查看权限。 +- 该接口功能描述:获取二级账号列表。 + +### URL + +POST /api/v1/account/main_accounts/list + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------|--------|-----|--------| +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|-----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|---------------------|--------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | json | 主账号管理者列表 | +| bak_managers | json | 主账号备份管理者列表 | +| site | string | 站点 | +| business_type | string | 业务类型 | +| status | string | 状态 | +| parent_account_name | string | 父账号名称 | +| parent_account_id | string | 父账号ID | +| dept_id | int | 部门ID | +| bk_biz_id | int | 业务ID | +| op_product_id | int | 运营产品ID | +| memo | string | 备注 | +| extension | json | 扩展字段 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | + + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "count": 10, + "details": [ + { + "id": "xxxx", // id + "vendor": "aws", // string,云厂商 + "email": "xxxx@tencent.com", // 邮箱 + "cloud_id": "xxx", // 云账号id + "parent_account_name": "xxx", // 所属一级账号名 + "parent_account_id": "xxxx", // 所属一级账号id + "site": "international", // string,站点 + "business_type": "internal", // string,业务类型 + "managers": ["xxx","xxx"], // string,负责人 + "bak_managers": ["xxx","xxx"], // string,备份负责人 + "dept_id": 1234, // int,组织架构ID + "op_product_id": 1234, // int,运营产品ID + "bk_biz_id": 1312, // int,业务ID + "status": "xxxx", // string,账号状态 + "memo": "xxxxx", // string,备忘录 + "creator": "xx", // string,创建者 + "reviser": "", // string,修改者 + "created_at": "", // string,创建时间 + "updated_at": "", // string,修改时间 + } + //... + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | array | 响应数据 | + +#### data + + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|-------| +| count | int32 | 总记录条数 | +| details | array | 详情数据 | + +#### details + +| 参数名称 | 参数类型 | 描述 | +|---------------------|--------------|----------------| +| id | string | 资源ID | +| vendor | string | 云厂商 | +| email | string | 邮箱 | +| cloud_id | string | 云ID | +| parent_account_name | string | 父账号名称 | +| parent_account_id | string | 父账号ID | +| site | string | 站点 | +| business_type | string | 业务类型 | +| status | string | 状态 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| dept_id | int | 部门ID | +| op_product_id | int | 运营产品ID | +| bk_biz_id | int | 业务ID | +| status | string | 状态 | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | diff --git a/docs/api-docs/web-server/docs/resource/account/list_root_account.md b/docs/api-docs/web-server/docs/resource/account/list_root_account.md new file mode 100644 index 0000000000..bc47803d17 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/list_root_account.md @@ -0,0 +1,181 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:一级账号管理。 +- 该接口功能描述:获取一级账号列表。 + +### URL + +POST /api/v1/account/root_accounts/list + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------|--------|-----|--------| +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|-----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|---------------------|--------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | json | 主账号管理者列表 | +| bak_managers | json | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| extension | json | 扩展字段 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "count": 10, + "details": [ + { + "id": "xxxx", // id + "name": "xxx", // 名字 + "vendor": "aws", // string,云厂商 + "cloud_id": "xxxx", // string,云ID + "email": "xxxx@tencent.com", // 邮箱 + "managers": ["xxx","xxx"], // string,负责人,最大5个 + "bak_managers": ["xxx","xxx"],// string,备份负责人 + "site": "international", // string,站点 + "dept_id": 1234, // int,组织架构ID + "memo": "xxxxx", // string,备忘录 + "creator": "xx", // string,创建者 + "reviser": "", // string,修改者 + "created_at": "", // string,创建时间 + "updated_at": "" // string,修改时间 + } + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | array | 响应数据 | + +#### data + + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|-------| +| count | int32 | 总记录条数 | +| details | array | 详情数据 | + +#### details[n] + +| 参数名称 | 参数类型 | 描述 | +|--------------|--------------|------------| +| id | string | 资源ID | +| name | string | 名称 | +| vendor | string | 云厂商 | +| cloud_id | string | 云ID | +| email | string | 邮箱 | +| managers | string array | 主账号管理者列表 | +| bak_managers | string array | 主账号备份管理者列表 | +| site | string | 站点 | +| dept_id | int | 部门ID | +| memo | string | 备注 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 修改时间 | + diff --git a/docs/api-docs/web-server/docs/resource/account/update_root_account.md b/docs/api-docs/web-server/docs/resource/account/update_root_account.md new file mode 100644 index 0000000000..388049a78a --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/account/update_root_account.md @@ -0,0 +1,83 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:一级账号管理。 +- 该接口功能描述:修改一级账号。 + +### URL + +PATCH /api/v1/account/root_accounts/{account_id} + +### 请求参数 + +| 参数名称 | 是否必选 | 类型 | 描述 | +|--------------|------|--------------|-----------------| +| account_id | 是 | string | 二级账号ID | +| name | 否 | string | 名称 | +| managers | 否 | string array | 主账号管理者列表,最大5个 | +| bak_managers | 否 | string array | 主账号备份管理者列表,最大5个 | +| memo | 否 | string | 备注 | +| dept_id | 否 | int64 | 部门ID | +| extension | 否 | object | 扩展字段 | + +#### extension字段说明 + +##### aws + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------------------|--------|----|---------| +| cloud_iam_username | string | 是 | 云IAM用户名 | +| cloud_secret_id | string | 是 | 云密钥ID | +| cloud_secret_key | string | 是 | 云密钥KEY | + +##### gcp + +| 参数名称 | 参数类型 | 必选 | 描述 | +|----------------------------|--------|----|----------| +| cloud_project_name | string | 是 | 云项目名 | +| cloud_service_account_id | string | 是 | 云服务账号ID | +| cloud_service_account_name | string | 是 | 云服务账号名 | +| cloud_service_secret_id | string | 是 | 云服务密钥ID | +| cloud_service_secret_key | string | 是 | 云服务密钥KEY | + +##### azure +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|--------| +| cloud_tenant_id | string | 是 | 云租户ID | +| cloud_subscription_name | string | 是 | 云订阅名 | +| cloud_application_id | string | 是 | 云应用ID | +| cloud_application_name | string | 是 | 云应用名 | +| cloud_client_secret_key | string | 是 | 云客户端密钥 | + + +##### huawei +| 参数名称 | 参数类型 | 必选 | 描述 | +|------------------------|--------|----|----------| +| cloud_sub_account_name | string | 是 | 二级账号名 | +| cloud_secret_id | string | 是 | 云密钥ID | +| cloud_secret_key | string | 是 | 云密钥KEY | +| cloud_iam_user_id | string | 是 | 云IAM用户ID | +| cloud_iam_username | string | 是 | 云IAM用户名 | + +##### zenlayer/kaopu + +null,无需传值 + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": {} +} + +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | diff --git a/docs/api-docs/web-server/docs/resource/bill/confirm_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/confirm_adjustment_item.md new file mode 100644 index 0000000000..81af91b774 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/confirm_adjustment_item.md @@ -0,0 +1,43 @@ + +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:确认调账明细,确认后不可再修改、删除。 + +### URL + +POST /api/v1/account/bills/adjustment_items/confirm + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|------|--------------|----|--------| +| ids | string array | 是 | 调账明细列表 | + +### 调用示例 + +```json +{ + "ids": [ + "00000001", + "00000002" + ] +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "ok" +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | diff --git a/docs/api-docs/web-server/docs/resource/bill/confirm_root_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/confirm_root_account_summarys.md new file mode 100644 index 0000000000..2301ba8f8c --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/confirm_root_account_summarys.md @@ -0,0 +1,47 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:确认一级账号账单。 + +### URL + +POST /api/v1/account/bills/root_account_summarys/confirm + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|-----------------|--------|----|--------| +| root_account_id | string | 是 | 一级账号ID | +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | + +### 调用示例 + +```json +{ + "root_account_id": "xxxx", + "bill_year": 2021, + "bill_month": 1 +} +``` + + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "" +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | + diff --git a/docs/api-docs/web-server/docs/resource/bill/create_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/create_adjustment_item.md new file mode 100644 index 0000000000..5c60beafe8 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/create_adjustment_item.md @@ -0,0 +1,84 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:批量创建调账明细 + +### URL + +POST /api/v1/account/vendors/{vendor}/bills/adjustment_items/create + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-----------------|-----------------------|----|---------| +| root_account_id | string | 是 | 所属根账号id | +| vendor | string | 是 | 所属厂商 | +| items | adjustment_item array | 是 | 调账明细列表 | + +### adjustment_item + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-----------------|--------|----|-----------------------------| +| root_account_id | string | 否 | 所属根账号id | +| main_account_id | string | 是 | 所属主账号id | +| product_id | int | 否 | 运营产品id | +| bk_biz_id | int | 否 | 业务id | +| bill_year | int | 否 | 所属年份 | +| bill_month | int | 否 | 所属月份 | +| bill_day | int | 是 | 所属日期 | +| type | string | 是 | 调账类型 枚举值(increase、decrease) | +| currency | string | 是 | 币种 | +| cost | string | 是 | 金额 | +| memo | string | 否 | 备注信息 | + +### 调用示例 + +```json +{ + "root_account_id": "00000001", + "vendor": "huawei", + "items": [ + { + "root_account_id": "00000001", + "main_account_id": "00000001", + "product_id": 6667, + "bk_biz_id": 1234, + "bill_year": 2024, + "bill_month": 6, + "type": "increase", + "memo": "", + "currency": "RMB", + "cost": "123", + "rmb_cost": "123" + } + ] +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "id": "00000001" + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|------|--------|--------| +| id | string | 调账明细id | + diff --git a/docs/api-docs/web-server/docs/resource/bill/delete_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/delete_adjustment_item.md new file mode 100644 index 0000000000..8688850025 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/delete_adjustment_item.md @@ -0,0 +1,43 @@ + +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:批量删除调账明细,已确定的调账明细不能删除。 + +### URL + +DELETE /api/v1/account/bills/adjustment_items/batch + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|------|--------------|----|--------| +| ids | string array | 是 | 调账明细列表 | + +### 调用示例 + +```json +{ + "ids": [ + "00000001", + "00000002" + ] +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "ok" +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | diff --git a/docs/api-docs/web-server/docs/resource/account/export_bill_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/export_bill_adjustment_item.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/export_bill_adjustment_item.md rename to docs/api-docs/web-server/docs/resource/bill/export_bill_adjustment_item.md diff --git a/docs/api-docs/web-server/docs/resource/account/export_bill_item.md b/docs/api-docs/web-server/docs/resource/bill/export_bill_item.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/export_bill_item.md rename to docs/api-docs/web-server/docs/resource/bill/export_bill_item.md diff --git a/docs/api-docs/web-server/docs/resource/account/export_bill_main_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/export_bill_main_account_summarys.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/export_bill_main_account_summarys.md rename to docs/api-docs/web-server/docs/resource/bill/export_bill_main_account_summarys.md diff --git a/docs/api-docs/web-server/docs/resource/account/export_bill_root_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/export_bill_root_account_summarys.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/export_bill_root_account_summarys.md rename to docs/api-docs/web-server/docs/resource/bill/export_bill_root_account_summarys.md diff --git a/docs/api-docs/web-server/docs/resource/account/export_biz_summary.md b/docs/api-docs/web-server/docs/resource/bill/export_biz_summary.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/export_biz_summary.md rename to docs/api-docs/web-server/docs/resource/bill/export_biz_summary.md diff --git a/docs/api-docs/web-server/docs/resource/account/import_bill_items.md b/docs/api-docs/web-server/docs/resource/bill/import_bill_items.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/import_bill_items.md rename to docs/api-docs/web-server/docs/resource/bill/import_bill_items.md diff --git a/docs/api-docs/web-server/docs/resource/account/import_bill_items_preview.md b/docs/api-docs/web-server/docs/resource/bill/import_bill_items_preview.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/import_bill_items_preview.md rename to docs/api-docs/web-server/docs/resource/bill/import_bill_items_preview.md diff --git a/docs/api-docs/web-server/docs/resource/bill/list_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/list_adjustment_item.md new file mode 100644 index 0000000000..422395b4ef --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_adjustment_item.md @@ -0,0 +1,151 @@ + +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:查询调账明细 + +### URL + +POST /api/v1/account/bills/adjustment_items/list + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------|--------|----|--------| +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|-----------------|--------|--------------------------------| +| id | string | 调账id | +| root_account_id | string | 所属根账号id | +| main_account_id | string | 所属主账号id | +| product_id | int | 运营产品id | +| bk_biz_id | int | 业务id | +| bill_year | int | 所属年份 | +| bill_month | int | 所属月份 | +| bill_day | int | 所属日期 | +| type | string | 调账类型 increase/decrease | +| memo | string | 备注 | +| operator | string | 操作人 | +| currency | string | 币种 RMB/USD | +| cost | string | 原币种消费(元) | +| rmb_cost | string | 人民币消费 | +| state | string | 未确定、已确定 | +| creator | string | 创建者 | +| created_at | string | 创建时间,标准格式:2006-01-02T15:04:05Z | +| updated_at | string | 修改时间,标准格式:2006-01-02T15:04:05Z | + +### 调用示例 + +```json +{ + "count": 0, + "details": [ + { + "id": "0000000b", + "root_account_id": "00000001", + "main_account_id": "00000001", + "product_id": 3043, + "bk_biz_id": 100857, + "bill_year": 2024, + "bill_month": 6, + "bill_day": 18, + "type": "increase", + "memo": "", + "operator": "ryanjrchen", + "currency": "RMB", + "cost": "42.67512105", + "rmb_cost": "42.67512105", + "state": "已确定", + "creator": "ryanjrchen", + "created_at": "2024-06-18T13:09:34Z", + "updated_at": "2024-06-18T13:09:34Z" + } + ] +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 0, + "details": [ + { + "id": "00000001", + "root_account_id": "00000001", + "main_account_id": "00000001", + "product_id": 3456, + "bk_biz_id": 1, + "bill_year": 2024, + "bill_month": 6, + "bill_day": 18, + "type": "increase", + "memo": "", + "operator": "admin", + "currency": "RMB", + "cost": "42.67512105", + "rmb_cost": "42.67512105", + "state": "confirmed", + "creator": "admin", + "created_at": "2024-06-18T13:09:34Z", + "updated_at": "2024-06-18T13:09:34Z" + } + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|-----------------|--------|--------------------------------| +| id | string | 调账id | +| root_account_id | string | 所属根账号id | +| main_account_id | string | 所属主账号id | +| product_id | int | 运营产品id | +| bk_biz_id | int | 业务id | +| bill_year | int | 所属年份 | +| bill_month | int | 所属月份 | +| bill_day | int | 所属日期 | +| type | string | 调账类型 increase/decrease | +| memo | string | 备注 | +| operator | string | 操作人 | +| currency | string | 币种 RMB/USD | +| cost | string | 原币种消费(元) | +| rmb_cost | string | 人民币消费 | +| state | string | 未确定、已确定 | +| creator | string | 创建者 | +| created_at | string | 创建时间,标准格式:2006-01-02T15:04:05Z | +| updated_at | string | 修改时间,标准格式:2006-01-02T15:04:05Z | + diff --git a/docs/api-docs/web-server/docs/resource/bill/list_bill_item.md b/docs/api-docs/web-server/docs/resource/bill/list_bill_item.md new file mode 100644 index 0000000000..0d86243222 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_bill_item.md @@ -0,0 +1,447 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单查看权限。 +- 该接口功能描述:获取账单明细。 + +### URL + +POST /api/v1/account/vendors/{vendor}/bills/items/list + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|------------|--------|----|--------| +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|-----------------|---------|--------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| main_account_id | string | 二级账号ID | +| vendor | string | 云厂商 | +| product_id | int64 | 产品ID | +| bk_biz_id | int64 | 业务ID | +| bill_year | int64 | 账单年份 | +| bill_month | int32 | 账单月份 | +| bill_day | int32 | 账单日 | +| version_id | int64 | 版本号 | +| currency | string | 货币类型 | +| cost | decimal | 费用 | +| hc_product_code | string | 产品编码 | +| hc_product_name | string | 产品名称 | +| res_amount | decimal | 资源金额 | +| res_amount_unit | string | 资源金额单位 | +| extension | json | 扩展字段 | +| creator | string | 创建者 | +| reviser | string | 修改者 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 123412, + "details": [ + { + "id": "00000001", + "root_account_id": "00000001", + "main_account_id": "00000001", + "vendor": "aws", + "product_id": 123456, + "bk_biz_id": 123456, + "bill_year": 2021, + "bill_month": 1, + "bill_day": 1, + "version_id": 123456, + "currency": "USD", + "cost": "100.00", + "hc_product_code": "hcbm001", + "hc_product_name": "云主机", + "res_amount": "100.00", + "res_amount_unit": "USD", + "creator": "admin", + "reviser": "admin", + "created_at": "2021-01-01T00:00:00Z", + "updated_at": "2021-01-01T00:00:00Z", + "extension": null + } + ] + } +} +``` + + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 返回数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|------| +| count | int64 | 总数 | +| details | array | 详细数据 | + +#### details + +| 参数名称 | 参数类型 | 描述 | +|-------------------|---------|------------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| main_account_id | string | 二级账号ID | +| vendor | string | 云厂商 | +| product_id | int64 | 产品ID | +| bk_biz_id | int64 | 业务ID | +| bill_year | int64 | 账单年份 | +| bill_month | int32 | 账单月份 | +| bill_day | int32 | 账单日 | +| version_id | int64 | 版本号 | +| currency | string | 货币类型 | +| cost | decimal | 费用 | +| hc_product_code | string | 产品编码 | +| hc_product_name | string | 产品名称 | +| res_amount | decimal | 资源金额 | +| res_amount_unit | string | 资源金额单位 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | +| main_account_name | string | 二级账号名称 | +| root_account_name | string | 一级账号名称 | +| extension | object | 云厂商的原始账单结构 | + +#### extension + +##### aws + +| 参数名称 | 参数类型 | 描述 | +|------------------------------------------------------------------|--------|---------------------| +| bill_bill_type | string | 计费类别 | +| bill_billing_entity | string | 账单实体 | +| bill_billing_period_end_date | string | 账单周期截止日期 | +| bill_billing_period_start_date | string | 账单周期开始日期 | +| bill_invoice_id | string | 账单清单ID | +| bill_invoicing_entity | string | 账单清单实体 | +| bill_payer_account_id | string | 账单支付账号ID | +| discount_edp_discount | string | edp优惠金额 | +| discount_total_discount | string | 总优惠金额 | +| identity_line_item_id | string | 项目ID | +| identity_time_interval | string | 标识时间间隔 | +| line_item_availability_zone | string | 可用区 | +| line_item_blended_cost | string | 混合成本 | +| line_item_blended_rate | string | 混合费率 | +| line_item_currency_code | int | 项目当前代码 | +| line_item_legal_entity | string | 项目合法实体 | +| line_item_line_item_description | string | 计费描述 | +| line_item_line_item_type | string | 项目类型 | +| line_item_net_unblended_cost | string | 未混合折后成本 | +| line_item_net_unblended_rate | string | 未混合折后费率 | +| line_item_normalization_factor | string | 项目规范因子 | +| line_item_normalized_usage_amount | string | 规范化使用费用 | +| line_item_operation | string | 项目操作 | +| line_item_product_code | string | 项目产品代码 | +| line_item_resource_id | string | 资源ID | +| line_item_tax_type | string | 项目税费类型 | +| line_item_unblended_cost | string | 未混合成本 | +| line_item_unblended_rate | string | 未混合费率 | +| line_item_usage_account_id | string | 使用的账号ID | +| line_item_usage_amount | string | 使用金额 | +| line_item_usage_end_date | string | 使用截止日期 | +| line_item_usage_start_date | string | 使用开始日期 | +| line_item_usage_type | string | 使用类型 | +| pricing_currency | string | 定价货币 | +| pricing_lease_contract_length | string | 定价合同长度 | +| pricing_offering_class | string | 报价类别 | +| pricing_public_on_demand_cost | string | 定价公开需求成本 | +| pricing_public_on_demand_rate | string | 定价公开需求费率 | +| pricing_purchase_option | string | 付款方式:全量预付、部分预付、无预付 | +| pricing_term | string | 使用量是预留还是按需 | +| pricing_unit | string | 费用计价单位 | +| product_database_engine | string | 产品数据库引擎 | +| product_from_location | string | 产品来源 | +| product_from_location_type | string | 产品来源类型 | +| product_from_region_code | string | 产品区域编码 | +| product_instance_type | string | 产品实例类型 | +| product_instance_type_family | string | 产品实例类型系列 | +| product_location | string | 产品定位 | +| product_location_type | string | 产品定位类型 | +| product_marketoption | string | 市场选项 | +| product_normalization_size_factor | string | 产品规格因子 | +| product_operation | string | 产品操作 | +| product_product_family | string | 产品系列 | +| product_product_name | string | 产品名称 | +| product_purchase_option | string | 产品采购选项 | +| product_purchaseterm | string | 产品采购条款 | +| product_region | string | 产品区域 | +| product_region_code | string | 产品区域编码 | +| product_servicecode | string | 产品服务编码 | +| product_servicename | string | 产品服务名称 | +| product_tenancy | string | 产品库存 | +| product_to_location | string | 产品指向的位置 | +| product_to_location_type | string | 产品指向的位置类型 | +| product_to_region_code | string | 产品指向的区域的编码 | +| product_transfer_type | string | 产品传输类型 | +| reservation_amortized_upfront_cost_for_usage | string | 预留摊销前期使用成本 | +| reservation_amortized_upfront_fee_for_billing_period | string | 预留摊销预付费账单周期 | +| reservation_effective_cost | string | 预留有效成本 | +| reservation_end_time | string | 预留截止时间 | +| reservation_modification_status | string | 预留修改状态 | +| reservation_net_amortized_upfront_cost_for_usage | string | 预留网络摊销可用成本 | +| reservation_net_amortized_upfront_fee_for_billing_period | string | 预留网络摊销预付费账单周期 | +| reservation_net_effective_cost | string | 预留网络有效成本 | +| reservation_net_recurring_fee_for_usage | string | 预留可用的常用费用 | +| reservation_net_unused_amortized_upfront_fee_for_billing_period | string | 预留网络未使用预付费账单周期 | +| reservation_net_unused_recurring_fee | string | 预留网络未使用常用费用 | +| reservation_net_upfront_value | string | 预留前期净值 | +| reservation_normalized_units_per_reservation | string | 预留规范化单位每次保留量 | +| reservation_number_of_reservations | string | 预留数量 | +| reservation_recurring_fee_for_usage | string | 预留可用的常用费用 | +| reservation_reservation_a_r_n | string | 预留的ARN | +| reservation_start_time | string | 预留开始时间 | +| reservation_subscription_id | string | 预留的订阅ID | +| reservation_total_reserved_normalized_units | string | 预留总服务标准化单位 | +| reservation_total_reserved_units | string | 预留总服务单位 | +| reservation_units_per_reservation | string | 预留每次保留的单位 | +| reservation_unused_amortized_upfront_fee_for_billing_period | string | 预留未使用冻结的预付费计费周期 | +| reservation_unused_normalized_unit_quantity | string | 预留未使用规范化单位数量 | +| reservation_unused_quantity | string | 预留未使用的数量 | +| reservation_unused_recurring_fee | string | 预留未使用的现金 | +| reservation_upfront_value | string | 预留上行数值 | +| savings_plan_amortized_upfront_commitment_for_billing_period | string | 账单期的计划摊销前期承诺 | +| savings_plan_end_time | string | SavingsPlan截止时间 | +| savings_plan_net_amortized_upfront_commitment_for_billing_period | string | SavingsPlan承诺账单周期 | +| savings_plan_net_recurring_commitment_for_billing_period | string | SavingsPlan计划净现金周期 | +| savings_plan_net_savings_plan_effective_cost | string | SavingsPlan网络有效成本 | +| savings_plan_offering_type | string | SavingsPlan报价类型 | +| savings_plan_payment_option | string | SavingsPlan支付类型 | +| savings_plan_purchase_term | string | SavingsPlan采购期限 | +| savings_plan_recurring_commitment_for_billing_period | string | SavingsPlan现金承诺账单周期 | +| savings_plan_region | string | SavingsPlan区域 | +| savings_plan_savings_plan_a_r_n | string | SavingsPlanARN | +| savings_plan_savings_plan_effective_cost | string | SavingsPlan有效成本 | +| savings_plan_savings_plan_rate | string | SavingsPlan计划费率 | +| savings_plan_start_time | string | SavingsPlan计划开始时间 | +| savings_plan_total_commitment_to_date | string | SavingsPlan总承诺日期 | +| savings_plan_used_commitment | string | SavingsPlan已使用承诺 | + +##### huawei + + +| 参数名称 | 参数类型 | 描述 | +|-----------------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| cycle | string | 资源详单数据所在账期,东八区时间,格式为YYYY-MM。 例如2020-01 | +| bill_date | string | 消费日期,东八区时间,格式为YYYY-MM-DD。 说明: 当statistic_type=2时该字段才有值,否则返回null。 | +| bill_type | int64 | 账单类型。 1:消费-新购2:消费-续订3:消费-变更4:退款-退订5:消费-使用8:消费-自动续订9:调账-补偿14:消费-服务支持计划月末扣费15:消费-税金16:调账-扣费17:消费-保底差额 说明: 保底差额=客户签约保底合同后,如果没有达到保底消费,客户需要补交的费用,仅限于直销或者伙伴顾问销售类子客户,且为后付费用户。 20:退款-变更100:退款-退订税金101:调账-补偿税金102:调账-扣费税金 | +| customer_id | string | 消费的客户账号ID | +| region | string | 云服务区编码,例如:“ap-southeast-1” | +| region_name | string | 云服务区名称,例如:“中国-香港” | +| cloud_service_type | string | 云服务类型编码 | +| resource_Type_code | string | 资源类型编码 | +| cloud_service_type_name | string | 云服务类型名称 | +| resource_type_name | string | 资源类型名称 | +| res_instance_id | string | 资源实例ID | +| resource_name | string | 资源名称 | +| resource_tag | string | 资源标签 | +| sku_code | string | SKU编码,在账单中唯一标识一个资源的规格 | +| enterprise_project_id | string | 企业项目标识(企业项目ID) | +| enterprise_project_name | string | 企业项目名称 | +| charge_mode | int64 | 计费模式。 1 : 包年/包月3:按需10:预留实例 | +| consume_amount | float64 | 客户购买云服务类型的消费金额,包含代金券、现金券,精确到小数点后8位。说明: consume_amount的值等于cash_amount,credit_amount,coupon_amount,flexipurchase_coupon_amount,stored_card_amount,bonus_amount,debt_amount,adjustment_amount的总和 | +| cash_amount | float64 | 现金支付金额 | +| credit_amount | float64 | 信用额度支付金额 | +| coupon_amount | float64 | 代金券支付金额 | +| flexipurchase_coupon_amount | float64 | 现金券支付金额 | +| stored_card_amount | float64 | 储值卡支付金额 | +| bonus_amount | float64 | 奖励金支付金额 | +| debt_amount | float64 | 欠费金额 | +| adjustment_amount | float64 | 欠费核销金额 | +| official_amount | float64 | 官网价 | +| discount_amount | float64 | 对应官网价折扣金额 | +| measure_id | int64 | 金额单位。 1:元 | +| period_type | int64 | 周期类型: 19:年20:月24:天25:小时5:一次性 | +| root_resource_id | string | 根资源标识 | +| parent_resource_id | string | 父资源标识 | +| trade_id | string | 订单ID 或 交易ID。 账单类型为1,2,3,4,8时为订单ID;其它场景下为: 交易ID(非月末扣费:应收ID;月末扣费:账单ID) | +| product_spec_desc | string | 产品的规格描述 | +| sub_service_type_code | string | 该字段为预留字段 | +| sub_service_type_name | string | 该字段为预留字段 | +| sub_resource_type_code | string | 该字段为预留字段 | +| sub_resource_type_name | string | 该字段为预留字段 | +| sub_resource_id | string | 该字段为预留字段 | +| sub_resource_name | string | 该字段为预留字段 | +| pre_order_id | string | 该字段为预留字段 | +| az_code_infos | array of AzCodeInfo | 该字段为预留字段 | + +###### details[n].AzCodeInfo + +| 参数名称 | 参数类型 | 描述 | +|--------|--------|------------------------------------------| +| az_code | string | 参数名称:可用区编码,参数的约束及描述:该参数非必填,且只允许字符串 | + + +##### azure/kaopu + +null + + +##### gcp + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|--------------------------------| +| billing_account_id | string | 与使用量相关的 Cloud Billing 账号ID | +| cost | float64 | 成本 | +| cost_type | string | 费用类型 | +| country | string | 国家 | +| credits_amount | string | 赠送金信息 | +| currency | string | 币种 | +| currency_conversion_rate | float64 | 货币转换率 | +| location | string | 区域信息 | +| month | string | 账单年月 | +| project_id | string | 项目ID | +| project_name | string | 项目名称 | +| project_number | string | 项目编号 | +| region | string | 区域 | +| resource_global_name | string | 资源全局唯一标识符 | +| resource_name | string | 资源名称 | +| service_description | string | 服务描述 | +| service_id | string | 服务ID | +| sku_description | string | 资源类型描述 | +| sku_id | string | 资源类型ID | +| total_cost | float64 | 总成本 | +| return_cost | float64 | 退款成本 | +| usage_amount | string | 可用金额 | +| usage_amount_in_pricing_units | string | 可用金额单价 | +| usage_end_time | string | 可用结束时间,示例:2023-04-16T15:00:00Z | +| usage_pricing_unit | float64 | 可用金额单价的单位 | +| usage_start_time | string | 可用开始时间,示例:2023-04-16T15:00:00Z | +| usage_unit | string | 可用金额单位 | +| zone | string | 可用区 | +| credit_infos | array | credit_info | + +###### credit_infos[n] + +| 参数名称 | 参数类型 | 描述 | +|-----------|---------|----| +| id | string | ID | +| amount | float64 | 金额 | +| type | string | 类型 | +| name | string | 名称 | +| full_name | string | 全称 | + +##### zenlayer + +| 参数名称 | 参数类型 | 描述 | +|-----------------|---------|--------------| +| bill_id | string | 账单ID | +| zenlayer_order | string | Zenlayer订单编号 | +| cid | string | CID | +| group_id | string | GROUP ID | +| currency | string | 币种 | +| city | string | 城市 | +| pay_content | string | 付费内容 | +| type | string | 类型 | +| acceptance_num | decimal | 验收数量 | +| pay_num | decimal | 付费数量 | +| unit_price_usd | decimal | 单价USD | +| total_payable | decimal | 应付USD | +| billing_period | string | 账期 | +| contract_period | string | 合约周期 | +| remarks | string | 备注 | +| business_group | string | 业务组 | +| cpu | string | CPU | +| disk | string | 硬盘 | +| memory | string | 内存 | diff --git a/docs/api-docs/web-server/docs/resource/account/list_biz_summary.md b/docs/api-docs/web-server/docs/resource/bill/list_biz_summary.md similarity index 100% rename from docs/api-docs/web-server/docs/resource/account/list_biz_summary.md rename to docs/api-docs/web-server/docs/resource/bill/list_biz_summary.md diff --git a/docs/api-docs/web-server/docs/resource/bill/list_exchange_rate.md b/docs/api-docs/web-server/docs/resource/bill/list_exchange_rate.md new file mode 100644 index 0000000000..bb671708f2 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_exchange_rate.md @@ -0,0 +1,107 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:查询汇率 + +### URL + +POST /api/v1/account/bills/exchange_rates/list + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------|--------|----|--------| +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|---------------|--------|------| +| year | int | 所属年份 | +| month | int | 所属月份 | +| from_currency | string | 原币种 | +| to_currency | string | 目标币种 | + +### 调用示例 + +```json +{ + "filter": { + "op": "and", + "rules": [ + { + "field": "year", + "op": "eq", + "value": 2024 + } + ] + }, + "page": { + "limit": 10 + } +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 0, + "details": [ + { + "id": "1", + "year": 2024, + "month": 6, + "from_currency": "USD", + "to_currency": "CNY", + "exchange_rate": "7.1", + "creator": "admin", + "reviser": "admin", + "created_at": "2024-07-01T01:31:48Z", + "updated_at": "2024-07-01T01:31:48Z" + } + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------------|--------|--------------------------------| +| id | string | 调账id | +| year | int | 所属年份 | +| month | int | 所属月份 | +| from_currency | string | 原币种 | +| to_currency | string | 目标币种 | +| exchange_rate | string | 汇率,字符串形式小数 | +| created_at | string | 创建时间,标准格式:2006-01-02T15:04:05Z | +| updated_at | string | 修改时间,标准格式:2006-01-02T15:04:05Z | diff --git a/docs/api-docs/web-server/docs/resource/bill/list_main_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/list_main_account_summarys.md new file mode 100644 index 0000000000..d8102baf77 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_main_account_summarys.md @@ -0,0 +1,230 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单查看权限。 +- 该接口功能描述:获取当月二级账号账单汇总数据。 + +### URL + +POST /api/v1/account/bills/main_account_summarys/list + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|------------|--------|----|--------| +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_cloud_id | string | 一级账号云ID | +| main_account_id | string | 二级账号ID | +| main_account_cloud_id | string | 二级账号云ID | +| vendor | string | 云厂商 | +| product_id | int64 | 产品ID | +| product_name | string | 产品名称 | +| bk_biz_id | int64 | 业务ID | +| bk_biz_name | string | 业务名称 | +| bill_year | int64 | 账单年份 | +| bill_month | int32 | 账单月份 | +| last_synced_version | int64 | 上一次同步的版本号 | +| current_version | int64 | 当前版本号 | +| currency | string | 货币类型 | +| last_month_cost_synced | decimal | 上月费用 | +| last_month_rmb_cost_synced | decimal | 上月人民币费用 | +| current_month_cost_synced | decimal | 本月费用 | +| current_month_rmb_cost_synced | decimal | 本月人民币费用 | +| month_on_month_value | float | 月同比增长值 | +| current_month_cost | decimal | 本月费用 | +| current_month_rmb_cost | decimal | 本月人民币费用 | +| rate | float | 费用比率 | +| adjustment_cost | decimal | 调整金额 | +| adjustment_rmb_cost | decimal | 调整金额(人民币) | +| state | string | 账单状态 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | + + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 123412, + "details": [ + { + "id": "00000001", + "root_account_id": "00000001", + "root_account_cloud_id": "xxxxx", + "main_account_id": "0000000j", + "main_account_cloud_id": "0000000j", + "vendor": "zenlayer", + "product_id": 111, + "product_name": "", + "bk_biz_id": -1, + "bk_biz_name": "", + "bill_year": 2024, + "bill_month": 7, + "last_synced_version": -1, + "current_version": 1, + "currency": "USD", + "last_month_cost_synced": "0.0000000000", + "last_month_rmb_cost_synced": "0.0000000000", + "current_month_cost_synced": "0.0000000000", + "current_month_rmb_cost_synced": "0.0000000000", + "month_on_month_value": 0, + "current_month_cost": "0.0000000000", + "current_month_rmb_cost": "0.0000000000", + "adjustment_cost": "0.0000000000", + "adjustment_rmb_cost": "0.0000000000", + "rate": 0, + "state": "accounting", + "created_at": "2024-07-30 07:20:46.0", + "updated_at": "2024-08-23 01:33:20.0", + "main_account_name": "xxxxx", + "root_account_name": "xxxxx" + } + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 返回数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|------| +| count | int64 | 总数 | +| details | array | 详细数据 | + +#### details + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_cloud_id | string | 一级账号云ID | +| main_account_id | string | 二级账号ID | +| main_account_cloud_id | string | 二级账号云ID | +| vendor | string | 云厂商 | +| product_id | int64 | 产品ID | +| product_name | string | 产品名称 | +| bk_biz_id | int64 | 业务ID | +| bk_biz_name | string | 业务名称 | +| bill_year | int64 | 账单年份 | +| bill_month | int32 | 账单月份 | +| last_synced_version | int64 | 上一次同步的版本号 | +| current_version | int64 | 当前版本号 | +| currency | string | 货币类型 | +| last_month_cost_synced | decimal | 上月费用 | +| last_month_rmb_cost_synced | decimal | 上月人民币费用 | +| current_month_cost_synced | decimal | 本月费用 | +| current_month_rmb_cost_synced | decimal | 本月人民币费用 | +| month_on_month_value | float | 月同比增长值 | +| current_month_cost | decimal | 本月费用 | +| current_month_rmb_cost | decimal | 本月人民币费用 | +| rate | float | 费用比率 | +| adjustment_cost | decimal | 调整金额 | +| adjustment_rmb_cost | decimal | 调整金额(人民币) | +| state | string | 账单状态 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | +| main_account_name | string | 二级账号名称 | +| root_account_name | string | 一级账号名称 | diff --git a/docs/api-docs/web-server/docs/resource/bill/list_root_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/list_root_account_summarys.md new file mode 100644 index 0000000000..5c4fd276a6 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_root_account_summarys.md @@ -0,0 +1,215 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单查询权限。 +- 该接口功能描述:获取当月一级账号账单汇总数据。 + +### URL + +POST /api/v1/account/bills/root_account_summarys/list + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|------------|--------|----|--------| +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### 查询参数介绍: + + + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------------------------------------------------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_name | string | 一级账号名称 | +| vendor | string | 供应商(枚举值:tcloud、aws、azure、gcp、huawei) | +| bill_year | int | 账单年份 | +| bill_month | int | 账单月份 | +| last_synced_version | int64 | 最后同步的账单版本 | +| current_version | int64 | 当前账单版本 | +| currency | string | 币种 | +| last_month_cost_synced | decimal | 上月已同步账单 | +| last_month_rmb_cost_synced | decimal | 上月已同步人民币账单 | +| current_month_cost_synced | decimal | 本月已同步账单 | +| current_month_rmb_cost_synced | decimal | 本月已同步人民币账单 | +| month_on_month_value | float | 本月已同步账单环比 | +| current_month_cost | decimal | 实时账单 | +| current_month_rmb_cost | decimal | 实时人民币账单 | +| rate | float | 汇率 | +| adjustment_cost | decimal | 实时调账账单 | +| adjustment_rmb_cost | decimal | 实时人民币调账账单 | +| bk_biz_num | int | 业务数量 | +| product_num | int | 运营产品数量 | +| state | string | 状态(accounting, accounted, syncing, synced, stopped) | + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 123412, + "details": [ + { + "id": "xxx", + "root_account_id": "xxx", + "root_account_name": "xxx", + "vendor": "tcloud", + "bill_year": 2021, + "bill_month": 12, + "last_synced_version": -1, + "current_version": 2, + "currency": "USD", + "last_month_cost_synced": "0.0000000000", + "last_month_rmb_cost_synced": "0.0000000000", + "current_month_cost_synced": "0.0000000000", + "current_month_rmb_cost_synced": "0.0000000000", + "month_on_month_value": 0, + "current_month_cost": "0.0000000000", + "current_month_rmb_cost": "0.0000000000", + "rate": 0, + "adjustment_cost": "0.0000000000", + "adjustment_rmb_cost": "0.0000000000", + "state": "confirmed", + "bk_biz_num": 1, + "product_num": 2, + "created_at": "2024-07-03 03:40:18.0", + "updated_at": "2024-07-03 03:40:18.0" + } + ] + } +} +``` + + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 返回数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|------| +| count | int64 | 总数 | +| details | array | 详情数据 | + +#### details[n] + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------------------------------------------------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_name | string | 一级账号名称 | +| vendor | string | 供应商(枚举值:tcloud、aws、azure、gcp、huawei) | +| bill_year | int | 账单年份 | +| bill_month | int | 账单月份 | +| last_synced_version | int64 | 最后同步的账单版本 | +| current_version | int64 | 当前账单版本 | +| currency | string | 币种 | +| last_month_cost_synced | decimal | 上月已同步账单 | +| last_month_rmb_cost_synced | decimal | 上月已同步人民币账单 | +| current_month_cost_synced | decimal | 本月已同步账单 | +| current_month_rmb_cost_synced | decimal | 本月已同步人民币账单 | +| month_on_month_value | float | 本月已同步账单环比 | +| current_month_cost | decimal | 实时账单 | +| current_month_rmb_cost | decimal | 实时人民币账单 | +| rate | float | 汇率 | +| adjustment_cost | decimal | 实时调账账单 | +| adjustment_rmb_cost | decimal | 实时人民币调账账单 | +| state | string | 状态(accounting, accounted, syncing, synced, stopped) | +| bk_biz_num | int | 业务数量 | +| product_num | int | 运营产品数量 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | \ No newline at end of file diff --git a/docs/api-docs/web-server/docs/resource/bill/list_sync_bill_record.md b/docs/api-docs/web-server/docs/resource/bill/list_sync_bill_record.md new file mode 100644 index 0000000000..7e29ae8a41 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/list_sync_bill_record.md @@ -0,0 +1,182 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单查看权限。 +- 该接口功能描述:账单同步记录查询。 + +### URL + +POST /api/v1/account/bills/sync_records/list + + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------|--------|-----|--------| +| filter | object | 是 | 查询过滤条件 | +| page | object | 是 | 分页设置 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|-----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### page + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|--------|-----|-----------------------------------------------------------------------------------------------------------------------------------------------------| +| count | bool | 是 | 是否返回总记录条数。 如果为true,查询结果返回总记录条数 count,但查询结果详情数据 details 为空数组,此时 start 和 limit 参数将无效,且必需设置为0。如果为false,则根据 start 和 limit 参数,返回查询结果详情数据,但总记录条数 count 为0 | +| start | uint32 | 否 | 记录开始位置,start 起始值为0 | +| limit | uint32 | 否 | 每页限制条数,最大500,不能为0 | +| sort | string | 否 | 排序字段,返回数据将按该字段进行排序 | +| order | string | 否 | 排序顺序(枚举值:ASC、DESC) | + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|------------|---------|------------| +| id | string | 资源ID | +| vendor | string | 云服务商名称 | +| bill_year | int | 账单年份 | +| bill_month | int | 账单月份 | +| state | string | 账单状态 | +| currency | string | 货币 | +| cost | decimal | 账单总金额 | +| rmb_cost | decimal | 账单总金额(人民币) | +| detail | string | 账单详情 | +| operator | string | 操作人 | +| creator | string | 创建人 | +| reviser | string | 最后修改人 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 0, + "details": [ + { + "id": "0000000c", + "vendor": "huawei", + "bill_year": 2024, + "bill_month": 5, + "state": "asyncing", + "currency": "USD", + "cost": "669064.3429381", + "rmb_cost": "4755408.2706496926", + "detail": "", + "operator": "xxx", + "creator": "xxxx", + "reviser": "xxx", + "created_at": "2024-06-26T00:07:50Z", + "updated_at": "2024-06-26T00:07:50Z" + } + ] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|-------|-------| +| count | int | 总记录条数 | +| details | array | 账单列表 | + +#### details参数说明 + +| 参数名称 | 参数类型 | 描述 | +|------------|---------|------------| +| id | string | 资源ID | +| vendor | string | 云服务商名称 | +| bill_year | int | 账单年份 | +| bill_month | int | 账单月份 | +| state | string | 账单状态 | +| currency | string | 货币 | +| cost | decimal | 账单总金额 | +| rmb_cost | decimal | 账单总金额(人民币) | +| detail | string | 账单详情 | +| operator | string | 操作人 | +| creator | string | 创建人 | +| reviser | string | 最后修改人 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | diff --git a/docs/api-docs/web-server/docs/resource/bill/reaccount_root_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/reaccount_root_account_summarys.md new file mode 100644 index 0000000000..969b49a9bb --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/reaccount_root_account_summarys.md @@ -0,0 +1,47 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:重新核算一级账号账单。 + +### URL + +POST /api/v1/account/bills/root_account_summarys/reaccount + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|-----------------|--------|----|--------| +| root_account_id | string | 是 | 一级账号ID | +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | + +### 调用示例 + +```json +{ + "root_account_id": "xxxx", + "bill_year": 2021, + "bill_month": 1 +} +``` + + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "" +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | + diff --git a/docs/api-docs/web-server/docs/resource/bill/sum_main_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/sum_main_account_summarys.md new file mode 100644 index 0000000000..8149e760b7 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/sum_main_account_summarys.md @@ -0,0 +1,168 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:获取当月筛选出来的二级账号总金额。 + +### URL + +POST /api/v1/account/bills/main_account_summarys/sum + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|-----------------|--------|----|--------| +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | +| filter | object | 是 | 查询过滤条件 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### 查询参数介绍: + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_cloud_id | string | 一级账号云ID | +| main_account_id | string | 二级账号ID | +| main_account_cloud_id | string | 二级账号云ID | +| vendor | string | 云厂商 | +| product_id | int64 | 产品ID | +| product_name | string | 产品名称 | +| bk_biz_id | int64 | 业务ID | +| bk_biz_name | string | 业务名称 | +| bill_year | int64 | 账单年份 | +| bill_month | int32 | 账单月份 | +| last_synced_version | int64 | 上一次同步的版本号 | +| current_version | int64 | 当前版本号 | +| currency | string | 货币类型 | +| last_month_cost_synced | decimal | 上月费用 | +| last_month_rmb_cost_synced | decimal | 上月人民币费用 | +| current_month_cost_synced | decimal | 本月费用 | +| current_month_rmb_cost_synced | decimal | 本月人民币费用 | +| month_on_month_value | float | 月同比增长值 | +| current_month_cost | decimal | 本月费用 | +| current_month_rmb_cost | decimal | 本月人民币费用 | +| rate | float | 费用比率 | +| adjustment_cost | decimal | 调整金额 | +| adjustment_rmb_cost | decimal | 调整金额(人民币) | +| state | string | 账单状态 | +| created_at | string | 创建时间 | +| updated_at | string | 更新时间 | + + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 123412, + "cost_map": { + "USD": { + "Cost": "781223.32650609", + "RMBCost": "5552583.8543083598", + "Currency": "USD" + } + } + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 返回数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|----------|-------------------|-----| +| count | int64 | 总数 | +| cost_map | map[string]object | 费用表 | + + +#### cost_map + +key: 币种 +value: 费用 + +| 参数名称 | 参数类型 | 描述 | +|----------|--------|-------| +| Cost | string | 费用 | +| RMBCost | string | 人民币费用 | +| Currency | string | 币种 | diff --git a/docs/api-docs/web-server/docs/resource/bill/sum_root_account_summarys.md b/docs/api-docs/web-server/docs/resource/bill/sum_root_account_summarys.md new file mode 100644 index 0000000000..1b27a6710d --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/sum_root_account_summarys.md @@ -0,0 +1,163 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:获取当月筛选出来的一级账号总金额。 + +### URL + +POST /api/v1/account/bills/root_account_summarys/sum + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|-----------------|--------|----|--------| +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | +| filter | object | 是 | 查询过滤条件 | + +#### filter + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|-----------------------------------------------------------------| +| op | enum string | 是 | 操作符(枚举值:and、or)。如果是and,则表示多个rule之间是且的关系;如果是or,则表示多个rule之间是或的关系。 | +| rules | array | 是 | 过滤规则,最多设置5个rules。如果rules为空数组,op(操作符)将没有作用,代表查询全部数据。 | + +#### rules[n] (详情请看 rules 表达式说明) + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------|-------------|----|---------------------------------------------| +| field | string | 是 | 查询条件Field名称,具体可使用的用于查询的字段及其说明请看下面 - 查询参数介绍 | +| op | enum string | 是 | 操作符(枚举值:eq、neq、gt、gte、le、lte、in、nin、cs、cis) | +| value | 可变类型 | 是 | 查询条件Value值 | + +##### rules 表达式说明: + +##### 1. 操作符 + +| 操作符 | 描述 | 操作符的value支持的数据类型 | +|-----|-------------------------------------------|-----------------------------------------------| +| eq | 等于。不能为空字符串 | boolean, numeric, string | +| neq | 不等。不能为空字符串 | boolean, numeric, string | +| gt | 大于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| gte | 大于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lt | 小于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| lte | 小于等于 | numeric,时间类型为字符串(标准格式:"2006-01-02T15:04:05Z") | +| in | 在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| nin | 不在给定的数组范围中。value数组中的元素最多设置100个,数组中至少有一个元素 | boolean, numeric, string | +| cs | 模糊查询,区分大小写 | string | +| cis | 模糊查询,不区分大小写 | string | + +##### 2. 协议示例 + +查询 name 是 "Jim" 且 age 大于18小于30 且 servers 类型是 "api" 或者是 "web" 的数据。 + +```json +{ + "op": "and", + "rules": [ + { + "field": "name", + "op": "eq", + "value": "Jim" + }, + { + "field": "age", + "op": "gt", + "value": 18 + }, + { + "field": "age", + "op": "lt", + "value": 30 + }, + { + "field": "servers", + "op": "in", + "value": [ + "api", + "web" + ] + } + ] +} +``` + +#### 查询参数介绍: + + + +| 参数名称 | 参数类型 | 描述 | +|-------------------------------|---------|-----------------------------------------------------| +| id | string | ID | +| root_account_id | string | 一级账号ID | +| root_account_name | string | 一级账号名称 | +| vendor | string | 供应商(枚举值:tcloud、aws、azure、gcp、huawei) | +| bill_year | int | 账单年份 | +| bill_month | int | 账单月份 | +| last_synced_version | int64 | 最后同步的账单版本 | +| current_version | int64 | 当前账单版本 | +| currency | string | 币种 | +| last_month_cost_synced | decimal | 上月已同步账单 | +| last_month_rmb_cost_synced | decimal | 上月已同步人民币账单 | +| current_month_cost_synced | decimal | 本月已同步账单 | +| current_month_rmb_cost_synced | decimal | 本月已同步人民币账单 | +| month_on_month_value | float | 本月已同步账单环比 | +| current_month_cost | decimal | 实时账单 | +| current_month_rmb_cost | decimal | 实时人民币账单 | +| rate | float | 汇率 | +| adjustment_cost | decimal | 实时调账账单 | +| adjustment_rmb_cost | decimal | 实时人民币调账账单 | +| bk_biz_num | int | 业务数量 | +| product_num | int | 运营产品数量 | +| state | string | 状态(accounting, accounted, syncing, synced, stopped) | + +接口调用者可以根据以上参数自行根据查询场景设置查询规则。 + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "count": 123412, + "cost_map": { + "USD": { + "Cost": "781223.32650609", + "RMBCost": "5552583.8543083598", + "Currency": "USD" + } + } + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 返回数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|----------|-------------------|-----| +| count | int64 | 总数 | +| cost_map | map[string]object | 费用表 | + + +#### cost_map + +key: 币种 +value: 费用 + +| 参数名称 | 参数类型 | 描述 | +|----------|--------|-------| +| Cost | string | 费用 | +| RMBCost | string | 人民币费用 | +| Currency | string | 币种 | diff --git a/docs/api-docs/web-server/docs/resource/bill/sync_bill_record.md b/docs/api-docs/web-server/docs/resource/bill/sync_bill_record.md new file mode 100644 index 0000000000..b59613129b --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/sync_bill_record.md @@ -0,0 +1,56 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单创建权限。 +- 该接口功能描述:账单同步。 + +### URL + +POST /api/v1/account/bills/sync_records + +### 输入参数 + +| 参数名称 | 类型 | 必选 | 描述 | +|------------|--------|----|------| +| vendor | string | 是 | 云服务商 | +| bill_year | int | 是 | 账单年份 | +| bill_month | int | 是 | 账单月份 | + +### 调用示例 + +```json +{ + "vendor": "huawei", + "bill_year": 2021, + "bill_month": 1 +} +``` + + +### 响应示例 + +#### 导出成功结果示例 + +```json +{ + "code": 0, + "message": "", + "data": { + "ids": ["xxxxx"] + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data参数说明 + +| 参数名称 | 参数类型 | 描述 | +|------|-------|------------| +| ids | array | 账单同步记录ID列表 | \ No newline at end of file diff --git a/docs/api-docs/web-server/docs/resource/bill/update_adjustment_item.md b/docs/api-docs/web-server/docs/resource/bill/update_adjustment_item.md new file mode 100644 index 0000000000..1d12235db5 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/bill/update_adjustment_item.md @@ -0,0 +1,60 @@ + +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:账单管理。 +- 该接口功能描述:编辑调账明细,已确定的调账明细不能编辑,该接口不能确认调账明细 + +### URL + +PATCH /api/v1/account/bills/adjustment_items/{id} + +### 输入参数 + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-----------------|--------|----|-----------------------------| +| main_account_id | string | 否 | 所属主账号id | +| product_id | int | 否 | 运营产品id | +| bk_biz_id | int | 否 | 业务id | +| type | string | 否 | 调账类型 枚举值(increase、decrease) | +| currency | string | 否 | 币种 | +| cost | string | 否 | 金额 | +| memo | string | 否 | 备注信息 | + + +### 调用示例 + +```json +{ + "count": 0, + "details": [ + { + "id": "0000000a", + "main_account_id": "00000001", + "product_id": 1234, + "bk_biz_id": 5678, + "type": "increase", + "memo": "", + "currency": "RMB", + "cost": "42.67512105" + } + ] +} +``` + +### 响应示例 + +```json +{ + "code": 0, + "message": "", + "data":null +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int | 状态码 | +| message | string | 请求信息 | diff --git a/docs/api-docs/web-server/docs/resource/complete_application_for_create_main_account.md b/docs/api-docs/web-server/docs/resource/complete_application_for_create_main_account.md new file mode 100644 index 0000000000..160de89454 --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/complete_application_for_create_main_account.md @@ -0,0 +1,73 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限:一级账号管理。 +- 该接口功能描述:单据信息填写。 + +### URL + +POST /api/v1/cloud/applications/types/complete_main_account + +## 请求参数 +| 参数名称 | 参数类型 | 必选 | 描述 | +|-----------------|--------|----|-----------------------------------------| +| sn | string | 是 | 单据编号 | +| id | string | 是 | 海垒单据编号 | +| vendor | string | 是 | 云厂商,aws/gcp/azure/huawei/zenlayer/kaopu | +| root_account_id | string | 是 | 一级账号的id | +| extension | object | 是 | 各云厂商传递的参数不一致 | + +### extension + +#### aws/gcp + +null,自动创建流程不需要该字段 + +#### azure + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|------| +| cloud_subscription_name | string | 是 | 订阅名 | +| cloud_subscription_id | string | 是 | 订阅ID | +| cloud_init_password | string | 是 | 初始密码 | + + +#### huawei +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|--------| +| cloud_main_account_name | string | 是 | 二级账号名 | +| cloud_main_account_id | string | 是 | 二级账号ID | +| cloud_init_password | string | 是 | 初始密码 | + +#### zenlayer/kaopu +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|--------| +| cloud_main_account_name | string | 是 | 二级账号名 | +| cloud_main_account_id | string | 是 | 二级账号ID | +| cloud_init_password | string | 是 | 初始密码 | + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxxxx" // string, 海垒申请单ID,非ITSM申请单ID + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|------|--------|------| +| id | string | 单据ID | diff --git a/docs/api-docs/web-server/docs/resource/create_application_for_create_main_account.md b/docs/api-docs/web-server/docs/resource/create_application_for_create_main_account.md new file mode 100644 index 0000000000..9b233fd62a --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/create_application_for_create_main_account.md @@ -0,0 +1,96 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:创建 “创建二级账号”的申请单。 + +### URL + +POST /api/v1/cloud/applications/types/create_main_account + +## 请求参数 +| 参数名称 | 参数类型 | 必选 | 描述 | +|---------------|--------------|----|-----------------------------------------| +| vendor | string | 是 | 云厂商,aws/gcp/azure/huawei/zenlayer/kaopu | +| site | string | 是 | 站点类型 international/china | +| email | string | 是 | 邮箱地址,提交前需要通过邮箱验证 | +| op_product_id | int | 是 | 运营产品ID | +| business_type | string | 是 | 业务使用范围 international/china | +| managers | string array | 是 | 负责人列表,英文逗号分隔 | +| bak_managers | string array | 是 | 备份负责人列表,英文逗号分隔 | +| dept_id | int | 是 | 部门ID,要求是3级部门(不含公司,BG作为1级开始数) | +| bk_biz_id | int | 是 | 业务ID | +| memo | string | 是 | 账号用途,512个字符 | +| extension | object | 是 | 各云厂商区别处理 | + +### extension + +各云厂商区别处理,根据云厂商不同,需要提供不同的参数。 + +#### AWS + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|------| +| cloud_main_account_name | string | 是 | 主账号名 | + + +#### GCP + +| 参数名称 | 参数类型 | 必选 | 描述 | +|--------------------|--------|----|-----| +| cloud_project_name | string | 是 | 项目名 | + + +#### Huawei + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|------| +| cloud_main_account_name | string | 是 | 主账号名 | + + +#### Azure + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|-----| +| cloud_subscription_name | string | 是 | 订阅名 | + + +#### Zenlayer + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|------| +| cloud_main_account_name | string | 是 | 主账号名 | + + +#### Kaopu + +| 参数名称 | 参数类型 | 必选 | 描述 | +|-------------------------|--------|----|------| +| cloud_main_account_name | string | 是 | 主账号名 | + + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxxxx" // string, 海垒申请单ID,非ITSM申请单ID + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|------|--------|------| +| id | string | 单据ID | diff --git a/docs/api-docs/web-server/docs/resource/create_application_for_update_main_account.md b/docs/api-docs/web-server/docs/resource/create_application_for_update_main_account.md new file mode 100644 index 0000000000..9e55c3897f --- /dev/null +++ b/docs/api-docs/web-server/docs/resource/create_application_for_update_main_account.md @@ -0,0 +1,46 @@ +### 描述 + +- 该接口提供版本:v1.6.0+。 +- 该接口所需权限: +- 该接口功能描述:二级账号修改。 + +### URL + +POST /api/v1/cloud/applications/types/update_main_account + +## 请求参数 +| 参数名称 | 参数类型 | 必选 | 描述 | +|---------------|--------------|----|-------------------| +| id | string | 是 | 要变更的账号的id,不可修改 | +| vendor | string | 是 | 要变更的账号vendor,不可修改 | +| managers | string array | 否 | 要变更成为的管理员列表 | +| bak_managers | string array | 否 | 要变更成为的备份负责人列表 | +| dept_id | int | 否 | 要变成成为的部门id | +| op_product_id | int | 否 | 要变更成为的运营产品id | +| bk_biz_id | int | 否 | 要变更成为的业务id | + + +### 响应数据 +``` +{ + "code": 0, + "message": "", + "data": { + "id": "xxxxxx" // string, 海垒申请单ID,非ITSM申请单ID + } +} +``` + +### 响应参数说明 + +| 参数名称 | 参数类型 | 描述 | +|---------|--------|------| +| code | int32 | 状态码 | +| message | string | 请求信息 | +| data | object | 响应数据 | + +#### data + +| 参数名称 | 参数类型 | 描述 | +|------|--------|------| +| id | string | 单据ID |