|
33 | 33 | tags_type, |
34 | 34 | zones_type, |
35 | 35 | ) |
| 36 | +from azure.cli.core.commands.validators import validate_file_or_dict |
36 | 37 | from azext_aks_preview._validators import ( |
37 | 38 | validate_nat_gateway_managed_outbound_ipv6_count, |
38 | 39 | validate_nat_gateway_v2_params, |
|
251 | 252 | validate_drain_batch_size, |
252 | 253 | validate_resource_group_parameter, |
253 | 254 | validate_location_resource_group_cluster_parameters, |
| 255 | + validate_prepared_image_specification_id, |
254 | 256 | ) |
255 | 257 | from azext_aks_preview.azurecontainerstorage._consts import ( |
256 | 258 | CONST_ACSTOR_ALL, |
@@ -1298,6 +1300,15 @@ def load_arguments(self, _): |
1298 | 1300 | is_preview=True, |
1299 | 1301 | help="Enable continuous control plane and addon monitor for the cluster.", |
1300 | 1302 | ) |
| 1303 | + # prepared image specification |
| 1304 | + c.argument( |
| 1305 | + 'prepared_image_specification_id', |
| 1306 | + options_list=["--prepared-image-specification-id", "--pis-id"], |
| 1307 | + is_preview=True, |
| 1308 | + validator=validate_prepared_image_specification_id, |
| 1309 | + help='The resource ID of the prepared image specification to use for provisioning nodes in the default ' |
| 1310 | + 'node pool.' |
| 1311 | + ) |
1301 | 1312 |
|
1302 | 1313 | with self.argument_context("aks update") as c: |
1303 | 1314 | # managed cluster paramerters |
@@ -2260,6 +2271,14 @@ def load_arguments(self, _): |
2260 | 2271 | 'Example: \'[{"type":"Standard","vnetSubnetId":"/subscriptions/.../subnets/mysubnet"}]\'', |
2261 | 2272 | is_preview=True, |
2262 | 2273 | ) |
| 2274 | + # prepared image specification |
| 2275 | + c.argument( |
| 2276 | + 'prepared_image_specification_id', |
| 2277 | + options_list=["--prepared-image-specification-id", "--pis-id"], |
| 2278 | + is_preview=True, |
| 2279 | + validator=validate_prepared_image_specification_id, |
| 2280 | + help='The resource ID of the prepared image specification to use for provisioning nodes in the node pool.' |
| 2281 | + ) |
2263 | 2282 |
|
2264 | 2283 | with self.argument_context("aks nodepool update") as c: |
2265 | 2284 | c.argument( |
@@ -2384,6 +2403,14 @@ def load_arguments(self, _): |
2384 | 2403 | is_preview=True, |
2385 | 2404 | help="Specify the GPU Multi-Instance GPU (MIG) strategy. Allowed values: Single, Mixed.", |
2386 | 2405 | ) |
| 2406 | + # prepared image specification |
| 2407 | + c.argument( |
| 2408 | + 'prepared_image_specification_id', |
| 2409 | + options_list=["--prepared-image-specification-id", "--pis-id"], |
| 2410 | + is_preview=True, |
| 2411 | + validator=validate_prepared_image_specification_id, |
| 2412 | + help='The resource ID of the prepared image specification to use for provisioning nodes in the node pool.' |
| 2413 | + ) |
2387 | 2414 |
|
2388 | 2415 | with self.argument_context("aks nodepool upgrade") as c: |
2389 | 2416 | # upgrade strategy |
@@ -3450,6 +3477,91 @@ def load_arguments(self, _): |
3450 | 3477 | help="Show all VM SKU information including those not available for the current subscription.", |
3451 | 3478 | ) |
3452 | 3479 |
|
| 3480 | + with self.argument_context("aks prepared-image-specification create") as c: |
| 3481 | + c.argument( |
| 3482 | + "name", |
| 3483 | + options_list=["--name", "-n"], |
| 3484 | + required=True, |
| 3485 | + help="The prepared image specification name.", |
| 3486 | + ) |
| 3487 | + c.argument( |
| 3488 | + "container_images", |
| 3489 | + nargs="+", |
| 3490 | + help="Container images.", |
| 3491 | + ) |
| 3492 | + c.argument( |
| 3493 | + "customization_scripts", |
| 3494 | + type=validate_file_or_dict, |
| 3495 | + help="Customization scripts. Expected value: json-string/@json-file.", |
| 3496 | + ) |
| 3497 | + c.argument( |
| 3498 | + "assign_identity", |
| 3499 | + validator=validate_assign_identity, |
| 3500 | + help="Specify an existing user assigned identity.", |
| 3501 | + ) |
| 3502 | + c.argument( |
| 3503 | + "version", |
| 3504 | + required=True, |
| 3505 | + help="The prepared image specification version.", |
| 3506 | + ) |
| 3507 | + |
| 3508 | + with self.argument_context("aks prepared-image-specification update") as c: |
| 3509 | + c.argument( |
| 3510 | + "name", |
| 3511 | + options_list=["--name", "-n"], |
| 3512 | + required=True, |
| 3513 | + help="The prepared image specification name.", |
| 3514 | + ) |
| 3515 | + |
| 3516 | + with self.argument_context("aks prepared-image-specification delete") as c: |
| 3517 | + c.argument( |
| 3518 | + "name", |
| 3519 | + options_list=["--name", "-n"], |
| 3520 | + required=True, |
| 3521 | + help="The prepared image specification name.", |
| 3522 | + ) |
| 3523 | + |
| 3524 | + with self.argument_context("aks prepared-image-specification show") as c: |
| 3525 | + c.argument( |
| 3526 | + "name", |
| 3527 | + options_list=["--name", "-n"], |
| 3528 | + required=True, |
| 3529 | + help="The prepared image specification name.", |
| 3530 | + ) |
| 3531 | + |
| 3532 | + with self.argument_context("aks prepared-image-specification version delete") as c: |
| 3533 | + c.argument( |
| 3534 | + "pis_name", |
| 3535 | + required=True, |
| 3536 | + help="The prepared image specification name.", |
| 3537 | + ) |
| 3538 | + c.argument( |
| 3539 | + "name", |
| 3540 | + options_list=["--name", "-n"], |
| 3541 | + required=True, |
| 3542 | + help="The version name.", |
| 3543 | + ) |
| 3544 | + |
| 3545 | + with self.argument_context("aks prepared-image-specification version list") as c: |
| 3546 | + c.argument( |
| 3547 | + "pis_name", |
| 3548 | + required=True, |
| 3549 | + help="The prepared image specification name.", |
| 3550 | + ) |
| 3551 | + |
| 3552 | + with self.argument_context("aks prepared-image-specification version show") as c: |
| 3553 | + c.argument( |
| 3554 | + "pis_name", |
| 3555 | + required=True, |
| 3556 | + help="The prepared image specification name.", |
| 3557 | + ) |
| 3558 | + c.argument( |
| 3559 | + "name", |
| 3560 | + options_list=["--name", "-n"], |
| 3561 | + required=True, |
| 3562 | + help="The version name.", |
| 3563 | + ) |
| 3564 | + |
3453 | 3565 |
|
3454 | 3566 | def _get_default_install_location(exe_name): |
3455 | 3567 | system = platform.system() |
|
0 commit comments