Skip to content

Commit 00dd1c3

Browse files
Merge pull request #7 from OmniCloudOrg/In_VM-CPI-command-execution
Updated three remaining CPIs
2 parents 736b5d7 + f67f259 commit 00dd1c3

36 files changed

+4805
-1777
lines changed

CPIs/cpi-alibaba.json

Lines changed: 150 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@
1212
},
1313
"actions": {
1414
"test_install": {
15-
"target": {"Command": "aliyun --version"},
15+
"target": {
16+
"Command": {
17+
"command": "aliyun --version",
18+
"in_vm": false
19+
}
20+
},
1621
"parse_rules": {
1722
"type": "object",
1823
"patterns": {
@@ -24,7 +29,12 @@
2429
}
2530
},
2631
"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+
},
2838
"params": [
2939
"region"
3040
],
@@ -39,7 +49,12 @@
3949
}
4050
},
4151
"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+
},
4358
"params": [
4459
"region",
4560
"zone",
@@ -60,7 +75,12 @@
6075
}
6176
},
6277
"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+
},
6484
"params": [
6585
"worker_id"
6686
],
@@ -75,7 +95,12 @@
7595
}
7696
},
7797
"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+
},
79104
"params": [
80105
"worker_id"
81106
],
@@ -93,7 +118,12 @@
93118
}
94119
},
95120
"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+
},
97127
"params": [
98128
"worker_id"
99129
],
@@ -111,7 +141,12 @@
111141
}
112142
},
113143
"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+
},
115150
"params": [
116151
"worker_id"
117152
],
@@ -129,7 +164,12 @@
129164
}
130165
},
131166
"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+
},
133173
"params": [
134174
"region",
135175
"worker_id"
@@ -145,7 +185,12 @@
145185
}
146186
},
147187
"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+
},
149194
"parse_rules": {
150195
"type": "object",
151196
"patterns": {
@@ -157,7 +202,12 @@
157202
}
158203
},
159204
"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+
},
161211
"params": [
162212
"region"
163213
],
@@ -172,7 +222,12 @@
172222
}
173223
},
174224
"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+
},
176231
"parse_rules": {
177232
"type": "object",
178233
"patterns": {
@@ -184,7 +239,12 @@
184239
}
185240
},
186241
"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+
},
188248
"params": [
189249
"region"
190250
],
@@ -199,7 +259,12 @@
199259
}
200260
},
201261
"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+
},
203268
"params": [
204269
"region",
205270
"zone",
@@ -218,7 +283,12 @@
218283
}
219284
},
220285
"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+
},
222292
"params": [
223293
"region"
224294
],
@@ -233,7 +303,12 @@
233303
}
234304
},
235305
"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+
},
237312
"params": [
238313
"disk_id"
239314
],
@@ -248,7 +323,12 @@
248323
}
249324
},
250325
"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+
},
252332
"params": [
253333
"worker_id",
254334
"disk_id"
@@ -267,7 +347,12 @@
267347
}
268348
},
269349
"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+
},
271356
"params": [
272357
"worker_id",
273358
"disk_id"
@@ -283,7 +368,12 @@
283368
}
284369
},
285370
"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+
},
287377
"params": [
288378
"disk_id",
289379
"size_gb"
@@ -299,7 +389,12 @@
299389
}
300390
},
301391
"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+
},
303398
"params": [
304399
"worker_id",
305400
"worker_type"
@@ -315,7 +410,12 @@
315410
}
316411
},
317412
"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+
},
319419
"params": [
320420
"region"
321421
],
@@ -330,7 +430,12 @@
330430
}
331431
},
332432
"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+
},
334439
"params": [
335440
"region",
336441
"name"
@@ -346,7 +451,12 @@
346451
}
347452
},
348453
"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+
},
350460
"params": [
351461
"region",
352462
"security_group_id",
@@ -365,7 +475,12 @@
365475
}
366476
},
367477
"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+
},
369484
"params": [
370485
"disk_id",
371486
"snapshot_name",
@@ -382,7 +497,12 @@
382497
}
383498
},
384499
"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+
},
386506
"params": [
387507
"region"
388508
],
@@ -397,7 +517,12 @@
397517
}
398518
},
399519
"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+
},
401526
"params": [
402527
"snapshot_id"
403528
],

0 commit comments

Comments
 (0)