Skip to content

Commit

Permalink
Merge pull request #384 from alex-smile/add_esb_cc_confapis
Browse files Browse the repository at this point in the history
更新 ESB CC 配置类组件
  • Loading branch information
MrLYC authored Jun 17, 2021
2 parents 551ef8c + c23afaf commit 9847969
Show file tree
Hide file tree
Showing 27 changed files with 369 additions and 164 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.12.18
2.12.19
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ get host base info
| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| bk_supplier_account | string | No | supplier account code |
| bk_host_id | int | Yes | Host ID |
| bk_host_id | int | Yes | Host ID(as is bk_host_id) |

### Request Parameters Example

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
| 字段 | 类型 | 必选 | 描述 |
|-----------|------------|--------|------------|
| bk_supplier_account | string || 开发商账号 |
| bk_host_id | int || 主机ID |
| bk_host_id | int || 主机身份ID,即bk_host_id字段值 |

### 请求参数示例

Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
### Functional description

count instance associations num (v3.10.1+)
count object instance associations num (v3.10.1+)

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

| Field | Type | Required | Description |
|------------|--------|----------|----------------------------------------------------------------------------------------------|
| bk_obj_id | string | Yes | object id |
| conditions | object | Yes | conditions, support AND/OR types,max conditions deep 3, max OR conditions rules count is 20 |
| Field | Type | Required | Description |
|------------|---------|----------|------------------------------------------------------------------------------------------------------------------------|
| bk_biz_id | integer | No | application business id, only used for mainline object search |
| bk_obj_id | string | Yes | object id |
| conditions | object | No | conditions, support AND/OR types,max conditions deep 3, max OR conditions rules
count is 20, empty means matching all(as is conditions is null value) |

#### conditions

| Field | Type | Required | Description |
|----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------|
| field | string | Yes | condition field |
| operator | string | Yes | condition operator, support equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between |
| value | - | No | condition value, max slice(array) elements count is 500 |
| Field | Type | Required | Description |
|----------|--------|----------|----------------------------------------------------------------------------------------------------------------------------|
| field | string | Yes | condition field, support id, bk_inst_id, bk_obj_id, bk_asst_inst_id, bk_asst_obj_id, bk_obj_asst_id, bk_asst_id |
| operator | string | Yes | condition operator, support like equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between |
| value | - | No | condition value, max slice(array) elements count is 500 |

condition rules: https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuilder/README.md
condition rules detail: https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuilder/README.md

### Request Parameters Example

Expand All @@ -35,22 +37,22 @@ condition rules: https://github.com/Tencent/bk-cmdb/blob/master/src/common/query
"condition": "AND",
"rules": [
{
"field": "bk_inst_name",
"operator": "begins_with",
"value": "switch"
"field": "bk_obj_asst_id",
"operator": "equal",
"value": "bk_switch_connect_host"
},
{
"condition": "OR",
"rules": [
{
"field": "bk_inst_id",
"operator": "not_in",
"operator": "in",
"value": [2,4,6]
},
{
"field": "bk_obj_name",
"field": "bk_asst_id",
"operator": "equal",
"value": "switch"
"value": 3
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
### Functional description

count object instances num (v3.10.1+)
count inner object instances num (v3.10.1+)

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

| Field | Type | Required | Description |
|------------|--------|----------|----------------------------------------------------------------------------------------------|
| bk_obj_id | string | Yes | object id |
| conditions | object | Yes | conditions, support AND/OR types,max conditions deep 3, max OR conditions rules count is 20 |
| Field | Type | Required | Description |
|------------|--------|----------|------------------------------------------------------------------------------------------------------------------------|
| bk_obj_id | string | Yes | object id |
| conditions | object | No | conditions, support AND/OR types,max conditions deep 3, max OR conditions rules count is 20, empty means matching all(as is conditions is null value |

#### conditions

| Field | Type | Required | Description |
|----------|--------|----------|-----------------------------------------------------------------------------------------------------------------------|
| field | string | Yes | condition field |
| operator | string | Yes | condition operator, support equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between |
| value | - | No | condition value, max slice(array) elements count is 500 |
| Field | Type | Required | Description |
|----------|--------|----------|----------------------------------------------------------------------------------------------------------------------------|
| field | string | Yes | condition field |
| operator | string | Yes | condition operator, support like equal,not_equal,in,not_in,less,less_or_equal,greater,greater_or_equal,between,not_between |
| value | - | No | condition value, max slice(array) elements count is 500 |

condition rules: https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuilder/README.md
condition rules detail: https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuilder/README.md

### Request Parameters Example

Expand All @@ -36,7 +36,7 @@ condition rules: https://github.com/Tencent/bk-cmdb/blob/master/src/common/query
"rules": [
{
"field": "bk_inst_name",
"operator": "begins_with",
"operator": "equal",
"value": "switch"
},
{
Expand All @@ -48,9 +48,9 @@ condition rules: https://github.com/Tencent/bk-cmdb/blob/master/src/common/query
"value": [2,4,6]
},
{
"field": "bk_obj_name",
"field": "bk_inst_id",
"operator": "equal",
"value": "switch"
"value": 3
}
]
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
### Functional description

this api is used to find the brief relations in a business topology from the source mainline object to the destination
mainline object with positive direction (as is from biz to set) or negative direction (as is from set to biz). (v3.
10.1+)

#### General Parameters

{{ common_args_desc }}

### Request Parameters

| Field | Type | Required | Description |
| ---------- | --------- | -------- | ------------------------------------------------------------ |
| bk_biz_id | int64 | Yes | Business ID |
| src_biz_obj | string | Yes | the source mainline object,can be one of the "biz"、custom level(bk_obj_id)、"set"、"module". |
| src_ids | array int | Yes | the instance id list of the source object(src_biz_obj), the length range is [1,200]|
| dest_biz_obj | string | Yes | the destination mainline object, which should be the neighbour of the source object, except biz model. and it should not be same with the source object.|
| page | object | Yes | page information of the search result|

#### page description

| Field | Type | Required | Description |
| ----- | ------ | -------- | ------------------------------------------------- |
| start | int | Yes | start record, from 0. |
| limit | int | Yes | page limit, maximum value is 500 |
| sort | string | do not set | it has a default value of the destination object's instance id. |



### Request Parameters Example

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxx",
"bk_token": "xxx",
"src_biz_obj": "biz",
"src_ids":[3,302],
"dest_biz_obj":"nation",
"page":{
"start": 0,
"limit": 2
}
}
```

### Return Result Example

```json
{
"result": true,
"code": 0,
"message": "success",
"permission": null,
"data":
[
{
"bk_biz_id": 3,
"src_id": 3,
"dest_id": 3812
},
{
"bk_biz_id": 302,
"src_id": 302,
"dest_id": 3813
}
]
}
```

### Return Result Parameters Description

#### data description
| Field | Type | Description |
|------------|----------|--------------|
| bk_biz_id | int | business's instance id |
| src_id | int | the source object's instance id, which is one of the src_ids. |
| dest_id | int| the destination object's instance id, which is related with the src id. |

Note:

1. if you search from the top to bottom way in the business mainline topology, the way you check if you have already
found all the relations is that you get 0 data array in the response.


2. if you search from the bottom to top way in the business mainline topology, the response will return all the
relations if page.limit is >= the length of src_ids.
4 changes: 2 additions & 2 deletions paas2/esb/components/confapis/cc/apidocs/en/list_biz_hosts.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ reference: <https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuild
"rules": [
{
"field": "bk_host_innerip",
"operator": "begins_with",
"value": "192.168"
"operator": "equal",
"value": "127.0.0.1"
},
{
"condition": "OR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ reference: <https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuild
"rules": [
{
"field": "bk_host_innerip",
"operator": "begins_with",
"value": "192.168"
"operator": "equal",
"value": "127.0.0.1"
},
{
"condition": "OR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ reference: <https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuild
"rules": [
{
"field": "bk_host_innerip",
"operator": "begins_with",
"value": "192.168"
"operator": "equal",
"value": "127.0.0.1"
},
{
"condition": "OR",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@
"condition":[
{
"field":"user",
"operatior":"in",
"operator":"in",
"value":["admin"]
},
{
"field":"resource_name",
"operatior":"in",
"operator":"in",
"value":["1.1.1.1"]
}
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ reference: <https://github.com/Tencent/bk-cmdb/blob/master/src/common/querybuild
"rules": [
{
"field": "bk_host_outerip",
"operator": "begins_with",
"value": "127.0"
"operator": "equal",
"value": "127.0.0.1"
}, {
"condition": "OR",
"rules": [{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ watch and get the change of a kind of resource's event.
| bk_fields | array string | Depends on resource | the resource event fields you want to return, the host resource need to be set. |
| bk_start_from | Int64 | No | watch from a unix seconds time, It is the number of seconds that have elapsed since the Unix epoch, minus leap seconds; |
| bk_cursor | string | No | a cursor to represent the event you are watched at, you can use a cursor to watch the next event after it. |
| bk_resource | string | Yes | resource you can watch, now is host, host_relation, biz, set, module, process. "host" means a host's detail info, "host_relation" means host's relation with biz, set and module, "biz" means a biz's detail info, "set" means a set's detail info, "module" means a module's detail info, "process" means a process's detail info |
| bk_resource | string | Yes | resource you can watch, now is host, host_relation, biz, set, module, process, object_instance. "host" means a host's detail info, "host_relation" means host's relation with biz, set and module, "biz" means a biz's detail info, "set" means a set's detail info, "module" means a module's detail info, "process" means a process's detail info, object_instance means object instance event. |
| bk_supplier_account | string | Yes | supplier account |


Expand Down
Loading

0 comments on commit 9847969

Please sign in to comment.