模板任务(Operator)接口
更新时间:2024-08-16
请求结构
- method:POST
- URL:/api/logic/oos/v1/operator/list
请求参数
名称 | 类型 | 描述 | 是否必须 | 参数位置 |
---|---|---|---|---|
pageNo | int | 页数,从1开始计数 | 是 | RequestBody参数 |
pageSize | int | 每页展示数量,最大值:100 | 是 | RequestBody参数 |
响应示例
请求示例
Java
1// config of client
2String endpoint = "http://oos.bj.baidubce.com";
3String userId = "a0d04************************ce4";
4String ak = "ALTA*******************CYG";
5String sk = "b2c5************************3ac1";
6// create oos client
7OosClientConfiguration config = new OosClientConfiguration();
8config.setCredentials(new DefaultBceCredentials(ak, sk));
9config.setEndpoint(endpoint);
10OosClient oosClient = new OosClient(config);
11// request params definition
12OperatorListRequest request = new OperatorListRequest();
13request.setPageNo(1);
14request.setPageSize(10);
15// call
16OperatorListResponse operatorList = oosClient.getOperatorList(request);
响应示例
JSON
1{
2 "metadata": {
3 "bceRequestId": "64da1e89-4b7c-4d7e-b276-6fa18c5b02dd",
4 "contentLength": 5340,
5 "contentType": "application/json;charset=UTF-8",
6 "date": 1713876907000,
7 "server": "BWS"
8 },
9 "success": true,
10 "msg": "",
11 "result": {
12 "operators": [
13 {
14 "name": "BCE::Agent::ExecuteHttp",
15 "label": "虚机执行Http请求",
16 "description": "虚机执行Http请求",
17 "operator": "BCE::Agent::ExecuteHttp",
18 "retries": 0,
19 "retryInterval": 300000,
20 "timeout": 21600000,
21 "parallelismRatio": 0.0,
22 "parallelismCount": 0,
23 "allowedFailureRatio": 0.0,
24 "allowedFailureCount": 0,
25 "manually": false,
26 "scheduleDelayMilli": 0,
27 "pauseOnFailure": false,
28 "properties": [
29 {
30 "name": "method",
31 "required": true,
32 "type": "string",
33 "label": "请求方法类型",
34 "multiple": false,
35 "description": "",
36 "options": [
37 "GET",
38 "POST",
39 "PUT",
40 "DELETE"
41 ],
42 "defaultValue": "",
43 "properties": []
44 },
45 {
46 "name": "url",
47 "required": true,
48 "type": "string",
49 "label": "请求地址",
50 "multiple": false,
51 "description": "",
52 "options": [],
53 "defaultValue": "",
54 "properties": []
55 },
56 {
57 "name": "headers",
58 "required": false,
59 "type": "list",
60 "label": "请求头",
61 "multiple": false,
62 "description": "",
63 "options": [],
64 "defaultValue": "",
65 "properties": []
66 },
67 {
68 "name": "body",
69 "required": false,
70 "type": "list",
71 "label": "请求体",
72 "multiple": false,
73 "description": "",
74 "options": [],
75 "defaultValue": "",
76 "properties": []
77 },
78 {
79 "name": "timeoutMill",
80 "required": false,
81 "type": "number",
82 "label": "请求连接超时时间",
83 "multiple": false,
84 "description": "",
85 "options": [],
86 "defaultValue": 10000,
87 "unit": "ms",
88 "properties": []
89 },
90 {
91 "name": "__workerSelectors__",
92 "required": true,
93 "type": "bccInstance",
94 "label": "执行脚本虚机列表",
95 "multiple": true,
96 "description": "",
97 "options": [],
98 "defaultValue": "",
99 "properties": []
100 }
101
102 ],
103 "initContext": {}
104 }
105 // 省略剩余
106 ],
107 "orderBy": "createTime",
108 "order": "desc",
109 "pageNo": 1,
110 "pageSize": 10,
111 "totalCount": 39
112 }
113}