Skip to content

Commit

Permalink
Generated from ae8e6c09e62b5c242f08c04d5225277e814cf49f (#5070)
Browse files Browse the repository at this point in the history
Rework multi API ACS Python
  • Loading branch information
AutorestCI authored May 3, 2019
1 parent c0d3cbf commit 6006b27
Show file tree
Hide file tree
Showing 70 changed files with 763 additions and 421 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2018-08-01-preview: :mod:`v2018_08_01_preview.models<azure.mgmt.containerservice.v2018_08_01_preview.models>`
* 2018-09-30-preview: :mod:`v2018_09_30_preview.models<azure.mgmt.containerservice.v2018_09_30_preview.models>`
* 2019-02-01: :mod:`v2019_02_01.models<azure.mgmt.containerservice.v2019_02_01.models>`
* 2019-04-01: :mod:`v2019_04_01.models<azure.mgmt.containerservice.v2019_04_01.models>`
* 2019-04-30: :mod:`v2019_04_30.models<azure.mgmt.containerservice.v2019_04_30.models>`
"""
if api_version == '2017-07-01':
Expand All @@ -124,6 +125,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-02-01':
from .v2019_02_01 import models
return models
elif api_version == '2019-04-01':
from .v2019_04_01 import models
return models
elif api_version == '2019-04-30':
from .v2019_04_30 import models
return models
Expand All @@ -134,13 +138,13 @@ def agent_pools(self):
"""Instance depends on the API version:
* 2019-02-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_02_01.operations.AgentPoolsOperations>`
* 2019-04-30: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_04_30.operations.AgentPoolsOperations>`
* 2019-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations>`
"""
api_version = self._get_api_version('agent_pools')
if api_version == '2019-02-01':
from .v2019_02_01.operations import AgentPoolsOperations as OperationClass
elif api_version == '2019-04-30':
from .v2019_04_30.operations import AgentPoolsOperations as OperationClass
elif api_version == '2019-04-01':
from .v2019_04_01.operations import AgentPoolsOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand All @@ -165,7 +169,7 @@ def managed_clusters(self):
* 2018-03-31: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_03_31.operations.ManagedClustersOperations>`
* 2018-08-01-preview: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2018_08_01_preview.operations.ManagedClustersOperations>`
* 2019-02-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_02_01.operations.ManagedClustersOperations>`
* 2019-04-30: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_04_30.operations.ManagedClustersOperations>`
* 2019-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations>`
"""
api_version = self._get_api_version('managed_clusters')
if api_version == '2018-03-31':
Expand All @@ -174,8 +178,8 @@ def managed_clusters(self):
from .v2018_08_01_preview.operations import ManagedClustersOperations as OperationClass
elif api_version == '2019-02-01':
from .v2019_02_01.operations import ManagedClustersOperations as OperationClass
elif api_version == '2019-04-30':
from .v2019_04_30.operations import ManagedClustersOperations as OperationClass
elif api_version == '2019-04-01':
from .v2019_04_01.operations import ManagedClustersOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down Expand Up @@ -203,7 +207,7 @@ def operations(self):
* 2018-03-31: :class:`Operations<azure.mgmt.containerservice.v2018_03_31.operations.Operations>`
* 2018-08-01-preview: :class:`Operations<azure.mgmt.containerservice.v2018_08_01_preview.operations.Operations>`
* 2019-02-01: :class:`Operations<azure.mgmt.containerservice.v2019_02_01.operations.Operations>`
* 2019-04-30: :class:`Operations<azure.mgmt.containerservice.v2019_04_30.operations.Operations>`
* 2019-04-01: :class:`Operations<azure.mgmt.containerservice.v2019_04_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-03-31':
Expand All @@ -212,8 +216,8 @@ def operations(self):
from .v2018_08_01_preview.operations import Operations as OperationClass
elif api_version == '2019-02-01':
from .v2019_02_01.operations import Operations as OperationClass
elif api_version == '2019-04-30':
from .v2019_04_30.operations import Operations as OperationClass
elif api_version == '2019-04-01':
from .v2019_04_01.operations import Operations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from .container_service_client import ContainerServiceClient
from .version import VERSION

__all__ = ['ContainerServiceClient']

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
from .version import VERSION
from .operations.operations import Operations
from .operations.managed_clusters_operations import ManagedClustersOperations
from .operations.agent_pools_operations import AgentPoolsOperations
from . import models


class ContainerServiceClientConfiguration(AzureConfiguration):
"""Configuration for ContainerServiceClient
Note that all parameters used to create this instance are saved as instance
attributes.
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(ContainerServiceClientConfiguration, self).__init__(base_url)

self.add_user_agent('azure-mgmt-containerservice/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id


class ContainerServiceClient(SDKClient):
"""The Container Service Client.
:ivar config: Configuration for client.
:vartype config: ContainerServiceClientConfiguration
:ivar operations: Operations operations
:vartype operations: azure.mgmt.containerservice.v2019_04_01.operations.Operations
:ivar managed_clusters: ManagedClusters operations
:vartype managed_clusters: azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations
:ivar agent_pools: AgentPools operations
:vartype agent_pools: azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations
:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: Subscription credentials which uniquely identify
Microsoft Azure subscription. The subscription ID forms part of the URI
for every service call.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = ContainerServiceClientConfiguration(credentials, subscription_id, base_url)
super(ContainerServiceClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-04-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.operations = Operations(
self._client, self.config, self._serialize, self._deserialize)
self.managed_clusters = ManagedClustersOperations(
self._client, self.config, self._serialize, self._deserialize)
self.agent_pools = AgentPoolsOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------

try:
from .operation_value_py3 import OperationValue
from .resource_py3 import Resource
from .sub_resource_py3 import SubResource
from .tags_object_py3 import TagsObject
from .managed_cluster_service_principal_profile_py3 import ManagedClusterServicePrincipalProfile
from .container_service_master_profile_py3 import ContainerServiceMasterProfile
from .managed_cluster_agent_pool_profile_properties_py3 import ManagedClusterAgentPoolProfileProperties
from .managed_cluster_agent_pool_profile_py3 import ManagedClusterAgentPoolProfile
from .agent_pool_py3 import AgentPool
from .managed_cluster_windows_profile_py3 import ManagedClusterWindowsProfile
from .container_service_ssh_public_key_py3 import ContainerServiceSshPublicKey
from .container_service_ssh_configuration_py3 import ContainerServiceSshConfiguration
from .container_service_linux_profile_py3 import ContainerServiceLinuxProfile
from .container_service_network_profile_py3 import ContainerServiceNetworkProfile
from .container_service_vm_diagnostics_py3 import ContainerServiceVMDiagnostics
from .container_service_diagnostics_profile_py3 import ContainerServiceDiagnosticsProfile
from .managed_cluster_addon_profile_py3 import ManagedClusterAddonProfile
from .managed_cluster_aad_profile_py3 import ManagedClusterAADProfile
from .managed_cluster_identity_py3 import ManagedClusterIdentity
from .managed_cluster_py3 import ManagedCluster
from .managed_cluster_access_profile_py3 import ManagedClusterAccessProfile
from .managed_cluster_pool_upgrade_profile_upgrades_item_py3 import ManagedClusterPoolUpgradeProfileUpgradesItem
from .managed_cluster_pool_upgrade_profile_py3 import ManagedClusterPoolUpgradeProfile
from .managed_cluster_upgrade_profile_py3 import ManagedClusterUpgradeProfile
from .credential_result_py3 import CredentialResult
from .credential_results_py3 import CredentialResults
except (SyntaxError, ImportError):
from .operation_value import OperationValue
from .resource import Resource
from .sub_resource import SubResource
from .tags_object import TagsObject
from .managed_cluster_service_principal_profile import ManagedClusterServicePrincipalProfile
from .container_service_master_profile import ContainerServiceMasterProfile
from .managed_cluster_agent_pool_profile_properties import ManagedClusterAgentPoolProfileProperties
from .managed_cluster_agent_pool_profile import ManagedClusterAgentPoolProfile
from .agent_pool import AgentPool
from .managed_cluster_windows_profile import ManagedClusterWindowsProfile
from .container_service_ssh_public_key import ContainerServiceSshPublicKey
from .container_service_ssh_configuration import ContainerServiceSshConfiguration
from .container_service_linux_profile import ContainerServiceLinuxProfile
from .container_service_network_profile import ContainerServiceNetworkProfile
from .container_service_vm_diagnostics import ContainerServiceVMDiagnostics
from .container_service_diagnostics_profile import ContainerServiceDiagnosticsProfile
from .managed_cluster_addon_profile import ManagedClusterAddonProfile
from .managed_cluster_aad_profile import ManagedClusterAADProfile
from .managed_cluster_identity import ManagedClusterIdentity
from .managed_cluster import ManagedCluster
from .managed_cluster_access_profile import ManagedClusterAccessProfile
from .managed_cluster_pool_upgrade_profile_upgrades_item import ManagedClusterPoolUpgradeProfileUpgradesItem
from .managed_cluster_pool_upgrade_profile import ManagedClusterPoolUpgradeProfile
from .managed_cluster_upgrade_profile import ManagedClusterUpgradeProfile
from .credential_result import CredentialResult
from .credential_results import CredentialResults
from .operation_value_paged import OperationValuePaged
from .managed_cluster_paged import ManagedClusterPaged
from .agent_pool_paged import AgentPoolPaged
from .container_service_client_enums import (
ContainerServiceStorageProfileTypes,
ContainerServiceVMSizeTypes,
OSType,
AgentPoolType,
NetworkPlugin,
NetworkPolicy,
LoadBalancerSku,
ResourceIdentityType,
)

__all__ = [
'OperationValue',
'Resource',
'SubResource',
'TagsObject',
'ManagedClusterServicePrincipalProfile',
'ContainerServiceMasterProfile',
'ManagedClusterAgentPoolProfileProperties',
'ManagedClusterAgentPoolProfile',
'AgentPool',
'ManagedClusterWindowsProfile',
'ContainerServiceSshPublicKey',
'ContainerServiceSshConfiguration',
'ContainerServiceLinuxProfile',
'ContainerServiceNetworkProfile',
'ContainerServiceVMDiagnostics',
'ContainerServiceDiagnosticsProfile',
'ManagedClusterAddonProfile',
'ManagedClusterAADProfile',
'ManagedClusterIdentity',
'ManagedCluster',
'ManagedClusterAccessProfile',
'ManagedClusterPoolUpgradeProfileUpgradesItem',
'ManagedClusterPoolUpgradeProfile',
'ManagedClusterUpgradeProfile',
'CredentialResult',
'CredentialResults',
'OperationValuePaged',
'ManagedClusterPaged',
'AgentPoolPaged',
'ContainerServiceStorageProfileTypes',
'ContainerServiceVMSizeTypes',
'OSType',
'AgentPoolType',
'NetworkPlugin',
'NetworkPolicy',
'LoadBalancerSku',
'ResourceIdentityType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AgentPool(SubResource):
'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s',
'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6'
:type vm_size: str or
~azure.mgmt.containerservice.v2019_04_30.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes
:param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk
size for every machine in this master/agent pool. If you specify 0, it
will apply the default osDisk size according to the vmSize specified.
Expand All @@ -97,7 +97,7 @@ class AgentPool(SubResource):
and Windows. Default to Linux. Possible values include: 'Linux',
'Windows'. Default value: "Linux" .
:type os_type: str or
~azure.mgmt.containerservice.v2019_04_30.models.OSType
~azure.mgmt.containerservice.v2019_04_01.models.OSType
:param max_count: Maximum number of nodes for auto-scaling
:type max_count: int
:param min_count: Minimum number of nodes for auto-scaling
Expand All @@ -107,7 +107,7 @@ class AgentPool(SubResource):
:param agent_pool_type: AgentPoolType represents types of an agent pool.
Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'
:type agent_pool_type: str or
~azure.mgmt.containerservice.v2019_04_30.models.AgentPoolType
~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType
:param orchestrator_version: Version of orchestrator specified when
creating the managed cluster.
:type orchestrator_version: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class AgentPoolPaged(Paged):
"""
A paging container for iterating over a list of :class:`AgentPool <azure.mgmt.containerservice.v2019_04_30.models.AgentPool>` object
A paging container for iterating over a list of :class:`AgentPool <azure.mgmt.containerservice.v2019_04_01.models.AgentPool>` object
"""

_attribute_map = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class AgentPool(SubResource):
'Standard_NC6s_v3', 'Standard_ND12s', 'Standard_ND24rs', 'Standard_ND24s',
'Standard_ND6s', 'Standard_NV12', 'Standard_NV24', 'Standard_NV6'
:type vm_size: str or
~azure.mgmt.containerservice.v2019_04_30.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.v2019_04_01.models.ContainerServiceVMSizeTypes
:param os_disk_size_gb: OS Disk Size in GB to be used to specify the disk
size for every machine in this master/agent pool. If you specify 0, it
will apply the default osDisk size according to the vmSize specified.
Expand All @@ -97,7 +97,7 @@ class AgentPool(SubResource):
and Windows. Default to Linux. Possible values include: 'Linux',
'Windows'. Default value: "Linux" .
:type os_type: str or
~azure.mgmt.containerservice.v2019_04_30.models.OSType
~azure.mgmt.containerservice.v2019_04_01.models.OSType
:param max_count: Maximum number of nodes for auto-scaling
:type max_count: int
:param min_count: Minimum number of nodes for auto-scaling
Expand All @@ -107,7 +107,7 @@ class AgentPool(SubResource):
:param agent_pool_type: AgentPoolType represents types of an agent pool.
Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet'
:type agent_pool_type: str or
~azure.mgmt.containerservice.v2019_04_30.models.AgentPoolType
~azure.mgmt.containerservice.v2019_04_01.models.AgentPoolType
:param orchestrator_version: Version of orchestrator specified when
creating the managed cluster.
:type orchestrator_version: str
Expand Down
Loading

0 comments on commit 6006b27

Please sign in to comment.