Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,9 @@
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration

from azure.profiles import KnownProfiles, ProfileDefinition
from azure.profiles.multiapiclient import MultiApiClientMixin
from .version import VERSION
from .operations.container_services_operations import ContainerServicesOperations
from . import models


class ContainerServiceClientConfiguration(AzureConfiguration):
Expand Down Expand Up @@ -52,131 +51,34 @@ def __init__(
self.subscription_id = subscription_id


class ContainerServiceClient(MultiApiClientMixin, SDKClient):
class ContainerServiceClient(SDKClient):
"""The Container Service Client.

:ivar config: Configuration for client.
:vartype config: ContainerServiceClientConfiguration

:ivar container_services: ContainerServices operations
:vartype container_services: azure.mgmt.containerservice.operations.ContainerServicesOperations

: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 api_version: API version to use if no profile is provided, or if
missing in profile.
:param str base_url: Service URL
:param profile: A dict using operation group name to API version.
:type profile: dict[str, str]
"""

DEFAULT_API_VERSION = '2018-09-01'
_PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
'open_shift_managed_clusters': '2018-09-30-preview',
'container_services': '2017-07-01',
'managed_clusters': '2018-03-31',
'operations': '2018-03-31',
None: DEFAULT_API_VERSION
}},
_PROFILE_TAG + " latest"
)

def __init__(self, credentials, subscription_id, api_version=None, base_url=None, profile=KnownProfiles.default):
def __init__(
self, credentials, subscription_id, base_url=None):

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

############ Generated from here ############

@classmethod
def _models_dict(cls, api_version):
return {k: v for k, v in cls.models(api_version).__dict__.items() if isinstance(v, type)}

@classmethod
def models(cls, api_version=DEFAULT_API_VERSION):
"""Module depends on the API version:

* 2017-07-01: :mod:`v2017_07_01.models<azure.mgmt.containerservice.v2017_07_01.models>`
* 2018-03-31: :mod:`v2018_03_31.models<azure.mgmt.containerservice.v2018_03_31.models>`
* 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>`
"""
if api_version == '2017-07-01':
from .v2017_07_01 import models
return models
elif api_version == '2018-03-31':
from .v2018_03_31 import models
return models
elif api_version == '2018-08-01-preview':
from .v2018_08_01_preview import models
return models
elif api_version == '2018-09-30-preview':
from .v2018_09_30_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
def container_services(self):
"""Instance depends on the API version:

* 2017-07-01: :class:`ContainerServicesOperations<azure.mgmt.containerservice.v2017_07_01.operations.ContainerServicesOperations>`
"""
api_version = self._get_api_version('container_services')
if api_version == '2017-07-01':
from .v2017_07_01.operations import ContainerServicesOperations 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)))

@property
def managed_clusters(self):
"""Instance depends on the API version:

* 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>`
"""
api_version = self._get_api_version('managed_clusters')
if api_version == '2018-03-31':
from .v2018_03_31.operations import ManagedClustersOperations as OperationClass
elif api_version == '2018-08-01-preview':
from .v2018_08_01_preview.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)))

@property
def open_shift_managed_clusters(self):
"""Instance depends on the API version:

* 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations>`
"""
api_version = self._get_api_version('open_shift_managed_clusters')
if api_version == '2018-09-30-preview':
from .v2018_09_30_preview.operations import OpenShiftManagedClustersOperations 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)))

@property
def operations(self):
"""Instance depends on the API version:

* 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>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-03-31':
from .v2018_03_31.operations import Operations as OperationClass
elif api_version == '2018-08-01-preview':
from .v2018_08_01_preview.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)))
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._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.container_services = ContainerServicesOperations(
self._client, self.config, self._serialize, self._deserialize)
15 changes: 0 additions & 15 deletions azure-mgmt-containerservice/azure/mgmt/containerservice/models.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -36,34 +36,34 @@ class ContainerService(Resource):
:param orchestrator_profile: Required. Profile for the container service
orchestrator.
:type orchestrator_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorProfile
~azure.mgmt.containerservice.models.ContainerServiceOrchestratorProfile
:param custom_profile: Properties to configure a custom container service
cluster.
:type custom_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceCustomProfile
~azure.mgmt.containerservice.models.ContainerServiceCustomProfile
:param service_principal_profile: Information about a service principal
identity for the cluster to use for manipulating Azure APIs. Exact one of
secret or keyVaultSecretRef need to be specified.
:type service_principal_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceServicePrincipalProfile
~azure.mgmt.containerservice.models.ContainerServiceServicePrincipalProfile
:param master_profile: Required. Profile for the container service master.
:type master_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceMasterProfile
~azure.mgmt.containerservice.models.ContainerServiceMasterProfile
:param agent_pool_profiles: Properties of the agent pool.
:type agent_pool_profiles:
list[~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceAgentPoolProfile]
list[~azure.mgmt.containerservice.models.ContainerServiceAgentPoolProfile]
:param windows_profile: Profile for Windows VMs in the container service
cluster.
:type windows_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceWindowsProfile
~azure.mgmt.containerservice.models.ContainerServiceWindowsProfile
:param linux_profile: Required. Profile for Linux VMs in the container
service cluster.
:type linux_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceLinuxProfile
~azure.mgmt.containerservice.models.ContainerServiceLinuxProfile
:param diagnostics_profile: Profile for diagnostics in the container
service cluster.
:type diagnostics_profile:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceDiagnosticsProfile
~azure.mgmt.containerservice.models.ContainerServiceDiagnosticsProfile
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ContainerServiceAgentPoolProfile(Model):
'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.v2017_07_01.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.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,15 +97,14 @@ class ContainerServiceAgentPoolProfile(Model):
choose for you based on the orchestrator choice. Possible values include:
'StorageAccount', 'ManagedDisks'
:type storage_profile: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes
~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes
:param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet
identifier.
:type vnet_subnet_id: str
:param os_type: OsType to be used to specify os type. Choose from Linux
and Windows. Default to Linux. Possible values include: 'Linux',
'Windows'. Default value: "Linux" .
:type os_type: str or
~azure.mgmt.containerservice.v2017_07_01.models.OSType
:type os_type: str or ~azure.mgmt.containerservice.models.OSType
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class ContainerServiceAgentPoolProfile(Model):
'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.v2017_07_01.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.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,15 +97,14 @@ class ContainerServiceAgentPoolProfile(Model):
choose for you based on the orchestrator choice. Possible values include:
'StorageAccount', 'ManagedDisks'
:type storage_profile: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes
~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes
:param vnet_subnet_id: VNet SubnetID specifies the vnet's subnet
identifier.
:type vnet_subnet_id: str
:param os_type: OsType to be used to specify os type. Choose from Linux
and Windows. Default to Linux. Possible values include: 'Linux',
'Windows'. Default value: "Linux" .
:type os_type: str or
~azure.mgmt.containerservice.v2017_07_01.models.OSType
:type os_type: str or ~azure.mgmt.containerservice.models.OSType
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ContainerServiceDiagnosticsProfile(Model):
:param vm_diagnostics: Required. Profile for diagnostics on the container
service VMs.
:type vm_diagnostics:
~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceVMDiagnostics
~azure.mgmt.containerservice.models.ContainerServiceVMDiagnostics
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ContainerServiceDiagnosticsProfile(Model):
:param vm_diagnostics: Required. Profile for diagnostics on the container
service VMs.
:type vm_diagnostics:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceVMDiagnostics
~azure.mgmt.containerservice.models.ContainerServiceVMDiagnostics
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ContainerServiceLinuxProfile(Model):
:param ssh: Required. SSH configuration for Linux-based VMs running on
Azure.
:type ssh:
~azure.mgmt.containerservice.v2018_03_31.models.ContainerServiceSshConfiguration
~azure.mgmt.containerservice.models.ContainerServiceSshConfiguration
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ContainerServiceLinuxProfile(Model):
:param ssh: Required. SSH configuration for Linux-based VMs running on
Azure.
:type ssh:
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceSshConfiguration
~azure.mgmt.containerservice.models.ContainerServiceSshConfiguration
"""

_validation = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ContainerServiceMasterProfile(Model):
'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.v2017_07_01.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.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 @@ -94,7 +94,7 @@ class ContainerServiceMasterProfile(Model):
choose for you based on the orchestrator choice. Possible values include:
'StorageAccount', 'ManagedDisks'
:type storage_profile: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes
~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes
:ivar fqdn: FDQN for the master pool.
:vartype fqdn: str
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class ContainerServiceMasterProfile(Model):
'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.v2017_07_01.models.ContainerServiceVMSizeTypes
~azure.mgmt.containerservice.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 @@ -94,7 +94,7 @@ class ContainerServiceMasterProfile(Model):
choose for you based on the orchestrator choice. Possible values include:
'StorageAccount', 'ManagedDisks'
:type storage_profile: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceStorageProfileTypes
~azure.mgmt.containerservice.models.ContainerServiceStorageProfileTypes
:ivar fqdn: FDQN for the master pool.
:vartype fqdn: str
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class ContainerServiceNetworkProfile(Model):
network. Possible values include: 'azure', 'kubenet'. Default value:
"kubenet" .
:type network_plugin: str or
~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin
~azure.mgmt.containerservice.models.NetworkPlugin
:param network_policy: Network policy used for building Kubernetes
network. Possible values include: 'calico'
:type network_policy: str or
~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy
~azure.mgmt.containerservice.models.NetworkPolicy
:param pod_cidr: A CIDR notation IP range from which to assign pod IPs
when kubenet is used. Default value: "10.244.0.0/16" .
:type pod_cidr: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class ContainerServiceNetworkProfile(Model):
network. Possible values include: 'azure', 'kubenet'. Default value:
"kubenet" .
:type network_plugin: str or
~azure.mgmt.containerservice.v2018_03_31.models.NetworkPlugin
~azure.mgmt.containerservice.models.NetworkPlugin
:param network_policy: Network policy used for building Kubernetes
network. Possible values include: 'calico'
:type network_policy: str or
~azure.mgmt.containerservice.v2018_03_31.models.NetworkPolicy
~azure.mgmt.containerservice.models.NetworkPolicy
:param pod_cidr: A CIDR notation IP range from which to assign pod IPs
when kubenet is used. Default value: "10.244.0.0/16" .
:type pod_cidr: str
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ContainerServiceOrchestratorProfile(Model):
DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm',
'DCOS', 'DockerCE', 'Custom'
:type orchestrator_type: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorTypes
~azure.mgmt.containerservice.models.ContainerServiceOrchestratorTypes
:param orchestrator_version: The version of the orchestrator to use. You
can specify the major.minor.patch part of the actual version.For example,
you can specify version as "1.6.11".
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ContainerServiceOrchestratorProfile(Model):
DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm',
'DCOS', 'DockerCE', 'Custom'
:type orchestrator_type: str or
~azure.mgmt.containerservice.v2017_07_01.models.ContainerServiceOrchestratorTypes
~azure.mgmt.containerservice.models.ContainerServiceOrchestratorTypes
:param orchestrator_version: The version of the orchestrator to use. You
can specify the major.minor.patch part of the actual version.For example,
you can specify version as "1.6.11".
Expand Down
Loading