Skip to content

Commit

Permalink
Merge pull request #778 from alex-smile/ft_esb_update_apis_20220310
Browse files Browse the repository at this point in the history
Ft esb update apis 20220310
  • Loading branch information
MrLYC authored Mar 10, 2022
2 parents e6ea8d2 + 957d265 commit 8b27913
Show file tree
Hide file tree
Showing 44 changed files with 1,925 additions and 379 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.30
2.13.31
16 changes: 16 additions & 0 deletions paas2/esb/components/bk/apisv2/bk_paas/apidocs/en/get_app_info.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,19 @@ get application info, bulk supported
]
}
```

### Return Result Description

| Field | Type | Description |
|-----------|----------|-----------|
| result | bool | return result, true for success, false for failure |
| code | int | return code, 0 for success, other values for failure |
| message | string | error message |
| data | list | result data, details are described below |

#### data

| Field | Type | Description |
|-----------|----------|-----------|
| bk_app_code | string | application code |
| bk_app_name | string | application name |
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,19 @@
]
}
```

### 返回结果参数说明

| 字段 | 类型 | 描述 |
|-----------|----------|-----------|
| result | bool | 返回结果,true 为成功,false 为失败 |
| code | int | 返回码,0 表示成功,其它值表示失败 |
| message | string | 错误信息 |
| data | list | 结果数据,详细信息请见下面说明 |

#### data

| 字段 | 类型 | 描述 |
|-----------|----------|-----------|
| bk_app_code | string | 应用编码 |
| bk_app_name | string | 应用名称 |
116 changes: 116 additions & 0 deletions paas2/esb/components/confapis/cc/apidocs/en/create_business_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
### Functional description

create business set(v3.10.12+)


### Request Parameters

{{ common_args_desc }}


#### General Parameters

| Field | Type | Required | Description |
|-----------|------------|--------|---------------------------|
| bk_biz_set_attr | object | Yes | business set model field|
| bk_scope | object | Yes | selected business scope|

#### bk_biz_set_attr

| Field | Type | Required | Description |
|-----------|------------|--------|------------------|
| bk_biz_set_name | string | Yes | business set name|
| bk_biz_maintainer | string | No | the maintainers |
| bk_biz_set_desc | string | No | business description |

#### bk_scope

| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| match_all | bool | Yes | selected business line tags|
| filter | object | No | scope conditions for the selected business|

#### filter

- This parameter is a combination of business attribute field filtering rules, which is used to search for business based on business attribute fields. Combinations only support AND operations and can be nested up to 2 levels.

| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| condition | string | Yes | rule operator|
| rules | array | Yes | scope condition rules for the selected business|


#### rules

| Field | Type | Required | Description |
| -------- | ------ | ---- | ---------------------------------- |
| field | string | No | field name |
| operator | string | No | available values: equal,in |
| value | - | No | values's format depend on operator |

**Note:**

- The input here only describes the required and built-in parameters for the `bk_biz_set_attr` parameter, and the other parameters that need to be filled depend on the attribute fields defined by the user.
- when the `match_all` field in `bk_scope` is true, it means that the selected business scope of the business set is all, and the parameter `filter` is empty. If the `match_all` field is false,
`filter` needs to be non-null and the user needs to explicitly specify choice of business
- The selected business type must be enum or organization.

### Request Parameters Example

```python
{
"bk_app_code":"esb_test",
"bk_app_secret":"xxx",
"bk_username":"xxx",
"bk_token":"xxx",
"bk_biz_set_attr":{
"bk_biz_set_name":"biz_set",
"bk_biz_set_desc":"xxx",
"biz_set_maintainer":"xxx"
},
"bk_scope":{
"match_all":false,
"filter":{
"condition":"AND",
"rules":[
{
"field":"bk_sla",
"operator":"equal",
"value":"2"
},
{
"field":"life_cycle",
"operator":"equal",
"value":1
}
]
}
}
}
```

### Return Result Example

```python

{
"result":true,
"code":0,
"message":"success",
"permission":null,
"data":5,
"request_id": "dsda1122adasadadada2222"
}
```
### Return Result Parameters Description

#### response

| Field | Type | Description |
| ------- | ------ | ------------------------------------- |
| result | bool | request success or failed. true:success;false: failed |
| code | int | error code. 0: success, >0: something error |
| message | string | error info description |
| permission | object | permission info |
| data | int | business set id |
| request_id | string | request chain id |
52 changes: 52 additions & 0 deletions paas2/esb/components/confapis/cc/apidocs/en/delete_business_set.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
### Functional description

delete business set(v3.10.12+)

### Request Parameters

{{ common_args_desc }}

#### General Parameters

| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| bk_biz_set_ids | array | Yes |business set id list |

### Request Parameters Example

```python
{
"bk_app_code":"esb_test",
"bk_app_secret":"xxx",
"bk_username":"xxx",
"bk_token":"xxx",
"bk_biz_set_ids":[
10,
12
]
}
```

### Return Result Example

```python
{
"result": true,
"code": 0,
"message": "",
"permission":null,
"data": {},
"request_id": "dsda1122adasadadada2222"
}
```
### Return Result Parameters Description
#### response

| Field | Type | Description |
| ------- | ------ | ------------------------------------- |
| result | bool | request success or failed. true:success;false: failed |
| code | int | error code. 0: success, >0: something error |
| message | string | error info description |
| permission | object | permission info |
| data | object | response data |
| request_id | string | request chain id |
20 changes: 18 additions & 2 deletions paas2/esb/components/confapis/cc/apidocs/en/resource_watch.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ 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, object_instance, mainline_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 common object instance event, mainline_instance means mainline object instance event. |
| bk_resource | string | Yes | resource you can watch, now is host, host_relation, biz, set, module, process, object_instance, mainline_instance, biz_set, biz_set_relation. "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 common object instance event, "mainline_instance" means mainline object instance event, "biz_set" means biz set event info, "biz_set_relation" means biz set to biz relation event info. |
| bk_supplier_account | string | Yes | supplier account |
| bk_filter | object | No | filter condition |

**Note: The biz_set_relation event will be triggered when biz set is added, deleted or its "bk_scope" field is updated, and when biz is added, deleted or updated which results in its relationship with biz set changed. The event detail includes the ID of the biz set whose relation changed and all of the biz IDs it contains after the change**

#### bk_filter

| Field | Type | Required | Description |
Expand Down Expand Up @@ -145,6 +147,21 @@ common object instance:
}
```

#### biz_set_relation resource details example:
```json
{
"bk_biz_set_id": 1,
"bk_biz_ids": [1 ,2, 3]
}
```

- biz_set_relation resource bk_detail description

| Field | Type | Description |
| ------------- | --------- | ----------------------------------------------- |
| bk_biz_set_id | int | ID of the biz set whose relation to biz changes |
| bk_biz_ids | int array | all of the biz ID list that biz set contains |



### Usage description
Expand Down Expand Up @@ -175,4 +192,3 @@ the event's expired time is 3h at now. if event is expire, then it will be remov




Loading

0 comments on commit 8b27913

Please sign in to comment.