From 0822d54093f66fb368b381085cc5713ed172fb43 Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Thu, 27 Jul 2023 12:40:11 +0800 Subject: [PATCH 1/2] update cc confapis --- .../cc/apidocs/en/batch_create_quoted_inst.md | 86 ++++++++ .../cc/apidocs/en/batch_delete_quoted_inst.md | 56 +++++ .../cc/apidocs/en/batch_update_quoted_inst.md | 70 +++++++ .../confapis/cc/apidocs/en/create_inst.md | 2 +- .../cc/apidocs/en/list_quoted_inst.md | 198 ++++++++++++++++++ .../zh_hans/batch_create_quoted_inst.md | 86 ++++++++ .../zh_hans/batch_delete_quoted_inst.md | 59 ++++++ .../zh_hans/batch_update_quoted_inst.md | 73 +++++++ .../cc/apidocs/zh_hans/create_inst.md | 2 +- .../cc/apidocs/zh_hans/list_quoted_inst.md | 194 +++++++++++++++++ paas2/esb/components/confapis/cc/cc.yaml | 40 ++++ 11 files changed, 864 insertions(+), 2 deletions(-) create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_create_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_delete_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/batch_update_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/en/list_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_quoted_inst.md create mode 100644 paas2/esb/components/confapis/cc/apidocs/zh_hans/list_quoted_inst.md diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_create_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_quoted_inst.md new file mode 100644 index 000000000..8adb3452f --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_create_quoted_inst.md @@ -0,0 +1,86 @@ +### Function description + +batch create quoted model instance (version: v3.10.30+, permission: update permission of the source model instance) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Field | Type | Required | Description | +|----------------|--------------|----------|------------------------------------------------------| +| bk_obj_id | string | yes | source model id | +| bk_property_id | string | yes | source model quoted property id | +| data | object array | yes | instance data to be created, the maximum limit is 50 | + +#### data[n] + +| Field | Type | Required | Description | +|-------------|--------|----------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------| +| bk_inst_id | int64 | no | source model instance id, if not set, the created instance should be associated with source model instance using create_inst | +| name | string | depends on the "isrequired" config of the property | name, this is only an example, actual fields is defined by quoted model properties | +| operator | string | depends on the "isrequired" config of the property | operator, this is only an example, actual fields is defined by quoted model properties | +| description | string | depends on the "isrequired" config of the property | description, this is only an example, actual fields is defined by quoted model properties | + +### Request parameter examples + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "data": [ + { + "bk_inst_id": 123, + "name": "test", + "operator": "user", + "description": "test instance" + } + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "dsda1122adasadadada2222" +} +``` + +**Note:** + +- The order of the array of ids in the returned data remains the same as the order of the array data in the parameters. + +### Return result parameter description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------------------| +| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | +| data | object | data returned by the request | + +#### data + +| Name | Type | Description | +|------|-------|----------------------------------------------------| +| ids | array | unique identifier array of created instances in cc | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_quoted_inst.md new file mode 100644 index 000000000..bfc91fc7f --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_delete_quoted_inst.md @@ -0,0 +1,56 @@ +### Function description + +batch delete quoted model instance (version: v3.10.30+, permission: update permission of the source model instance) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Field | Type | Required | Description | +|----------------|-------------|----------|--------------------------------------------------------------------| +| bk_obj_id | string | yes | source model id | +| bk_property_id | string | yes | source model quoted property id | +| ids | int64 array | yes | id list of quoted instance to be deleted, the maximum limit is 500 | + +### Request parameter examples + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "ids": [ + 1, + 2 + ] +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "dsda1122adasadadada2222" +} +``` + +### Return result parameter description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------------------| +| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/batch_update_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_quoted_inst.md new file mode 100644 index 000000000..1d94e32af --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/batch_update_quoted_inst.md @@ -0,0 +1,70 @@ +### Function description + +batch update quoted model instance (version: v3.10.30+, permission: update permission of the source model instance) + +### Request parameters + +{{ common_args_desc }} + +#### Interface parameters + +| Field | Type | Required | Description | +|----------------|-------------|----------|--------------------------------------------------------------------| +| bk_obj_id | string | yes | source model id | +| bk_property_id | string | yes | source model quoted property id | +| ids | int64 array | yes | id list of quoted instance to be updated, the maximum limit is 500 | +| data | object | yes | the quoted instance data to be updated | + +#### data + +| Field | Type | Required | Description | +|-------------|--------|--------------------------------------------------|-------------------------------------------------------------------------------------------| +| name | string | at least one of the fields in "data" is required | name, this is only an example, actual fields is defined by quoted model properties | +| operator | string | at least one of the fields in "data" is required | operator, this is only an example, actual fields is defined by quoted model properties | +| description | string | at least one of the fields in "data" is required | description, this is only an example, actual fields is defined by quoted model properties | + +### Request parameter examples + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "ids": [ + 1, + 2 + ], + "data": { + "name": "test", + "operator": "user", + "description": "test instance" + } +} +``` + +### Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "dsda1122adasadadada2222" +} +``` + +### Return result parameter description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------------------| +| result | bool | The success or failure of the request. true: the request was successful; false: the request failed. | +| code | int | The error code. 0 means success, >0 means failure error. | +| message | string | The error message returned by the failed request. | +| permission | object | Permission information | +| request_id | string | request_chain_id | diff --git a/paas2/esb/components/confapis/cc/apidocs/en/create_inst.md b/paas2/esb/components/confapis/cc/apidocs/en/create_inst.md index 31c3dd8f0..86555a032 100644 --- a/paas2/esb/components/confapis/cc/apidocs/en/create_inst.md +++ b/paas2/esb/components/confapis/cc/apidocs/en/create_inst.md @@ -24,7 +24,7 @@ Create instance } } -Other fields that belong to instance properties can also be input parameters. +Other fields that belong to instance properties can also be input parameters. The value of the 'table' type attribute is the id list of the quoted table type model instance (need to be created through the batch_create_quoted_inst interface first), up to 50. ### Request Parameters Example diff --git a/paas2/esb/components/confapis/cc/apidocs/en/list_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/en/list_quoted_inst.md new file mode 100644 index 000000000..9741daa5d --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/en/list_quoted_inst.md @@ -0,0 +1,198 @@ +### Functional description + +list quoted model instances by condition (version: v3.10.30+, permission: view permission of the source model instance) + +### Request Parameters + +{{ common_args_desc }} + +#### Interface Parameters + +| Field | Type | Required | Description | +|----------------|--------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------| +| bk_obj_id | string | yes | source model id | +| bk_property_id | string | yes | source model quoted property id | +| filter | object | no | query filter of the quoted instance | +| fields | array | no | quoted instance property list, which controls which fields are in the returned result, which can accelerate interface requests and reduce network traffic. | +| page | object | yes | page condition | + +#### filter + +This parameter is the filter rule to search for container based on its attribute fields. This parameter supports the +following two filter rules types. The combined filter rules can be nested with the maximum nesting level of 2. The +specific supported filter rule types are as follows: + +##### combined filter rule + +This filter rule type defines filter rules composed of other rules, the combined rules support logic and/or +relationships + +| Field | Type | Required | Description | +|-----------|--------|----------|----------------------------------------------------------------------------| +| condition | string | yes | query criteria, support `AND` and `OR` | +| rules | array | yes | query rules, can be of `combined filter rule` or `atomic filter rule` type | + +##### atomic filter rule + +This filter rule type defines basic filter rules, which represent rules for filtering a field. Any filter rule is either +directly an atomic filter rule, or a combination of multiple atomic filter rules + +| Field | Type | Required | Description | +|----------|----------------------------------------------------------------------|----------|----------------------------------------------------------------------------------------------------------------------| +| field | string | yes | container's field | +| operator | string | yes | operator, optional values: equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | different fields and operators correspond to different value formats | yes | operand | + +Assembly rules can refer to: + +#### page + +| Field | Type | Required | Description | +|--------------|--------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| start | int | yes | Record start position | +| limit | int | yes | Limit per page, maximum 500 | +| sort | string | no | Sort the field | +| enable_count | bool | yes | The flag defining Whether to get the the number of query objects. If this flag is true, then the request is to get the quantity. The remaining fields must be initialized, start is 0, and limit is: 0, sort is "" | + +### Request Parameters Example + +#### Query Detail Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "test" + }, + { + "condition": "OR", + "rules": [ + { + "field": "operator", + "operator": "not_in", + "value": [ + "me" + ] + }, + { + "field": "bk_inst_id", + "operator": "equal", + "value": 123 + } + ] + } + ] + }, + "fields": [ + "name", + "description" + ], + "page": { + "start": 0, + "limit": 2, + "sort": "name", + "enable_count": false + } +} +``` + +#### Query Quantity Request Parameters Example + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "filter": { + "field": "name", + "operator": "equal", + "value": "test" + }, + "page": { + "enable_count": true + } +} +``` + +### Return Result Example + +#### Query Detail Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "test1", + "description": "test instance 1" + }, + { + "name": "test2", + "description": "test instance 2" + } + ] + } +} +``` + +#### Query Quantity Return Result Example + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 5, + "info": [] + } +} +``` + +### Return Result Parameters Description + +#### response + +| Name | Type | Description | +|------------|--------|-----------------------------------------------------------------------------------------| +| result | bool | Whether the request was successful or not. True: request succeeded;false request failed | +| code | int | Wrong code. 0 indicates success,>0 indicates failure error | +| message | string | Error message returned by request failure | +| permission | object | Permission information | +| request_id | string | Request chain id | +| data | object | Data returned by request | + +#### data + +| Field | Type | Description | +|-------|-------|-----------------------------------------------------------------| +| count | int | Number of containers | +| info | array | Container list, only returns the fields that is set in `fields` | + +#### info + +| Field | Type | Description | +|-------------|--------|-------------------------------------------------------------------------------------------| +| name | string | name, this is only an example, actual fields is defined by quoted model properties | +| description | string | description, this is only an example, actual fields is defined by quoted model properties | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_quoted_inst.md new file mode 100644 index 000000000..cfc030d05 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_create_quoted_inst.md @@ -0,0 +1,86 @@ +### 功能描述 + +批量创建被引用的模型的实例(v3.10.30+,权限:源模型实例的编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------|--------------|-----|---------------------| +| bk_obj_id | string | 是 | 源模型ID | +| bk_property_id | string | 是 | 源模型引用该模型的属性ID | +| data | object array | 是 | 需要创建的实例信息,最多不能超过50个 | + +#### data[n] + +| 参数 | 类型 | 必选 | 描述 | +|-------------|--------|-----------------|---------------------------------------| +| bk_inst_id | int64 | 否 | 源模型实例ID,未填写的情况下需要通过创建源模型实例的接口和源模型实例关联 | +| name | string | 取决于属性中的"是否必选"配置 | 名称,此处仅为示例,实际字段由模型属性决定 | +| operator | string | 取决于属性中的"是否必选"配置 | 维护人,此处仅为示例,实际字段由模型属性决定 | +| description | string | 取决于属性中的"是否必选"配置 | 描述,此处仅为示例,实际字段由模型属性决定 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "data": [ + { + "bk_inst_id": 123, + "name": "test", + "operator": "user", + "description": "test instance" + } + ] +} +``` + +### 返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": { + "ids": [ + 1, + 2 + ] + }, + "request_id": "dsda1122adasadadada2222" +} +``` + +**注意:** + +- 返回的data中的ID数组顺序与参数中的数组数据顺序保持一致。 + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-----|-------------|------------------| +| ids | int64 array | 创建的实例在cc中的唯一标识数组 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_quoted_inst.md new file mode 100644 index 000000000..fddb11ef2 --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_delete_quoted_inst.md @@ -0,0 +1,59 @@ +### 功能描述 + +批量删除被引用的模型的实例(v3.10.30+,权限:源模型实例的编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------|-------------|-----|------------------------| +| bk_obj_id | string | 是 | 源模型ID | +| bk_property_id | string | 是 | 源模型引用该模型的属性ID | +| ids | int64 array | 是 | 需要删除的实例ID数组,最多不能超过500个 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "ids": [ + 1, + 2 + ] +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": null, + "request_id": "dsda1122adasadadada2222" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_quoted_inst.md new file mode 100644 index 000000000..2e70dc59d --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/batch_update_quoted_inst.md @@ -0,0 +1,73 @@ +### 功能描述 + +批量更新被引用的模型的实例(v3.10.30+,权限:源模型实例的编辑权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------|-------------|-----|------------------------| +| bk_obj_id | string | 是 | 源模型ID | +| bk_property_id | string | 是 | 源模型引用该模型的属性ID | +| ids | int64 array | 是 | 需要更新的实例ID数组,最多不能超过500个 | +| data | object | 是 | 需要更新的实例信息 | + +#### data + +| 参数 | 类型 | 必选 | 描述 | +|-------------|--------|---------------|------------------------| +| name | string | data中至少一个字段必填 | 名称,此处仅为示例,实际字段由模型属性决定 | +| operator | string | data中至少一个字段必填 | 维护人,此处仅为示例,实际字段由模型属性决定 | +| description | string | data中至少一个字段必填 | 描述,此处仅为示例,实际字段由模型属性决定 | + +### 请求参数示例 + +```json +{ + "bk_app_code": "esb_test", + "bk_app_secret": "xxx", + "bk_username": "xxx", + "bk_token": "xxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "ids": [ + 1, + 2 + ], + "data": { + "name": "test", + "operator": "user", + "description": "test instance" + } +} +``` + +### 返回结果示例 + +```json + +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "data": null, + "request_id": "dsda1122adasadadada2222" +} +``` + +### 返回结果参数说明 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_inst.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_inst.md index c636a2022..39f3cda29 100644 --- a/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_inst.md +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/create_inst.md @@ -24,7 +24,7 @@ } } -其它属于实例属性的字段均也可为入参。 +其它属于实例属性的字段均也可为入参。其中表格类型属性的值为关联的表格类型模型实例(需要先通过 batch_create_quoted_inst 接口创建)的ID列表,最多50个。 ### 请求参数示例 diff --git a/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_quoted_inst.md b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_quoted_inst.md new file mode 100644 index 000000000..61a8ff89e --- /dev/null +++ b/paas2/esb/components/confapis/cc/apidocs/zh_hans/list_quoted_inst.md @@ -0,0 +1,194 @@ +### 功能描述 + +查询被引用的模型的实例列表(v3.10.30+,权限:源模型实例的查看权限) + +### 请求参数 + +{{ common_args_desc }} + +#### 接口参数 + +| 字段 | 类型 | 必选 | 描述 | +|----------------|--------------|-----|-----------------------------------------------| +| bk_obj_id | string | 是 | 源模型ID | +| bk_property_id | string | 是 | 源模型引用该模型的属性ID | +| filter | object | 否 | 被引用的模型实例的查询条件 | +| fields | string array | 否 | 被引用的模型的属性列表,控制返回结果的实例里有哪些字段,能够加速接口请求和减少网络流量传输 | +| page | object | 是 | 分页信息 | + +#### filter 字段说明 + +被引用的模型的属性字段过滤规则,用于根据属性字段搜索数据。该参数支持以下两种过滤规则类型,其中组合过滤规则可以嵌套,且最多嵌套2层。具体支持的过滤规则类型如下: + +##### 组合过滤规则 + +由其它规则组合而成的过滤规则,组合的规则间支持逻辑与/或关系 + +| 字段 | 类型 | 必选 | 描述 | +|-----------|--------|-----|---------------------------------| +| condition | string | 是 | 组合查询条件,支持 `AND` 和 `OR` 两种方式 | +| rules | array | 是 | 查询规则,可以是 `组合过滤规则` 或 `原子过滤规则` 类型 | + +##### 原子过滤规则 + +基础的过滤规则,表示对某一个字段进行过滤的规则。任何过滤规则都直接是原子过滤规则, 或由多个原子过滤规则组合而成 + +| 名称 | 类型 | 必选 | 说明 | +|----------|-------------------------------|-----|---------------------------------------------------------------------------------------------------| +| field | string | 是 | 被引用的模型的属性字段 | +| operator | string | 是 | 操作符,可选值 equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between | +| value | 不同的field和operator对应不同的value格式 | 否 | 操作值 | + +组装规则可参考: + +#### page 字段说明 + +| 字段 | 类型 | 必选 | 描述 | +|--------------|--------|-----|------------------------------------------------------------------------------| +| start | int | 是 | 记录开始位置 | +| limit | int | 是 | 每页限制条数,最大500 | +| sort | string | 否 | 排序字段 | +| enable_count | bool | 是 | 是否获取查询对象数量的标记。如果此标记为true那么表示此次请求是获取数量,此时其余字段必须为初始化值,start为0,limit为:0,sort为"" | + +### 请求参数示例 + +#### 获取详细信息请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "filter": { + "condition": "AND", + "rules": [ + { + "field": "name", + "operator": "not_equal", + "value": "test" + }, + { + "condition": "OR", + "rules": [ + { + "field": "operator", + "operator": "not_in", + "value": [ + "me" + ] + }, + { + "field": "bk_inst_id", + "operator": "equal", + "value": 123 + } + ] + } + ] + }, + "fields": [ + "name", + "description" + ], + "page": { + "start": 0, + "limit": 2, + "sort": "name", + "enable_count": false + } +} +``` + +#### 获取数量请求参数示例 + +```json +{ + "bk_app_code": "code", + "bk_app_secret": "secret", + "bk_username": "xxx", + "bk_token": "xxxx", + "bk_obj_id": "host", + "bk_property_id": "disk", + "filter": { + "field": "name", + "operator": "equal", + "value": "test" + }, + "page": { + "enable_count": true + } +} +``` + +### 返回结果示例 + +#### 获取详细信息返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 0, + "info": [ + { + "name": "test1", + "description": "test instance 1" + }, + { + "name": "test2", + "description": "test instance 2" + } + ] + } +} +``` + +#### 获取数量返回结果示例 + +```json +{ + "result": true, + "code": 0, + "message": "success", + "permission": null, + "request_id": "87de106ab55549bfbcc46e47ecf5bcc7", + "data": { + "count": 5, + "info": [] + } +} +``` + +### 返回结果参数 + +#### response + +| 名称 | 类型 | 描述 | +|------------|--------|----------------------------| +| result | bool | 请求成功与否。true:请求成功;false请求失败 | +| code | int | 错误编码。 0表示success,>0表示失败错误 | +| message | string | 请求失败返回的错误信息 | +| permission | object | 权限信息 | +| request_id | string | 请求链id | +| data | object | 请求返回的数据 | + +#### data + +| 字段 | 类型 | 描述 | +|-------|-------|---------------------------------| +| count | int | 记录条数 | +| info | array | 被引用的模型的实例的实际数据,仅返回fields里设置了的字段 | + +#### info + +| 字段 | 类型 | 描述 | +|-------------|--------|-----------------------| +| name | string | 名称,此处仅为示例,实际字段由模型属性决定 | +| description | string | 描述,此处仅为示例,实际字段由模型属性决定 | diff --git a/paas2/esb/components/confapis/cc/cc.yaml b/paas2/esb/components/confapis/cc/cc.yaml index 353706147..bf3bf69c3 100644 --- a/paas2/esb/components/confapis/cc/cc.yaml +++ b/paas2/esb/components/confapis/cc/cc.yaml @@ -1420,3 +1420,43 @@ comp_codename: generic.v2.cc.cc_component dest_path: /api/v3/hosts/modules/across/biz dest_http_method: POST + +- path: /v2/cc/batch_create_quoted_inst/ + name: batch_create_quoted_inst + label: 批量创建被引用的模型的实例 + label_en: batch create quoted model instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/createmany/quoted/instance + dest_http_method: POST + +- path: /v2/cc/list_quoted_inst/ + name: list_quoted_inst + label: 查询被引用的模型的实例列表 + label_en: list quoted model instances by condition + suggest_method: POST + api_type: query + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/findmany/quoted/instance + dest_http_method: POST + +- path: /v2/cc/batch_update_quoted_inst/ + name: batch_update_quoted_inst + label: 批量更新被引用的模型的实例 + label_en: batch update quoted model instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/updatemany/quoted/instance + dest_http_method: PUT + +- path: /v2/cc/batch_delete_quoted_inst/ + name: batch_delete_quoted_inst + label: 批量删除被引用的模型的实例 + label_en: batch delete quoted model instance + suggest_method: POST + api_type: operate + comp_codename: generic.v2.cc.cc_component + dest_path: /api/v3/deletemany/quoted/instance + dest_http_method: DELETE From fa22b24e8c7f2043e987f6dbfb86dd0f8539356a Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Thu, 27 Jul 2023 12:41:53 +0800 Subject: [PATCH 2/2] update release doc --- paas2/VERSION | 2 +- paas2/release.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/paas2/VERSION b/paas2/VERSION index 6898c56f5..447e3a999 100644 --- a/paas2/VERSION +++ b/paas2/VERSION @@ -1 +1 @@ -2.14.55 +2.14.56 diff --git a/paas2/release.md b/paas2/release.md index ca2c0c476..06e4a9717 100644 --- a/paas2/release.md +++ b/paas2/release.md @@ -1,5 +1,8 @@ Release Log =============================== +# 2.14.56 + - esb: update cc confapis + # 2.14.55 - esb: update jobv3 confapis