|
6 | 6 | "api_version": "2022-08-01", |
7 | 7 | "location": "eastus", |
8 | 8 | "resource_group": "default-rg", |
9 | | - "vm_size": "Standard_B1s", |
| 9 | + "worker_size": "Standard_B1s", |
10 | 10 | "image": { |
11 | 11 | "publisher": "Canonical", |
12 | 12 | "offer": "UbuntuServer", |
|
157 | 157 | "create_worker": { |
158 | 158 | "target": { |
159 | 159 | "Endpoint": { |
160 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 160 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
161 | 161 | "method": "Put", |
162 | 162 | "headers": { |
163 | 163 | "Authorization": "Bearer {access_token}", |
164 | 164 | "Content-Type": "application/json" |
165 | 165 | }, |
166 | | - "body": "{\"location\":\"{location}\",\"properties\":{\"hardwareProfile\":{\"vmSize\":\"{vm_size}\"},\"storageProfile\":{\"imageReference\":{\"publisher\":\"{image_publisher}\",\"offer\":\"{image_offer}\",\"sku\":\"{image_sku}\",\"version\":\"{image_version}\"},\"osDisk\":{\"createOption\":\"FromImage\",\"managedDisk\":{\"storageAccountType\":\"{disk_sku}\"}}},\"osProfile\":{\"computerName\":\"{vm_name}\",\"adminUsername\":\"{admin_username}\",\"linuxConfiguration\":{\"disablePasswordAuthentication\":true,\"ssh\":{\"publicKeys\":[{\"path\":\"/home/{admin_username}/.ssh/authorized_keys\",\"keyData\":\"{ssh_public_key}\"}]}}},\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"{network_interface_id}\"}]}}}" |
| 166 | + "body": "{\"location\":\"{location}\",\"properties\":{\"hardwareProfile\":{\"vmSize\":\"{worker_size}\"},\"storageProfile\":{\"imageReference\":{\"publisher\":\"{image_publisher}\",\"offer\":\"{image_offer}\",\"sku\":\"{image_sku}\",\"version\":\"{image_version}\"},\"osDisk\":{\"createOption\":\"FromImage\",\"managedDisk\":{\"storageAccountType\":\"{disk_sku}\"}}},\"osProfile\":{\"computerName\":\"{worker_name}\",\"adminUsername\":\"{admin_username}\",\"linuxConfiguration\":{\"disablePasswordAuthentication\":true,\"ssh\":{\"publicKeys\":[{\"path\":\"/home/{admin_username}/.ssh/authorized_keys\",\"keyData\":\"{ssh_public_key}\"}]}}},\"networkProfile\":{\"networkInterfaces\":[{\"id\":\"{network_interface_id}\"}]}}}" |
167 | 167 | } |
168 | 168 | }, |
169 | 169 | "params": [ |
170 | 170 | "api_url", |
171 | 171 | "subscription_id", |
172 | 172 | "resource_group", |
173 | | - "vm_name", |
| 173 | + "worker_name", |
174 | 174 | "api_version", |
175 | 175 | "access_token", |
176 | 176 | "location", |
177 | | - "vm_size", |
| 177 | + "worker_size", |
178 | 178 | "image_publisher", |
179 | 179 | "image_offer", |
180 | 180 | "image_sku", |
|
201 | 201 | "delete_worker": { |
202 | 202 | "target": { |
203 | 203 | "Endpoint": { |
204 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 204 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
205 | 205 | "method": "Delete", |
206 | 206 | "headers": { |
207 | 207 | "Authorization": "Bearer {access_token}", |
|
213 | 213 | "api_url", |
214 | 214 | "subscription_id", |
215 | 215 | "resource_group", |
216 | | - "vm_name", |
| 216 | + "worker_name", |
217 | 217 | "api_version", |
218 | 218 | "access_token" |
219 | 219 | ], |
|
230 | 230 | "get_worker": { |
231 | 231 | "target": { |
232 | 232 | "Endpoint": { |
233 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 233 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
234 | 234 | "method": "Get", |
235 | 235 | "headers": { |
236 | 236 | "Authorization": "Bearer {access_token}", |
|
242 | 242 | "api_url", |
243 | 243 | "subscription_id", |
244 | 244 | "resource_group", |
245 | | - "vm_name", |
| 245 | + "worker_name", |
246 | 246 | "api_version", |
247 | 247 | "access_token" |
248 | 248 | ], |
|
276 | 276 | "start_worker": { |
277 | 277 | "target": { |
278 | 278 | "Endpoint": { |
279 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}/start?api-version={api_version}", |
| 279 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}/start?api-version={api_version}", |
280 | 280 | "method": "Post", |
281 | 281 | "headers": { |
282 | 282 | "Authorization": "Bearer {access_token}", |
|
288 | 288 | "api_url", |
289 | 289 | "subscription_id", |
290 | 290 | "resource_group", |
291 | | - "vm_name", |
| 291 | + "worker_name", |
292 | 292 | "api_version", |
293 | 293 | "access_token" |
294 | 294 | ], |
|
305 | 305 | "stop_worker": { |
306 | 306 | "target": { |
307 | 307 | "Endpoint": { |
308 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}/powerOff?api-version={api_version}", |
| 308 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}/powerOff?api-version={api_version}", |
309 | 309 | "method": "Post", |
310 | 310 | "headers": { |
311 | 311 | "Authorization": "Bearer {access_token}", |
|
317 | 317 | "api_url", |
318 | 318 | "subscription_id", |
319 | 319 | "resource_group", |
320 | | - "vm_name", |
| 320 | + "worker_name", |
321 | 321 | "api_version", |
322 | 322 | "access_token" |
323 | 323 | ], |
|
334 | 334 | "restart_worker": { |
335 | 335 | "target": { |
336 | 336 | "Endpoint": { |
337 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}/restart?api-version={api_version}", |
| 337 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}/restart?api-version={api_version}", |
338 | 338 | "method": "Post", |
339 | 339 | "headers": { |
340 | 340 | "Authorization": "Bearer {access_token}", |
|
346 | 346 | "api_url", |
347 | 347 | "subscription_id", |
348 | 348 | "resource_group", |
349 | | - "vm_name", |
| 349 | + "worker_name", |
350 | 350 | "api_version", |
351 | 351 | "access_token" |
352 | 352 | ], |
|
400 | 400 | "attach_volume": { |
401 | 401 | "target": { |
402 | 402 | "Endpoint": { |
403 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 403 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
404 | 404 | "method": "Get", |
405 | 405 | "headers": { |
406 | 406 | "Authorization": "Bearer {access_token}", |
|
412 | 412 | "api_url", |
413 | 413 | "subscription_id", |
414 | 414 | "resource_group", |
415 | | - "vm_name", |
| 415 | + "worker_name", |
416 | 416 | "api_version", |
417 | 417 | "access_token" |
418 | 418 | ], |
419 | 419 | "post_exec": [ |
420 | 420 | { |
421 | 421 | "target": { |
422 | 422 | "Endpoint": { |
423 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 423 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
424 | 424 | "method": "Put", |
425 | 425 | "headers": { |
426 | 426 | "Authorization": "Bearer {access_token}", |
427 | 427 | "Content-Type": "application/json" |
428 | 428 | }, |
429 | | - "body": "{...vm_template, \"properties\": {...vm_template.properties, \"storageProfile\": {...vm_template.properties.storageProfile, \"dataDisks\": [...vm_template.properties.storageProfile.dataDisks || [], {\"lun\": {next_lun}, \"name\": \"{disk_name}\", \"createOption\": \"Attach\", \"managedDisk\": {\"id\": \"{disk_id}\"}}]}}}" |
| 429 | + "body": "{...worker_template, \"properties\": {...worker_template.properties, \"storageProfile\": {...worker_template.properties.storageProfile, \"dataDisks\": [...worker_template.properties.storageProfile.dataDisks || [], {\"lun\": {next_lun}, \"name\": \"{disk_name}\", \"createOption\": \"Attach\", \"managedDisk\": {\"id\": \"{disk_id}\"}}]}}}" |
430 | 430 | } |
431 | 431 | }, |
432 | 432 | "params": [ |
433 | 433 | "api_url", |
434 | 434 | "subscription_id", |
435 | 435 | "resource_group", |
436 | | - "vm_name", |
| 436 | + "worker_name", |
437 | 437 | "api_version", |
438 | 438 | "access_token", |
439 | | - "vm_template", |
| 439 | + "worker_template", |
440 | 440 | "next_lun", |
441 | 441 | "disk_name", |
442 | 442 | "disk_id" |
|
455 | 455 | "parse_rules": { |
456 | 456 | "type": "object", |
457 | 457 | "patterns": { |
458 | | - "vm_template": { |
| 458 | + "worker_template": { |
459 | 459 | "regex": "(.*)", |
460 | 460 | "group": 1 |
461 | 461 | }, |
|
470 | 470 | "detach_volume": { |
471 | 471 | "target": { |
472 | 472 | "Endpoint": { |
473 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 473 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
474 | 474 | "method": "Get", |
475 | 475 | "headers": { |
476 | 476 | "Authorization": "Bearer {access_token}", |
|
482 | 482 | "api_url", |
483 | 483 | "subscription_id", |
484 | 484 | "resource_group", |
485 | | - "vm_name", |
| 485 | + "worker_name", |
486 | 486 | "api_version", |
487 | 487 | "access_token" |
488 | 488 | ], |
489 | 489 | "post_exec": [ |
490 | 490 | { |
491 | 491 | "target": { |
492 | 492 | "Endpoint": { |
493 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 493 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
494 | 494 | "method": "Put", |
495 | 495 | "headers": { |
496 | 496 | "Authorization": "Bearer {access_token}", |
497 | 497 | "Content-Type": "application/json" |
498 | 498 | }, |
499 | | - "body": "{...vm_template, \"properties\": {...vm_template.properties, \"storageProfile\": {...vm_template.properties.storageProfile, \"dataDisks\": vm_template.properties.storageProfile.dataDisks.filter(disk => disk.managedDisk.id !== \"{disk_id}\")}}}" |
| 499 | + "body": "{...worker_template, \"properties\": {...worker_template.properties, \"storageProfile\": {...worker_template.properties.storageProfile, \"dataDisks\": worker_template.properties.storageProfile.dataDisks.filter(disk => disk.managedDisk.id !== \"{disk_id}\")}}}" |
500 | 500 | } |
501 | 501 | }, |
502 | 502 | "params": [ |
503 | 503 | "api_url", |
504 | 504 | "subscription_id", |
505 | 505 | "resource_group", |
506 | | - "vm_name", |
| 506 | + "worker_name", |
507 | 507 | "api_version", |
508 | 508 | "access_token", |
509 | | - "vm_template", |
| 509 | + "worker_template", |
510 | 510 | "disk_id" |
511 | 511 | ], |
512 | 512 | "parse_rules": { |
|
523 | 523 | "parse_rules": { |
524 | 524 | "type": "object", |
525 | 525 | "patterns": { |
526 | | - "vm_template": { |
| 526 | + "worker_template": { |
527 | 527 | "regex": "(.*)", |
528 | 528 | "group": 1 |
529 | 529 | } |
|
640 | 640 | "resize_worker": { |
641 | 641 | "target": { |
642 | 642 | "Endpoint": { |
643 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 643 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
644 | 644 | "method": "Get", |
645 | 645 | "headers": { |
646 | 646 | "Authorization": "Bearer {access_token}", |
|
652 | 652 | "api_url", |
653 | 653 | "subscription_id", |
654 | 654 | "resource_group", |
655 | | - "vm_name", |
| 655 | + "worker_name", |
656 | 656 | "api_version", |
657 | 657 | "access_token" |
658 | 658 | ], |
659 | 659 | "post_exec": [ |
660 | 660 | { |
661 | 661 | "target": { |
662 | 662 | "Endpoint": { |
663 | | - "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{vm_name}?api-version={api_version}", |
| 663 | + "url": "{api_url}/subscriptions/{subscription_id}/resourceGroups/{resource_group}/providers/Microsoft.Compute/virtualMachines/{worker_name}?api-version={api_version}", |
664 | 664 | "method": "Put", |
665 | 665 | "headers": { |
666 | 666 | "Authorization": "Bearer {access_token}", |
667 | 667 | "Content-Type": "application/json" |
668 | 668 | }, |
669 | | - "body": "{...vm_template, \"properties\": {...vm_template.properties, \"hardwareProfile\": {\"vmSize\": \"{new_vm_size}\"}}}" |
| 669 | + "body": "{...worker_template, \"properties\": {...worker_template.properties, \"hardwareProfile\": {\"vmSize\": \"{new_worker_size}\"}}}" |
670 | 670 | } |
671 | 671 | }, |
672 | 672 | "params": [ |
673 | 673 | "api_url", |
674 | 674 | "subscription_id", |
675 | 675 | "resource_group", |
676 | | - "vm_name", |
| 676 | + "worker_name", |
677 | 677 | "api_version", |
678 | 678 | "access_token", |
679 | | - "vm_template", |
680 | | - "new_vm_size" |
| 679 | + "worker_template", |
| 680 | + "new_worker_size" |
681 | 681 | ], |
682 | 682 | "parse_rules": { |
683 | 683 | "type": "object", |
|
693 | 693 | "parse_rules": { |
694 | 694 | "type": "object", |
695 | 695 | "patterns": { |
696 | | - "vm_template": { |
| 696 | + "worker_template": { |
697 | 697 | "regex": "(.*)", |
698 | 698 | "group": 1 |
699 | 699 | } |
|
726 | 726 | } |
727 | 727 | } |
728 | 728 | }, |
729 | | - "list_vm_sizes": { |
| 729 | + "list_worker_sizes": { |
730 | 730 | "target": { |
731 | 731 | "Endpoint": { |
732 | 732 | "url": "{api_url}/subscriptions/{subscription_id}/providers/Microsoft.Compute/locations/{location}/vmSizes?api-version={api_version}", |
|
0 commit comments