更新深度巡检任务
请求信息
请求行
PUT /apis/testing.alauda.io/v1alpha1/namespaces/{namespace}/functiontests/{name}
更新指定的深度巡检任务。
请求行参数
名称 | 类型 | 是否必填项 | 描述 |
---|---|---|---|
name | string | 是 | 深度巡检任务的名称。 |
namespace | string | 是 | 命名空间。对象名称和身份验证范围,例如团队和项目。 |
请求参数
名称 | 类型 | 是否必填项 | 描述 |
---|---|---|---|
dryRun | string | 否 | 当该参数出现时,表示不应该持久化修改。一个无效的或无法识别的 dryRun 指令将导致错误响应,并且不会进一步处理请求。 有效值为:All,将处理所有的试运行阶段。 |
fieldManager | string | 否 | fieldManager 是与正在进行这些更改的参与者或实体相关联的名称。值必须少于 128 字符,且仅包含可打印字符,参见 https://golang.org/pkg/unicode/#IsPrint。 |
pretty | string | 否 | 如果为 true,则会将返回结果输出成适合打印的格式。 |
请求体
Content-Type
application/json
,
application/yaml
请求体示例
深度巡检任务是 functiontests API 的结构。
{
"apiVersion": "testing.alauda.io/v1alpha1",
"kind": "FunctionTest",
"metadata": {
"name": "check-example",
"resourceVersion": "48604602"
},
"spec": {
"environment": {
"businessCluster": "global"
},
"failedJobHistoryLimit": 3,
"functions": [
"*"
],
"schedule": "5 * * * *",
"successfulJobHistoryLimit": 3,
"suspend": false,
"type": "check"
}
}
请求体说明
名称 | 类型 | 是否必填项 | 描述 |
---|---|---|---|
apiVersion | string | 是 | 查看公共参数 |
kind | string | 是 | 查看公共参数 |
metadata | object | 是 | 查看公共参数 |
spec | object | 是 |
FunctionTestSpec 定义了深度巡检的期望状态。
字段路径:spec |
spec.environment | object | 是 |
检测对象的环境。
字段路径:spec.environment |
environment.businessCluster | string | 是 |
目标企业集群的名称。
字段路径:spec.environment.businessCluster |
spec.failedJobHistoryLimit | integer (int32) | 是 |
保留的未完成的定时任务个数。默认为 1。
字段路径:spec.failedJobHistoryLimit |
spec.functions | array | 是 |
指定的计划测试的功能。
字段路径:spec.functions |
spec.functions[] | string | 是 |
字段路径:spec.functions[] |
spec.schedule | string | 是 |
定时任务格式中的调度安排。参见 https://en.wikipedia.org/wiki/Cron
字段路径:spec.schedule |
spec.successfulJobHistoryLimit | integer (int32) | 是 |
保留的成功完成的任务记录的个数。默认为 3。
字段路径:spec.successfulJobHistoryLimit |
spec.suspend | boolean | 是 |
此标志用于通知控制器挂起后续执行记录,不适用于已经准备好开始的执行记录。默认为 false。
字段路径:spec.suspend |
spec.type | string | 是 |
指定巡检项的类型,check 或 test。
字段路径:spec.type |
返回信息
Content-Type
application/json
,
application/yaml
状态码: 200
OK
返回体示例
深度巡检任务是 functiontests API 的结构。
{
"apiVersion": "testing.alauda.io/v1alpha1",
"kind": "FunctionTest",
"metadata": {
"creationTimestamp": "2021-06-08T10:02:11Z",
"generation": 9,
"name": "check-example",
"namespace": "cpaas-system",
"resourceVersion": "51268868",
"selfLink": "/apis/testing.alauda.io/v1alpha1/namespaces/cpaas-system/functiontests/check-example2",
"uid": "e6bc4a4f-c050-451d-9375-1a3de04c6f58"
},
"spec": {
"environment": {
"businessCluster": "global"
},
"failedJobHistoryLimit": 3,
"functions": [
"*"
],
"schedule": "5 * * * *",
"successfulJobHistoryLimit": 3,
"suspend": false,
"type": "check"
},
"status": {
"estimatedCpu": 300,
"estimatedMemory": 300,
"estimatedTime": 71,
"lastScheduleResult": "failed",
"lastScheduleTime": "2021-06-16T09:00:23Z"
}
}
返回体说明
名称 | 类型 | 描述 |
---|---|---|
apiVersion | string | 查看公共参数 |
kind | string | 查看公共参数 |
metadata | object | 查看公共参数 |
spec | object |
FunctionTestSpec 定义了深度巡检的期望状态。
字段路径:spec |
spec.environment | object |
检测对象的环境。
字段路径:spec.environment |
environment.businessCluster | string |
目标企业集群的名称。
字段路径:spec.environment.businessCluster |
spec.failedJobHistoryLimit | integer (int32) |
保留的未完成的定时任务个数。默认为 1。
字段路径:spec.failedJobHistoryLimit |
spec.functions | array |
指定的计划测试的功能。
字段路径:spec.functions |
spec.functions[] | string |
字段路径:spec.functions[] |
spec.schedule | string |
定时任务格式中的调度安排。参见 https://en.wikipedia.org/wiki/Cron
字段路径:spec.schedule |
spec.successfulJobHistoryLimit | integer (int32) |
保留的成功完成的任务记录的个数。默认为 3。
字段路径:spec.successfulJobHistoryLimit |
spec.suspend | boolean |
此标志用于通知控制器挂起后续执行记录,不适用于已经准备好开始的执行记录。默认为 false。
字段路径:spec.suspend |
spec.type | string |
指定巡检项的类型,check 或 test。
字段路径:spec.type |
status | object |
FunctionTestStatus 定义了深度巡检任务被观察到的状态。
字段路径:status |
status.estimatedCpu | integer (int64) |
巡检任务运行时占用的 cpu 时间,单位是 m。
字段路径:status.estimatedCpu |
status.estimatedMemory | integer (int64) |
巡检任务运行时占用的存储空间,单位是 Mi。
字段路径:status.estimatedMemory |
status.estimatedTime | integer (int64) |
巡检任务预估运行时间。
字段路径:status.estimatedTime |
status.lastScheduleResult | string |
定时任务最后一次调度的结果信息。
字段路径:status.lastScheduleResult |
status.lastScheduleTime | string (date-time) |
定时任务最后一次调度成功的时间。
字段路径:status.lastScheduleTime |