Skip to content

Commit

Permalink
Support 2020-06-01 API version and add ppg parameter (#1919)
Browse files Browse the repository at this point in the history
* Add 2020-06-01 sdk and ppg

* fix unit test
  • Loading branch information
tilnl authored Jun 23, 2020
1 parent fb8b4b7 commit cfe271e
Show file tree
Hide file tree
Showing 29 changed files with 7,390 additions and 33 deletions.
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Release History
===============
0.4.53
+++++
* Add --ppg for "az aks create" and "az aks nodepool add"

0.4.52
+++++
* Add --uptime-sla for az aks update
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ContainerServiceCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2020-04-01')
register_resource_type('latest', CUSTOM_MGMT_AKS_PREVIEW, '2020-06-01')

acs_custom = CliCommandType(operations_tmpl='azext_aks_preview.custom#{}')
super(ContainerServiceCommandsLoader, self).__init__(cli_ctx=cli_ctx,
Expand Down
6 changes: 6 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@
- name: --vnet-subnet-id
type: string
short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster.
- name: --ppg
type: string
short-summary: The ID of a PPG.
- name: --workspace-resource-id
type: string
short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. If not specified, uses the default Log Analytics Workspace if it exists, otherwise creates one.
Expand Down Expand Up @@ -484,6 +487,9 @@
- name: --vnet-subnet-id
type: string
short-summary: The ID of a subnet in an existing VNet into which to deploy the cluster.
- name: --ppg
type: string
short-summary: The ID of a PPG.
- name: --os-type
type: string
short-summary: The OS Type. Linux or Windows.
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from knack.util import CLIError

# pylint: disable=no-name-in-module,import-error
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterAPIServerAccessProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAPIServerAccessProfile
from ._consts import CONST_CONTAINER_NAME_MAX_LENGTH
from ._consts import CONST_OUTBOUND_TYPE_LOAD_BALANCER, CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING

Expand Down
10 changes: 5 additions & 5 deletions src/aks-preview/azext_aks_preview/_loadbalancer.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
from distutils.version import StrictVersion # pylint: disable=no-name-in-module,import-error
from knack.log import get_logger

from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterLoadBalancerProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterLoadBalancerProfileManagedOutboundIPs
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterLoadBalancerProfileOutboundIPs
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ResourceReference
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterLoadBalancerProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterLoadBalancerProfileManagedOutboundIPs
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterLoadBalancerProfileOutboundIPPrefixes
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterLoadBalancerProfileOutboundIPs
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ResourceReference

logger = get_logger(__name__)

Expand Down
2 changes: 2 additions & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def load_arguments(self, _):
c.argument('pod_cidr')
c.argument('service_cidr')
c.argument('vnet_subnet_id', type=str, validator=validate_vnet_subnet_id)
c.argument('ppg')
c.argument('workspace_resource_id')
c.argument('skip_subnet_role_assignment', action='store_true')
c.argument('enable_cluster_autoscaler', action='store_true')
Expand Down Expand Up @@ -150,6 +151,7 @@ def load_arguments(self, _):
c.argument('labels', nargs='*', validator=validate_nodepool_labels)
c.argument('mode', arg_type=get_enum_type([CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER]))
c.argument('aks_custom_headers')
c.argument('ppg')
c.argument('max_surge', type=str, validator=validate_max_surge)

for scope in ['aks nodepool show', 'aks nodepool delete', 'aks nodepool scale', 'aks nodepool upgrade', 'aks nodepool update']:
Expand Down
36 changes: 20 additions & 16 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,22 +49,22 @@
KeyCredential,
ServicePrincipalCreateParameters,
GetObjectsParameters)
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ContainerServiceLinuxProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterWindowsProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ContainerServiceNetworkProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterServicePrincipalProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ContainerServiceSshConfiguration
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ContainerServiceSshPublicKey
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedCluster
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterAADProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterAddonProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterAgentPoolProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import AgentPool
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import AgentPoolUpgradeSettings
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ContainerServiceStorageProfileTypes
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterIdentity
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterAPIServerAccessProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_04_01.models import ManagedClusterSKU
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceLinuxProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterWindowsProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceNetworkProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterServicePrincipalProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceSshConfiguration
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceSshPublicKey
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedCluster
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAADProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAddonProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAgentPoolProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import AgentPool
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import AgentPoolUpgradeSettings
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ContainerServiceStorageProfileTypes
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterIdentity
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterAPIServerAccessProfile
from .vendored_sdks.azure_mgmt_preview_aks.v2020_06_01.models import ManagedClusterSKU
from ._client_factory import cf_resource_groups
from ._client_factory import get_auth_management_client
from ._client_factory import get_graph_rbac_management_client
Expand Down Expand Up @@ -785,6 +785,7 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to
min_count=None,
max_count=None,
vnet_subnet_id=None,
ppg=None,
max_pods=0,
aad_client_app_id=None,
aad_server_app_id=None,
Expand Down Expand Up @@ -849,6 +850,7 @@ def aks_create(cmd, # pylint: disable=too-many-locals,too-many-statements,to
os_type="Linux",
mode="System",
vnet_subnet_id=vnet_subnet_id,
proximity_placement_group_id=ppg,
availability_zones=node_zones,
enable_node_public_ip=enable_node_public_ip,
max_pods=int(max_pods) if max_pods else None,
Expand Down Expand Up @@ -2131,6 +2133,7 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local
node_osdisk_size=0,
node_count=3,
vnet_subnet_id=None,
ppg=None,
max_pods=0,
os_type="Linux",
min_count=None,
Expand Down Expand Up @@ -2180,6 +2183,7 @@ def aks_agentpool_add(cmd, # pylint: disable=unused-argument,too-many-local
os_type=os_type,
storage_profile=ContainerServiceStorageProfileTypes.managed_disks,
vnet_subnet_id=vnet_subnet_id,
proximity_placement_group_id=ppg,
agent_pool_type="VirtualMachineScaleSets",
max_pods=int(max_pods) if max_pods else None,
orchestrator_version=kubernetes_version,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1672,7 +1672,7 @@ interactions:
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down Expand Up @@ -2288,7 +2288,7 @@ interactions:
msrest_azure/0.6.2 azure-mgmt-containerservice/4.4.2 Azure-SDK-For-Python
AZURECLI/2.6.0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ interactions:
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down Expand Up @@ -1300,7 +1300,7 @@ interactions:
msrest_azure/0.6.2 azure-mgmt-containerservice/4.4.2 Azure-SDK-For-Python
AZURECLI/2.6.0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ interactions:
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\"\
Expand Down Expand Up @@ -499,7 +499,7 @@ interactions:
msrest/0.6.9 msrest_azure/0.6.3 azure-mgmt-containerservice/4.4.3 Azure-SDK-For-Python
AZURECLI/2.6.0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\"\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ interactions:
accept-language:
- en-US
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down Expand Up @@ -596,7 +596,7 @@ interactions:
msrest_azure/0.6.2 azure-mgmt-containerservice/4.4.2 Azure-SDK-For-Python
AZURECLI/2.6.0
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-04-01
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2020-06-01
response:
body:
string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n
Expand Down
Loading

0 comments on commit cfe271e

Please sign in to comment.