Modify Multi-step Testing Task¶
POST /api/v1/dialing_task/{task_uuid}/multi_task_modify
Overview¶
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
regions | array | Y | Regions List Allow empty: False |
task | json | Y | Task Configuration Allow empty: False $maxDictLength: 20000 |
task.name | string | Y | Task Name Allow empty: False |
task.frequency | string | Y | Testing Frequency Allow empty: False Optional values: ['1m', '5m', '15m', '30m', '1h', '6h', '12h', '24h'] |
task.desc | string | Task Description Allow empty: False Allow empty string: True Example: This is a description |
|
task.steps | array | Y | Steps List Allow empty: False |
tags | array | Tags Name List Allow empty: False Example: ['xx', 'yy'] |
Additional Parameter Explanation¶
Data Explanation.
Parameter Name | Type | Required | Description |
---|---|---|---|
regions | array | Y | Task execution regions |
task | json | Y | Task details |
task.name | string | Y | Task name |
task.frequency | string | Y | Task frequency |
task.desc | string | N | Task description |
task.steps | string | Y | Multi-step testing steps list |
task.steps.allow_failure | boolean | N | If this step fails, whether to continue executing the next step (required when type is http) |
task.steps.extracted_vars | array | N | Local variables list (required when type is http) |
task.steps.task | json | N | Step task details (required when type is http) |
task.steps.type | string | Y | Step task type, optional values: [http ,wait ] http-http request step, wait-wait step |
task.steps.value | integer | N | Wait duration (unit: seconds, required when type is wait) |
task.steps.stepId | string | N | Step id, if it's a new step, this parameter is not required |
tags | array | N | Tags list |
Note: For specific details of the task.steps.task parameter inside the step task details, refer to Custom Testing¶
Extracted_vars Parameter Explanation.
Parameter Name | Type | Required | Description |
---|---|---|---|
field | string | Y | Variable value |
name | string | Y | Variable name |
secure | boolean | Y | Whether the variable value is encrypted |
Step Task Details Task Parameter Explanation
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | Step name |
url | string | Y | URL |
method | string | Y | URL request method |
advance_options | json | N | Advanced options |
success_when_logic | enum | N | Optional values: [and , or ], logical relationship within the success_when parameter, default is and |
success_when | array | Y | Testing determination conditions |
post_mode | string | N | Availability judgment mode Default-default Script mode-script |
post_script | string | N | Availability judgment script content |
Request Example¶
curl 'https://openapi.guance.com/api/v1/dialing_task/dial_xxxx/multi_task_modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"regions":["reg_xxxx"],"task":{"desc":"This is a description","name":"multi-test3","steps":[{"task":{"name":"test","method":"GET","url":"https://xxxx","advance_options":{"request_options":{"headers":{"x-ft-auth-token":"xxxx","x-workspace-uuid":"wksp_xxxx"},"auth":{"username":"","password":""}},"request_body":{"body_type":"","body":""},"secret":{"not_save":false}},"post_mode":"script","post_script":"body = load_json(response[\"body\"])\n\nvars[\"uuid\"] = body[\"content\"][\"uuid\"]"},"type":"http","allow_failure":true,"extracted_vars":[{"name":"UUID","field":"uuid","secure":false}]},{"type":"wait","value":180},{"task":{"name":"test","method":"GET","url":"https://xxxx","advance_options":{"request_options":{"headers":{"x-ft-auth-token":"xxxx","x-workspace-uuid":"wksp_xxxx"},"auth":{"username":"","password":""}},"request_body":{"body_type":"","body":""},"secret":{"not_save":false}},"success_when":[{"status_code":[{"is":"200"}],"header":{"aaa":[{"is":"bbb"}]}}],"success_when_logic":"and","post_mode":"default"},"type":"http","allow_failure":true,"extracted_vars":[]}],"frequency":"30m"},"tags":[]}' \
--compressed
Response¶
{
"code": 200,
"content": {
"createAt": 1743501586,
"creator": "wsak_xxxx",
"declaration": {},
"deleteAt": -1,
"id": null,
"isLocked": false,
"regions": [
"reg_xxxx"
],
"regionsInfo": [
"reg_xxxx"
],
"status": 0,
"tagInfo": [],
"task": {
"config_vars": [],
"desc": "This is a description",
"df_label": "",
"external_id": "dial_xxxx",
"frequency": "30m",
"name": "multi-test3",
"owner_external_id": "wksp_xxxx",
"post_url": "http://xxxxx",
"status": "ok",
"steps": [
{
"allow_failure": true,
"extracted_vars": [
{
"field": "uuid",
"name": "UUID",
"secure": false
}
],
"stepId": "03db0636-e25f-4327-a70c-20e99b12e4bc",
"task": "{\"name\": \"test\", \"method\": \"GET\", \"url\": \"https://xxxx\", \"advance_options\": {\"request_options\": {\"headers\": {\"x-ft-auth-token\": \"xxxx\", \"x-workspace-uuid\": \"wksp_xxxxx\"}, \"auth\": {\"username\": \"\", \"password\": \"\"}}, \"request_body\": {\"body_type\": \"\", \"body\": \"\"}, \"secret\": {\"not_save\": false}}, \"post_mode\": \"script\", \"post_script\": \"body = load_json(response[\\\"body\\\"])\\n\\nvars[\\\"uuid\\\"] = body[\\\"content\\\"][\\\"uuid\\\"]\"}",
"type": "http"
},
{
"stepId": "6c97b32e-6e21-4e41-9d9b-c3deb4f0b3fe",
"type": "wait",
"value": 180
},
{
"allow_failure": true,
"extracted_vars": [],
"stepId": "88f9ab01-bd59-4ed7-afe0-62a875dc84e1",
"task": "{\"name\": \"test\", \"method\": \"GET\", \"url\": \"https://xxx\", \"advance_options\": {\"request_options\": {\"headers\": {\"x-ft-auth-token\": \"xxxx\", \"x-workspace-uuid\": \"wksp_xxxx\"}, \"auth\": {\"username\": \"\", \"password\": \"\"}}, \"request_body\": {\"body_type\": \"\", \"body\": \"\"}, \"secret\": {\"not_save\": false}}, \"success_when\": [{\"status_code\": [{\"is\": \"200\"}], \"header\": {\"aaa\": [{\"is\": \"bbb\"}]}}], \"success_when_logic\": \"and\", \"post_mode\": \"default\"}",
"type": "http"
}
],
"workspace_language": "en"
},
"type": "multi",
"updateAt": -1,
"updator": "",
"uuid": "dial_xxxx",
"workspaceUUID": "wksp_xxxx"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-2F7F4ABE-138C-453E-9295-EF58A1F70F4A"
}