コンテンツにスキップ

マルチステップ API テストタスクの変更



POST /api/v1/dialing_task/{task_uuid}/multi_task_modify

概要

Body リクエストパラメータ

パラメータ名 タイプ 必須 説明
regions array Y 地域リスト
空を許可しない: False
task json Y タスク設定
空を許可しない: False
$maxDictLength: 20000
task.name string Y タスク名。トリム後、空でなく、最大256文字。トリム後の結果を保存する
空を許可しない: False
task.frequency string Y テスト頻度
空を許可しない: False
選択可能な値: ['1m', '5m', '15m', '30m', '1h', '6h', '12h', '24h']
task.desc string タスク説明
空を許可しない: False
空文字列を許可する: True
例: 这是一个描述
task.steps array Y 地域リスト
空を許可しない: False
tags array タグ名リスト
空を許可しない: False
例: ['xx', 'yy']

パラメータ補足説明

データ説明.

パラメータ名 type 必須 説明
regions array Y タスク実行地域
task json Y タスク詳細
task.name string Y タスク名
task.frequency string Y タスク頻度
task.desc string N タスク説明
task.steps string Y マルチステップテストステップリスト
task.steps.allow_failure boolean N このステップが失敗した場合、次のステップを続行するかどうか(type が http の場合は必須)
task.steps.extracted_vars array N ローカル変数リスト(type が http の場合は必須)
task.steps.task json N ステップタスク詳細(type が http の場合は必須)
task.steps.type string Y ステップタスクタイプ。選択可能な値:[http,wait] http-http リクエストステップ、wait-待機ステップ
task.steps.value integer N 待機時間(単位:秒、type が wait の場合は必須)
task.steps.stepId string N ステップID。新規作成ステップの場合は必須ではない
tags array N タグリスト

注意: ステップタスク詳細 task.steps.task パラメータの内部詳細については、カスタムテスト を参照してください。

extracted_vars パラメータ説明.

パラメータ名 type 必須 説明
field string Y 変数値
name string Y 変数名
secure boolean Y 変数値の暗号化有無

ステップタスク詳細 task パラメータ説明

パラメータ名 type 必須 説明
name string Y ステップ名
url string Y url
method string Y URL リクエストメソッド
advance_options json N 詳細オプション
success_when_logic enum N 選択可能な値:[and, or]。success_when パラメータ内の論理関係。デフォルトは and
success_when array Y テスト判定条件
post_mode string N 可用性判断モード デフォルト-default スクリプトモード-script
post_script string N 可用性判断スクリプト内容

リクエスト例

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":"desc1","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

レスポンス

{
    "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": "desc1",
            "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": "zh"
        },
        "type": "multi",
        "updateAt": -1,
        "updator": "",
        "uuid": "dial_xxxx",
        "workspaceUUID": "wksp_xxxx"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-2F7F4ABE-138C-453E-9295-EF58A1F70F4A"
}

フィードバック

このページは役に立ちましたか?