diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index 7725045d2cc..02bc6fff5ac 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -400,6 +400,9 @@ - name: --max-count type: int short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100] + - name: --uptime-sla + type: bool + short-summary: Enable a paid managed cluster service with a financially backed SLA. - name: --load-balancer-managed-outbound-ip-count type: int short-summary: Load balancer managed outbound IP count. diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index a1f873ebc0c..d3b059a86cd 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -221,6 +221,7 @@ def load_arguments(self, _): c.argument('update_cluster_autoscaler', options_list=["--update-cluster-autoscaler", "-u"], action='store_true') c.argument('min_count', type=int, validator=validate_nodes_count) c.argument('max_count', type=int, validator=validate_nodes_count) + c.argument('uptime_sla', action='store_true') c.argument('load_balancer_managed_outbound_ip_count', type=int) c.argument('load_balancer_outbound_ips', type=str, validator=validate_load_balancer_outbound_ips) c.argument('load_balancer_outbound_ip_prefixes', type=str, validator=validate_load_balancer_outbound_ip_prefixes) diff --git a/src/azure-cli/azure/cli/command_modules/acs/custom.py b/src/azure-cli/azure/cli/command_modules/acs/custom.py index c733afb0fa6..a769ee467f4 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/custom.py +++ b/src/azure-cli/azure/cli/command_modules/acs/custom.py @@ -2118,6 +2118,7 @@ def aks_update(cmd, client, resource_group_name, name, disable_cluster_autoscaler=False, update_cluster_autoscaler=False, min_count=None, max_count=None, + uptime_sla=False, load_balancer_managed_outbound_ip_count=None, load_balancer_outbound_ips=None, load_balancer_outbound_ip_prefixes=None, @@ -2134,9 +2135,11 @@ def aks_update(cmd, client, resource_group_name, name, load_balancer_outbound_ports, load_balancer_idle_timeout) + # pylint: disable=too-many-boolean-expressions if (update_autoscaler != 1 and not update_lb_profile and not attach_acr and not detach_acr and + not uptime_sla and api_server_authorized_ip_ranges is None): raise CLIError('Please specify one or more of "--enable-cluster-autoscaler" or ' '"--disable-cluster-autoscaler" or ' @@ -2147,6 +2150,7 @@ def aks_update(cmd, client, resource_group_name, name, '"--load-balancer-outbound-ports" or' '"--load-balancer-idle-timeout" or' '"--attach-acr" or "--dettach-acr" or' + '"--uptime-sla" or' '"--"api-server-authorized-ip-ranges') instance = client.get(resource_group_name, name) @@ -2212,6 +2216,12 @@ def aks_update(cmd, client, resource_group_name, name, subscription_id=subscription_id, detach=True) + if uptime_sla: + instance.sku = ManagedClusterSKU( + name="Basic", + tier="Paid" + ) + if update_lb_profile: instance.network_profile.load_balancer_profile = update_load_balancer_profile( load_balancer_managed_outbound_ip_count,