수정¶
POST /api/v1/dialing_task/{task_uuid}/modify
개요¶
경로 매개변수¶
| 매개변수명 | 유형 | 필수 | 설명 |
|---|---|---|---|
| task_uuid | string | Y | 클라우드 신서틱 테스트 작업의 ID |
본문 요청 매개변수¶
| 매개변수명 | 유형 | 필수 | 설명 |
|---|---|---|---|
| regions | array | Y | 지역 목록 비어 있음 허용: False |
| task | json | Y | 작업 구성 비어 있음 허용: False $maxDictLength: 65536 |
| task.url | string | URL 비어 있음 허용: False |
|
| task.method | string | 메서드 비어 있음 허용: False |
|
| task.name | string | Y | 작업 이름, trim 후 비어 있지 않고 최대 256자, trim 결과 저장 비어 있음 허용: False |
| task.frequency | string | Y | 신서틱 테스트 빈도 비어 있음 허용: False 선택 가능 값: ['1m', '5m', '15m', '30m', '1h', '6h', '12h', '24h'] |
| task.schedule_type | string | 빈도 유형 비어 있음 허용: False 선택 가능 값: ['frequency', 'crontab'] |
|
| task.crontab | string | crontab 표현식 비어 있음 허용: False |
|
| task.advance_options | json | 고급 옵션 비어 있음 허용: False |
|
| task.advance_options_headless | json | browser의 고급 옵션 설정 비어 있음 허용: False |
|
| task.success_when_logic | string | success_when 내 조건의 논리 관계, 기본값 and비어 있음 허용: False 선택 가능 값: ['and', 'or'] |
|
| task.success_when | array | success_when 비어 있음 허용: False |
|
| task.enable_traceroute | boolean | 경로 추적 비어 있음 허용: False |
|
| task.packet_count | integer | 신서틱 테스트당 전송할 ping 개수 비어 있음 허용: False |
|
| task.protocol | string | type=netpath인 경우, 프로브 프로토콜 tcp/udp/icmp 비어 있음 허용: False |
|
| task.host | string | type=tcp/icmp/ssl/netpath인 경우, 필수 매개변수 비어 있음 허용: False |
|
| task.port | string | type=tcp/ssl 또는 type=netpath이고 프로토콜이 tcp/udp인 경우, 필수 매개변수; NetPath ICMP는 무시 비어 있음 허용: False |
|
| task.server_name | string | type=ssl인 경우, 선택적 매개변수 비어 있음 허용: False |
|
| task.timeout | string | type=tcp/icmp/ssl인 경우, 선택적 매개변수 비어 있음 허용: False |
|
| task.ignore_server_certificate_error | boolean | type=ssl인 경우, 서버 인증서 오류 무시 여부 비어 있음 허용: False |
|
| task.message | string | type=websocket인 경우, 필수 매개변수 비어 있음 허용: False |
|
| task.post_mode | string | 가용성 판단 모드, 기본값-default, 스크립트 모드-script 비어 있음 허용: False |
|
| task.post_script | string | 스크립트 내용 비어 있음 허용: False 빈 문자열 허용: True |
|
| tags | array | 태그 이름 목록 비어 있음 허용: False |
매개변수 추가 설명¶
데이터 설명.
| 매개변수명 | type | 필수 | 설명 |
|---|---|---|---|
| type | string | Y | 클라우드 신서틱 테스트 유형, http,tcp,dns, browser,tcp,icmp,websocket,ssl,netpath 중 선택 가능 |
| regions | array | Y | 작업 실행 지역 |
| task | json | Y | 작업 세부 정보 |
| task.name | string | Y | 작업 이름 |
| task.url | string | Y | URL |
| task.method | string | Y | URL 요청 메서드 |
| task.status | string | Y | 작업 상태, ok,stop 중 선택 가능 |
| task.frequency | string | Y | 작업 빈도 |
| task.schedule_type | string | N | 작업 빈도 유형, frequency,crontab 중 선택 가능 |
| task.crontab | string | N | crontab 표현식 |
| task.advance_options | json | Y/N | type=netpath인 경우 필수, timeout/source_name/target_name/max_ttl/e2e_queries/traceroute_queries만 허용 |
| task.protocol | enum | Y/N | type=netpath인 경우 필수, [tcp, udp, icmp] 중 선택 가능 |
| task.success_when_logic | enum | N | [and, or] 중 선택 가능, success_when 매개변수 내 논리 관계, 기본값 and |
| task.success_when | array | Y/N | type=http/netpath인 경우 필수, type=browser인 경우 선택적 매개변수 |
| task.enable_traceroute | boolean | N | type=tcp/icmp인 경우, 이 매개변수는 선택적 | |
| task.packet_count | integer | N | type=icmp인 경우, 이 매개변수는 선택적 | | |
| task.host | string | N | type=tcp/icmp/ssl/netpath인 경우 필수 | |
| task.port | string | N | type=tcp/ssl 또는 type=netpath이고 프로토콜이 tcp/udp인 경우 필수; NetPath ICMP는 이 필드 무시 | |
| task.advance_options.timeout | string | Y/N | type=netpath인 경우 필수, 범위 1s-30s |
| task.server_name | string | N | type=ssl인 경우, 선택적 매개변수 |
| task.timeout | string | N | type=tcp/icmp/ssl인 경우, 이 매개변수는 선택적 |
| task.ignore_server_certificate_error | boolean | N | type=ssl인 경우, 서버 인증서 오류 무시 여부 |
| task.message | string | Y/N | type=websocket인 경우, 이 매개변수 필수 | |
| task.post_mode | string | N | 가용성 판단 모드, 기본값-default, 스크립트 모드-script |
| task.post_script | string | N | 가용성 판단 스크립트 내용 |
| tags | array | N | 태그 목록 |
NetPath 작업 계약 (type=netpath)
| 필드 | 유형 | 필수 | 제약 조건 |
|---|---|---|---|
| task.name | string | Y | trim 후 비어 있지 않고 최대 256자, trim 결과 저장 |
| task.protocol | string | Y | tcp, udp, icmp, 대소문자 구분 없음 |
| task.host | string | Y | trim 후 비어 있지 않음 |
| task.port | string | TCP/UDP 필수 | 1-65535 범위의 숫자 문자열, 선행 0 허용 및 원래 값 유지; ICMP는 무시 |
| task.success_when_logic | string | Y | and 또는 or |
| task.success_when | array | Y | 외부 배열 길이는 반드시 1이어야 하며, 최소 하나의 유효 조건 포함 |
| task.advance_options.timeout | string | Y | 1s-30s 범위의 정수 초 문자열 |
| task.advance_options.max_ttl | integer | Y | TCP/ICMP: 1-60; UDP: 1-255 |
| task.advance_options.e2e_queries | integer | Y | 1-100 |
| task.advance_options.traceroute_queries | integer | Y | 1-10 |
| task.advance_options.source_name | string | N | trim 후 비어 있으면 삭제, 비어 있지 않으면 최대 128자 |
| task.advance_options.target_name | string | N | trim 후 비어 있으면 삭제, 비어 있지 않으면 최대 128자 |
success_when[0]는 다음 지표를 허용하며, 각 지표 값은 비어 있지 않은 조건 배열이며, 조건 객체는 op와 target만 허용:
| 지표 | op | target |
|---|---|---|
e2e_rtt_avg, e2e_rtt_min, e2e_rtt_max, e2e_rtt_variation_avg, e2e_rtt_variation_max |
lt/gt/leq/geq/eq |
음수가 아닌 밀리초 문자열, 예: 0.5ms |
e2e_probe_loss_percent |
lt/gt/leq/geq/eq |
0-100의 JSON number |
hop_count |
lt/gt/leq/geq/eq |
음수가 아닌 JSON integer |
e2e_status |
eq |
reached/partial/unknown/failed |
traceroute_status |
eq |
reached/partial/failed |
{
"type": "netpath",
"regions": ["reg_xxx"],
"task": {
"name": "api-to-db",
"protocol": "tcp",
"host": "db.internal",
"port": "0443",
"frequency": "5m",
"success_when_logic": "and",
"success_when": [{
"e2e_rtt_avg": [{"op": "lt", "target": "100ms"}],
"e2e_probe_loss_percent": [{"op": "leq", "target": 1.5}],
"traceroute_status": [{"op": "eq", "target": "reached"}]
}],
"advance_options": {
"timeout": "10s",
"max_ttl": 30,
"e2e_queries": 10,
"traceroute_queries": 3,
"source_name": "API",
"target_name": "DB"
}
}
}
* 참고 *: 신서틱 테스트 작업 task 매개변수 내부의 세부 사항은 사용자 정의 신서틱 테스트를 참조하세요.¶
{
"regions": [hangzhou, shanghai],
"task":{
"url":"http://example.com/some/api",
"method":"POST",
"external_id":"외부 시스템에서 이 작업에 정의된 ID",
"post_url":" 이 매개변수는 Studio 백엔드에서 제공합니다. https://dataway.cn?token=tkn_xxx",
"status":"ok/stop",
"name":"작업 이름",
"frequency":"1m",
"regions":"beijing",
"advance_options":{
"request_options":{
"follow_redirect":true,
"headers":{
"header1":"value1",
"header2":"value2"
},
"cookies":"",
"auth":{
"username":"",
"password":""
}
},
"request_body":{
"body_type":"text/plain|application/json|text/xml",
"body":""
},
"certificate":{
"ignore_server_certificate_error":false,
"private_key":"",
"certificate":""
},
"proxy":{
"url":"",
"headers":{
"header1":"value1"
}
}
},
"success_when_logic": "and",
"success_when":[
{
"body":{
"contains":"",
"not_contains":"",
"is":"",
"is_not":"",
"match_regex":"",
"not_match_regex":""
},
"header":{
"header-name":{
"contains":"",
"not_contains":"",
"is":"",
"is_not":"",
"match_regex":"",
"not_match_regex":""
},
"another-header-name":"..."
},
"response_time":"100ms",
"status_code":[
{ "is":"200" },
{ "is_not":"400"},
{"match_regex":"ok*"},
{"not_match_regex":"*bad"}
]
},
{
"AND_another_assert":"..."
}
]
},
"tags": ["태그 이름"]
}
*** task.frequency 매개변수 설명 *
무료 플랜 워크스페이스의 시간 빈도 범위는 30m/1h/6h/12h/24h입니다.
요청 예시¶
curl 'https://openapi.guance.com/api/v1/dialing_task/dial_xxxx32/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"regions":["reg_xxxx20"],"task":{"frequency":"1m","method":"GET","url":"https://www.baidu.com","name":"test","advance_options":{"request_options":{"follow_redirect":false,"headers":{},"cookies":"","auth":{"username":"","password":""}},"request_body":{"body_type":"","body":""},"secret":{"not_save":false}},"success_when":[{"body":[{"contains":"200"}]}],"success_when_logic":"and"},"tags":["test"]}' \
--compressed
응답¶
{
"code": 200,
"content": {
"createAt": 1686193610,
"creator": "acnt_xxxx32",
"deleteAt": -1,
"id": null,
"regions": [
"reg_xxxx20"
],
"status": 0,
"tagInfo": [
{
"id": "tag_xxxx32",
"name": "test"
}
],
"task": {
"advance_options": {
"request_body": {
"body": "",
"body_type": ""
},
"request_options": {
"auth": {
"password": "",
"username": ""
},
"cookies": "",
"follow_redirect": false,
"headers": {}
},
"secret": {
"not_save": false
}
},
"external_id": "dial_xxxx32",
"frequency": "1m",
"method": "GET",
"name": "test",
"owner_external_id": "wksp_xxxx32",
"post_url": "http://testing-openway.cloudcare.cn?token=tkn_xxxxx",
"status": "ok",
"tagInfo": [],
"success_when": [
{
"body": [
{
"contains": "200"
}
]
}
],
"success_when_logic": "and",
"url": "https://www.baidu.com"
},
"type": "http",
"updateAt": 1686193610,
"updator": "acnt_xxxx32",
"uuid": "dial_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "712401530723551303"
}