Skip to content

Commit

Permalink
Merge pull request #995 from alex-smile/ft_esb_update_apis_20220527
Browse files Browse the repository at this point in the history
esb 更新 monitor_v3 配置类组件
  • Loading branch information
MrLYC authored May 27, 2022
2 parents 9bed51b + 06f33c2 commit 00d03c8
Show file tree
Hide file tree
Showing 57 changed files with 7,064 additions and 84 deletions.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.11
2.14.12
172 changes: 172 additions & 0 deletions paas2/esb/components/confapis/monitor_v3/apidocs/en/add_shield.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
### Function Description

Create shield configuration

### Request Parameters

{{ common_args_desc }}

#### Nterface Parameters

| Field | Type | Required | Description |
| ---------------- | ------ | ---- | ------------------------------------------------------------ |
| bk_biz_id | int | yes | business id |
| category | string | yes | shield type (scope: "scope", strategy: "strategy", event: "event", alert: "alert") |
| description | string | yes | description |
| begin_time | string | yes | start time |
| end_time | string | yes | end time |
| cycle_config | dict | yes | shield configuration |
| shield_notice | bool | yes | whether to send shield notifications |
| notice_config | dict | no | notification configuration |
| dimension_config | dict | yes | shield dimension |

#### Shield Configuration (cycle_config)

| Field | Type | Required | Description |
| ---------- | ------ | ---- | -------------------------------------------------- |
| begin_time | string | no | start time (every day) |
| end_time | string | no | end time (daily) |
|type | int | yes | type of masking period (single: 1, daily: 2, weekly: 3, monthly: 4) |
| day_list | list | No | When the period is a month, the days to be shielded |
| week_list | list | No | Days to be shielded when the period is weeks |

#### Notification Configuration (notice_config)

| Field | Type | Required | Description |
| --------------- | ---- | ---- | ------------------------------------------------------------ |
| notice_time | int | yes | N minutes before shield start/end |
| notice_way | list | yes | type of notification, optional values ​​"weixin", "mail", "sms", "voice" |
| notice_receiver | list | Yes | Notifiers, including operation and maintenance personnel, product personnel, testers, developers, active and standby personnel, and backup managers |

#### Mask Dimension (dimension_config)

The masking dimension is related to the masking type (category)

##### "scope"

| Field | Type | Required | Description |
| ---------- | ------ | ---- | --------------------------------------------- |
| scope_type | string | yes | masking scope, optional values ​​"instance", "ip", "node", "biz" |
| target | list | no | list of instances according to scope type |
| metric_id | list | no | metric id |

##### "strategy"

| Field | Type | Required | Description |
| ---------- | ------ | ---- | ---------------------------- |
| id | list | Yes | policy id |
| level | list | No | alarm level |
| scope_type | string | no | mask scope, optional values ​​"ip", "node" |
| target | list | no | list of instances according to scope type |

##### "event"

| Field | Type | Required | Description |
| ---- | ------ | ---- | ------ |
| id | string | Yes | event id |

##### "alert"

| Field | Type | Required | Description |
| --------- | ---- | ---- | ------ |
| alert_ids | list | yes | alert ids |

> Note: The target in scope and strategy is selected according to scope_type. instances corresponds to instances_id, ip corresponds to {ip,bk_cloud_id}, node corresponds to {bk_obj_id, bk_inst_id}, and biz does not need to pass in anything
#### Sample Data

Range-Based Shielding

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"category":"scope",
"begin_time":"2019-11-21 00:00:00",
"end_time":"2019-11-23 23:59:59",
"cycle_config":{
"begin_time":"",
"end_time":"",
"day_list":[],
"week_list":[],
"type":1
},
"shield_notice":true,
"notice_config":{
"notice_time":5,
"notice_way":["weixin"],
"notice_receiver":[
{
"id":"user1",
"type":"user"
}
]
},
"description":"test",
"dimension_config":{
"scope_type":"instance",
"target":[8]
},
"bk_biz_id":2
}
```

Policy-Based Shielding

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"category":"strategy",
"begin_time":"2019-11-21 00:00:00",
"end_time":"2019-11-23 23:59:59",
"cycle_config":{
"begin_time":"",
"end_time":"",
"day_list":[],
"week_list":[],
"type":1
},
"shield_notice":true,
"notice_config":{
"notice_time":5,
"notice_way":["weixin"],
"notice_receiver":[
{
"id":"user1",
"type":"user"
}
]
},
"description":"test",
"dimension_config":{
"id": 1,
"level":[1]
},
"bk_biz_id":2
}
```

### Response parameters

| Field | Type | Description |
| ------- | ------ | ------------ |
| result | bool | Whether the request was successful |
| code | int | Returned status code |
| message | string | Description |
| data | dict | mask configuration id |

#### Sample data

```json
{
"message": "OK",
"code": 200,
"data": {
"id": 1
},
"result": true
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
### Function description

Delete alert strategy

### Request parameters

{{ common_args_desc }}

#### Interface parameters

| Field | Type | Required | Description |
| :-------- | ---- | ---- | ---------- |
| bk_biz_id | int | yes | business id |
| id | int | yes | alarm strategy ID |

#### Sample data

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"bk_biz_id": 2,
"id": 1
}
```

### Response parameters

| Field | Type | Description |
| ------- | ------ | ------------ |
| result | bool | Whether the request was successful |
| code | int | Returned status code |
| message | string | Description |
| data | null | return data |

##### Sample data

```json
{
"message": "OK",
"code": 200,
"data": null,
"result": true
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
### Function description

Delete strategy configuration

### Request parameters

{{ common_args_desc }}

#### interface parameters

| Field | Type | Required | Description |
| :-------- | ---- | ---- | -------------- |
| bk_biz_id | int | yes | business id |
| ids | list | yes | list of alarm strategy IDs |


#### Sample data

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"bk_biz_id": 7,
"ids": [49]
}
```

### Response parameters

| Field | Type | Description |
| ------- | ------ | ------------------ |
| result | bool | whether the request was successful |
| code | int | returned status code |
| message | string | description |
| data | list | list of deleted strategy ids |

#### Sample data

```json
{
"result": true,
"code": 200,
"message": "OK",
"data": [
49
]
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### Function description

delete notification group

### Request parameters

{{ common_args_desc }}

#### Interface parameters

| Field | Type | Required | Description |
| ---- | ---- | ---- | -------- |
| ids | list | yes | notification group id |

#### Sample data

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"ids": [1]
}
```

### Response parameters

| Field | Type | Description |
| ------- | ------ | ------------ |
| result | bool | Whether the request was successful |
| code | int | Returned status code |
| message | string | Description |
| data | null | return data |

#### Sample data

```json
{
"message": "OK",
"code": 200,
"data": null,
"result": true
}
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
### Function description

remove shielding configuration

### request parameters

{{ common_args_desc }}

#### interface parameters

| Field | Type | Required | Description |
| ---- | ---- | ---- | ---------- |
| id | int | yes | shield config id |

#### Sample data

```json
{
"bk_app_code": "xxx",
"bk_app_secret": "xxxxx",
"bk_token": "xxxx",
"id": 1
}
```

### Response parameters

| Field | Type | Description |
| ------- | ------ | ------------ |
| result | bool | whether the request was successful |
| code | int | returned status code |
| message | string | description |
| data | string | return data |

#### Sample data

```json
{
"result": true,
"code": 200,
"message": "",
"data": ""
}
```
Loading

0 comments on commit 00d03c8

Please sign in to comment.