Skip to content

Commit

Permalink
feature: 添加删除定时任务的ESB/APIGW接口 TencentBlueKing#2733
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliaozhong committed Jan 26, 2024
1 parent 4bec56c commit 41beb92
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 2 deletions.
62 changes: 62 additions & 0 deletions docs/apidoc/bk-api-gateway/v3/zh/delete_cron.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
### 功能描述

删除定时任务

### 请求参数

{{ bkapi_authorization_description }}

#### Header参数

| 字段 | 类型 | 必选 | 描述 |
|---------------------------|------------|---------|------------|
| X-Bkapi-Authorization | string || 认证信息。详情参考[调用网关 API](https://github.com/TencentBlueKing/BKDocs/blob/master/ZH/7.0/APIGateway/apigateway/use-api/use-apigw-api.md) |
| Accept | string || 固定值。application/json|
| Content-Type | string || 固定值。application/json|

#### Body参数

| 字段 | 类型 | 必选 | 描述 |
|---------------|------------|--------|------------|
| bk_scope_type | string || 资源范围类型。可选值: biz - 业务,biz_set - 业务集 |
| bk_scope_id | string || 资源范围ID, 与bk_scope_type对应, 表示业务ID或者业务集ID |
| id | long || 定时任务ID |

### 请求参数示例

- POST
```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_token": "xxx",
"bk_scope_type":"biz",
"bk_scope_id":"2",
"id": 1000045
}
```

### 返回结果示例

```json
{
"code": 0,
"result": true
}
```

### 返回结果参数说明

#### response
| 字段 | 类型 | 描述 |
|--------------|-----------|-----------|
| result | bool | 请求成功与否。true:请求成功;false请求失败 |
| code | int | 错误编码。 0表示success,>0表示失败错误 |
| message | string | 请求失败返回的错误信息|
| data | object | 请求返回的数据|
| permission | object | 权限信息|


#### data

Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ validation.constraints.InvalidHighRiskRegularStatus.message=非法的规则启
validation.constraints.InvalidHighRiskRegularDescription_outOfLength.message=规则说明不能超过{max}个字符
validation.constraints.InvalidBkBizId.message=非法的业务 ID
validation.constraints.InvalidCronId.message=非法的定时任务 ID
validation.constraints.CronId_empty.message=定时任务ID不能为空
validation.constraints.InvalidCronJobPlanId.message=非法的作业 ID
validation.constraints.InvalidCronJobName_empty.message=定时作业名称不能为空
validation.constraints.InvalidCronJobName_outOfLength.message=定时作业名称不能超过{max}个字符
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ validation.constraints.InvalidHighRiskRegularStatus.message=Invalid High-risk ex
validation.constraints.InvalidHighRiskRegularDescription_outOfLength.message=High-risk explanation description can not exceed {max} characters
validation.constraints.InvalidBkBizId.message=Invalid bk_biz_id
validation.constraints.InvalidCronId.message=Invalid id
validation.constraints.CronId_empty.message=Cron id cannot be empty
validation.constraints.InvalidCronJobPlanId.message=Invalid job_plan_id
validation.constraints.InvalidCronJobName_empty.message=Cron name cannot be empty
validation.constraints.InvalidCronJobName_outOfLength.message=Cron name can not exceed {max} characters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ validation.constraints.InvalidHighRiskRegularStatus.message=Invalid High-risk ex
validation.constraints.InvalidHighRiskRegularDescription_outOfLength.message=High-risk explanation description can not exceed {max} characters
validation.constraints.InvalidBkBizId.message=Invalid bk_biz_id
validation.constraints.InvalidCronId.message=Invalid id
validation.constraints.CronId_empty.message=Cron id cannot be empty
validation.constraints.InvalidCronJobPlanId.message=Invalid job_plan_id
validation.constraints.InvalidCronJobName_empty.message=Cron name cannot be empty
validation.constraints.InvalidCronJobName_outOfLength.message=Cron name can not exceed {max} characters
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ validation.constraints.InvalidHighRiskRegularStatus.message=非法的规则启
validation.constraints.InvalidHighRiskRegularDescription_outOfLength.message=规则说明不能超过{max}个字符
validation.constraints.InvalidBkBizId.message=非法的业务 ID
validation.constraints.InvalidCronId.message=非法的定时任务 ID
validation.constraints.CronId_empty.message=定时任务ID不能为空
validation.constraints.InvalidCronJobPlanId.message=非法的作业 ID
validation.constraints.InvalidCronJobName_empty.message=定时作业名称不能为空
validation.constraints.InvalidCronJobName_outOfLength.message=定时作业名称不能超过{max}个字符
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ validation.constraints.InvalidHighRiskRegularStatus.message=非法的规则启
validation.constraints.InvalidHighRiskRegularDescription_outOfLength.message=规则说明不能超过{max}个字符
validation.constraints.InvalidBkBizId.message=非法的业务ID
validation.constraints.InvalidCronId.message=非法的定时任务ID
validation.constraints.CronId_empty.message=定时任务ID不能为空
validation.constraints.InvalidCronJobPlanId.message=非法的作业ID
validation.constraints.InvalidCronJobName_empty.message=定时作业名称不能为空
validation.constraints.InvalidCronJobName_outOfLength.message=定时作业名称不能超过{max}个字符
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import lombok.EqualsAndHashCode;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

@Data
@EqualsAndHashCode(callSuper = true)
Expand All @@ -40,7 +40,7 @@ public class EsbDeleteCronV3Request extends EsbAppScopeReq {
/**
* 定时作业 ID
*/
@NotEmpty(message = "{validation.constraints.CronId_empty.message}")
@NotNull(message = "{validation.constraints.CronId_empty.message}")
@Min(value = 1L, message = "{validation.constraints.InvalidCronId.message}")
private Long id;
}

0 comments on commit 41beb92

Please sign in to comment.