|
12 | 12 | }, |
13 | 13 | "actions": { |
14 | 14 | "test_install": { |
15 | | - "target": {"Command": "aliyun --version"}, |
| 15 | + "target": { |
| 16 | + "Command": { |
| 17 | + "command": "aliyun --version", |
| 18 | + "in_vm": false |
| 19 | + } |
| 20 | +}, |
16 | 21 | "parse_rules": { |
17 | 22 | "type": "object", |
18 | 23 | "patterns": { |
|
24 | 29 | } |
25 | 30 | }, |
26 | 31 | "list_workers": { |
27 | | - "target": {"Command": "aliyun ecs DescribeInstances --RegionId {region} --output json"}, |
| 32 | + "target": { |
| 33 | + "Command": { |
| 34 | + "command": "aliyun ecs DescribeInstances --RegionId {region} --output json", |
| 35 | + "in_vm": false |
| 36 | + } |
| 37 | +}, |
28 | 38 | "params": [ |
29 | 39 | "region" |
30 | 40 | ], |
|
39 | 49 | } |
40 | 50 | }, |
41 | 51 | "create_worker": { |
42 | | - "target": {"Command": "aliyun ecs CreateInstance --RegionId {region} --ZoneId {zone} --ImageId {image_id} --InstanceType {worker_type} --SecurityGroupId {security_group} --InstanceName {name} --InternetMaxBandwidthOut {internet_max_bandwidth_out} --KeyPairName {ssh_key_name} --output json"}, |
| 52 | + "target": { |
| 53 | + "Command": { |
| 54 | + "command": "aliyun ecs CreateInstance --RegionId {region} --ZoneId {zone} --ImageId {image_id} --InstanceType {worker_type} --SecurityGroupId {security_group} --InstanceName {name} --InternetMaxBandwidthOut {internet_max_bandwidth_out} --KeyPairName {ssh_key_name} --output json", |
| 55 | + "in_vm": false |
| 56 | + } |
| 57 | +}, |
43 | 58 | "params": [ |
44 | 59 | "region", |
45 | 60 | "zone", |
|
60 | 75 | } |
61 | 76 | }, |
62 | 77 | "start_worker": { |
63 | | - "target": {"Command": "aliyun ecs StartInstance --InstanceId {worker_id} --output json"}, |
| 78 | + "target": { |
| 79 | + "Command": { |
| 80 | + "command": "aliyun ecs StartInstance --InstanceId {worker_id} --output json", |
| 81 | + "in_vm": false |
| 82 | + } |
| 83 | +}, |
64 | 84 | "params": [ |
65 | 85 | "worker_id" |
66 | 86 | ], |
|
75 | 95 | } |
76 | 96 | }, |
77 | 97 | "stop_worker": { |
78 | | - "target": {"Command": "aliyun ecs StopInstance --InstanceId {worker_id} --ForceStop {force} --output json"}, |
| 98 | + "target": { |
| 99 | + "Command": { |
| 100 | + "command": "aliyun ecs StopInstance --InstanceId {worker_id} --ForceStop {force} --output json", |
| 101 | + "in_vm": false |
| 102 | + } |
| 103 | +}, |
79 | 104 | "params": [ |
80 | 105 | "worker_id" |
81 | 106 | ], |
|
93 | 118 | } |
94 | 119 | }, |
95 | 120 | "reboot_worker": { |
96 | | - "target": {"Command": "aliyun ecs RebootInstance --InstanceId {worker_id} --ForceStop {force} --output json"}, |
| 121 | + "target": { |
| 122 | + "Command": { |
| 123 | + "command": "aliyun ecs RebootInstance --InstanceId {worker_id} --ForceStop {force} --output json", |
| 124 | + "in_vm": false |
| 125 | + } |
| 126 | +}, |
97 | 127 | "params": [ |
98 | 128 | "worker_id" |
99 | 129 | ], |
|
111 | 141 | } |
112 | 142 | }, |
113 | 143 | "delete_worker": { |
114 | | - "target": {"Command": "aliyun ecs DeleteInstance --InstanceId {worker_id} --Force {force} --output json"}, |
| 144 | + "target": { |
| 145 | + "Command": { |
| 146 | + "command": "aliyun ecs DeleteInstance --InstanceId {worker_id} --Force {force} --output json", |
| 147 | + "in_vm": false |
| 148 | + } |
| 149 | +}, |
115 | 150 | "params": [ |
116 | 151 | "worker_id" |
117 | 152 | ], |
|
129 | 164 | } |
130 | 165 | }, |
131 | 166 | "get_worker": { |
132 | | - "target": {"Command": "aliyun ecs DescribeInstances --RegionId {region} --InstanceIds '['{worker_id}']' --output json"}, |
| 167 | + "target": { |
| 168 | + "Command": { |
| 169 | + "command": "aliyun ecs DescribeInstances --RegionId {region} --InstanceIds '['{worker_id}']' --output json", |
| 170 | + "in_vm": false |
| 171 | + } |
| 172 | +}, |
133 | 173 | "params": [ |
134 | 174 | "region", |
135 | 175 | "worker_id" |
|
145 | 185 | } |
146 | 186 | }, |
147 | 187 | "list_regions": { |
148 | | - "target": {"Command": "aliyun ecs DescribeRegions --output json"}, |
| 188 | + "target": { |
| 189 | + "Command": { |
| 190 | + "command": "aliyun ecs DescribeRegions --output json", |
| 191 | + "in_vm": false |
| 192 | + } |
| 193 | +}, |
149 | 194 | "parse_rules": { |
150 | 195 | "type": "object", |
151 | 196 | "patterns": { |
|
157 | 202 | } |
158 | 203 | }, |
159 | 204 | "list_regions": { |
160 | | - "target": {"Command": "aliyun ecs DescribeZones --RegionId {region} --output json"}, |
| 205 | + "target": { |
| 206 | + "Command": { |
| 207 | + "command": "aliyun ecs DescribeZones --RegionId {region} --output json", |
| 208 | + "in_vm": false |
| 209 | + } |
| 210 | +}, |
161 | 211 | "params": [ |
162 | 212 | "region" |
163 | 213 | ], |
|
172 | 222 | } |
173 | 223 | }, |
174 | 224 | "list_worker_types": { |
175 | | - "target": {"Command": "aliyun ecs DescribeInstanceTypes --output json"}, |
| 225 | + "target": { |
| 226 | + "Command": { |
| 227 | + "command": "aliyun ecs DescribeInstanceTypes --output json", |
| 228 | + "in_vm": false |
| 229 | + } |
| 230 | +}, |
176 | 231 | "parse_rules": { |
177 | 232 | "type": "object", |
178 | 233 | "patterns": { |
|
184 | 239 | } |
185 | 240 | }, |
186 | 241 | "list_images": { |
187 | | - "target": {"Command": "aliyun ecs DescribeImages --RegionId {region} --ImageOwnerAlias system --output json"}, |
| 242 | + "target": { |
| 243 | + "Command": { |
| 244 | + "command": "aliyun ecs DescribeImages --RegionId {region} --ImageOwnerAlias system --output json", |
| 245 | + "in_vm": false |
| 246 | + } |
| 247 | +}, |
188 | 248 | "params": [ |
189 | 249 | "region" |
190 | 250 | ], |
|
199 | 259 | } |
200 | 260 | }, |
201 | 261 | "create_volume": { |
202 | | - "target": {"Command": "aliyun ecs CreateDisk --RegionId {region} --ZoneId {zone} --DiskName {disk_name} --DiskCategory {disk_type} --Size {size_gb} --output json"}, |
| 262 | + "target": { |
| 263 | + "Command": { |
| 264 | + "command": "aliyun ecs CreateDisk --RegionId {region} --ZoneId {zone} --DiskName {disk_name} --DiskCategory {disk_type} --Size {size_gb} --output json", |
| 265 | + "in_vm": false |
| 266 | + } |
| 267 | +}, |
203 | 268 | "params": [ |
204 | 269 | "region", |
205 | 270 | "zone", |
|
218 | 283 | } |
219 | 284 | }, |
220 | 285 | "list_volumes": { |
221 | | - "target": {"Command": "aliyun ecs DescribeDisks --RegionId {region} --output json"}, |
| 286 | + "target": { |
| 287 | + "Command": { |
| 288 | + "command": "aliyun ecs DescribeDisks --RegionId {region} --output json", |
| 289 | + "in_vm": false |
| 290 | + } |
| 291 | +}, |
222 | 292 | "params": [ |
223 | 293 | "region" |
224 | 294 | ], |
|
233 | 303 | } |
234 | 304 | }, |
235 | 305 | "delete_volume": { |
236 | | - "target": {"Command": "aliyun ecs DeleteDisk --DiskId {disk_id} --output json"}, |
| 306 | + "target": { |
| 307 | + "Command": { |
| 308 | + "command": "aliyun ecs DeleteDisk --DiskId {disk_id} --output json", |
| 309 | + "in_vm": false |
| 310 | + } |
| 311 | +}, |
237 | 312 | "params": [ |
238 | 313 | "disk_id" |
239 | 314 | ], |
|
248 | 323 | } |
249 | 324 | }, |
250 | 325 | "attach_volume": { |
251 | | - "target": {"Command": "aliyun ecs AttachDisk --InstanceId {worker_id} --DiskId {disk_id} --DeleteWithInstance {auto_delete} --output json"}, |
| 326 | + "target": { |
| 327 | + "Command": { |
| 328 | + "command": "aliyun ecs AttachDisk --InstanceId {worker_id} --DiskId {disk_id} --DeleteWithInstance {auto_delete} --output json", |
| 329 | + "in_vm": false |
| 330 | + } |
| 331 | +}, |
252 | 332 | "params": [ |
253 | 333 | "worker_id", |
254 | 334 | "disk_id" |
|
267 | 347 | } |
268 | 348 | }, |
269 | 349 | "detach_volume": { |
270 | | - "target": {"Command": "aliyun ecs DetachDisk --InstanceId {worker_id} --DiskId {disk_id} --output json"}, |
| 350 | + "target": { |
| 351 | + "Command": { |
| 352 | + "command": "aliyun ecs DetachDisk --InstanceId {worker_id} --DiskId {disk_id} --output json", |
| 353 | + "in_vm": false |
| 354 | + } |
| 355 | +}, |
271 | 356 | "params": [ |
272 | 357 | "worker_id", |
273 | 358 | "disk_id" |
|
283 | 368 | } |
284 | 369 | }, |
285 | 370 | "resize_volume": { |
286 | | - "target": {"Command": "aliyun ecs ResizeDisk --DiskId {disk_id} --NewSize {size_gb} --output json"}, |
| 371 | + "target": { |
| 372 | + "Command": { |
| 373 | + "command": "aliyun ecs ResizeDisk --DiskId {disk_id} --NewSize {size_gb} --output json", |
| 374 | + "in_vm": false |
| 375 | + } |
| 376 | +}, |
287 | 377 | "params": [ |
288 | 378 | "disk_id", |
289 | 379 | "size_gb" |
|
299 | 389 | } |
300 | 390 | }, |
301 | 391 | "resize_worker": { |
302 | | - "target": {"Command": "aliyun ecs ModifyInstanceSpec --InstanceId {worker_id} --InstanceType {worker_type} --output json"}, |
| 392 | + "target": { |
| 393 | + "Command": { |
| 394 | + "command": "aliyun ecs ModifyInstanceSpec --InstanceId {worker_id} --InstanceType {worker_type} --output json", |
| 395 | + "in_vm": false |
| 396 | + } |
| 397 | +}, |
303 | 398 | "params": [ |
304 | 399 | "worker_id", |
305 | 400 | "worker_type" |
|
315 | 410 | } |
316 | 411 | }, |
317 | 412 | "list_security_groups": { |
318 | | - "target": {"Command": "aliyun ecs DescribeSecurityGroups --RegionId {region} --output json"}, |
| 413 | + "target": { |
| 414 | + "Command": { |
| 415 | + "command": "aliyun ecs DescribeSecurityGroups --RegionId {region} --output json", |
| 416 | + "in_vm": false |
| 417 | + } |
| 418 | +}, |
319 | 419 | "params": [ |
320 | 420 | "region" |
321 | 421 | ], |
|
330 | 430 | } |
331 | 431 | }, |
332 | 432 | "create_security_group": { |
333 | | - "target": {"Command": "aliyun ecs CreateSecurityGroup --RegionId {region} --SecurityGroupName {name} --output json"}, |
| 433 | + "target": { |
| 434 | + "Command": { |
| 435 | + "command": "aliyun ecs CreateSecurityGroup --RegionId {region} --SecurityGroupName {name} --output json", |
| 436 | + "in_vm": false |
| 437 | + } |
| 438 | +}, |
334 | 439 | "params": [ |
335 | 440 | "region", |
336 | 441 | "name" |
|
346 | 451 | } |
347 | 452 | }, |
348 | 453 | "create_firewall_rule": { |
349 | | - "target": {"Command": "aliyun ecs AuthorizeSecurityGroup --RegionId {region} --SecurityGroupId {security_group_id} --IpProtocol {protocol} --PortRange {port} --SourceCidrIp {source} --output json"}, |
| 454 | + "target": { |
| 455 | + "Command": { |
| 456 | + "command": "aliyun ecs AuthorizeSecurityGroup --RegionId {region} --SecurityGroupId {security_group_id} --IpProtocol {protocol} --PortRange {port} --SourceCidrIp {source} --output json", |
| 457 | + "in_vm": false |
| 458 | + } |
| 459 | +}, |
350 | 460 | "params": [ |
351 | 461 | "region", |
352 | 462 | "security_group_id", |
|
365 | 475 | } |
366 | 476 | }, |
367 | 477 | "create_snapshot": { |
368 | | - "target": {"Command": "aliyun ecs CreateSnapshot --DiskId {disk_id} --SnapshotName {snapshot_name} --Description {description} --output json"}, |
| 478 | + "target": { |
| 479 | + "Command": { |
| 480 | + "command": "aliyun ecs CreateSnapshot --DiskId {disk_id} --SnapshotName {snapshot_name} --Description {description} --output json", |
| 481 | + "in_vm": false |
| 482 | + } |
| 483 | +}, |
369 | 484 | "params": [ |
370 | 485 | "disk_id", |
371 | 486 | "snapshot_name", |
|
382 | 497 | } |
383 | 498 | }, |
384 | 499 | "list_snapshots": { |
385 | | - "target": {"Command": "aliyun ecs DescribeSnapshots --RegionId {region} --output json"}, |
| 500 | + "target": { |
| 501 | + "Command": { |
| 502 | + "command": "aliyun ecs DescribeSnapshots --RegionId {region} --output json", |
| 503 | + "in_vm": false |
| 504 | + } |
| 505 | +}, |
386 | 506 | "params": [ |
387 | 507 | "region" |
388 | 508 | ], |
|
397 | 517 | } |
398 | 518 | }, |
399 | 519 | "delete_snapshot": { |
400 | | - "target": {"Command": "aliyun ecs DeleteSnapshot --SnapshotId {snapshot_id} --output json"}, |
| 520 | + "target": { |
| 521 | + "Command": { |
| 522 | + "command": "aliyun ecs DeleteSnapshot --SnapshotId {snapshot_id} --output json", |
| 523 | + "in_vm": false |
| 524 | + } |
| 525 | +}, |
401 | 526 | "params": [ |
402 | 527 | "snapshot_id" |
403 | 528 | ], |
|
0 commit comments