diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py index 5ce50f0c10eb..146dad6dd4fa 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py @@ -150,10 +150,13 @@ def container_services(self): """Instance depends on the API version: * 2017-07-01: :class:`ContainerServicesOperations` + * 2019-04-30: :class:`ContainerServicesOperations` """ api_version = self._get_api_version('container_services') if api_version == '2017-07-01': from .v2017_07_01.operations import ContainerServicesOperations as OperationClass + elif api_version == '2019-04-30': + from .v2019_04_30.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))) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/container_service_client.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/container_service_client.py index 498735bd0998..83350a478034 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/container_service_client.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/container_service_client.py @@ -17,6 +17,7 @@ from .operations.operations import Operations from .operations.managed_clusters_operations import ManagedClustersOperations from .operations.agent_pools_operations import AgentPoolsOperations +from .operations.container_services_operations import ContainerServicesOperations from . import models @@ -68,6 +69,8 @@ class ContainerServiceClient(SDKClient): :vartype managed_clusters: azure.mgmt.containerservice.v2019_04_30.operations.ManagedClustersOperations :ivar agent_pools: AgentPools operations :vartype agent_pools: azure.mgmt.containerservice.v2019_04_30.operations.AgentPoolsOperations + :ivar container_services: ContainerServices operations + :vartype container_services: azure.mgmt.containerservice.v2019_04_30.operations.ContainerServicesOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -97,3 +100,5 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.agent_pools = AgentPoolsOperations( self._client, self.config, self._serialize, self._deserialize) + self.container_services = ContainerServicesOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py index 6c48a6ce1c5d..4b8a4e0f0601 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/__init__.py @@ -46,6 +46,9 @@ from .managed_cluster_upgrade_profile_py3 import ManagedClusterUpgradeProfile from .credential_result_py3 import CredentialResult from .credential_results_py3 import CredentialResults + from .orchestrator_profile_py3 import OrchestratorProfile + from .orchestrator_version_profile_py3 import OrchestratorVersionProfile + from .orchestrator_version_profile_list_result_py3 import OrchestratorVersionProfileListResult except (SyntaxError, ImportError): from .resource import Resource from .purchase_plan import PurchasePlan @@ -83,6 +86,9 @@ from .managed_cluster_upgrade_profile import ManagedClusterUpgradeProfile from .credential_result import CredentialResult from .credential_results import CredentialResults + from .orchestrator_profile import OrchestratorProfile + from .orchestrator_version_profile import OrchestratorVersionProfile + from .orchestrator_version_profile_list_result import OrchestratorVersionProfileListResult from .open_shift_managed_cluster_paged import OpenShiftManagedClusterPaged from .operation_value_paged import OperationValuePaged from .managed_cluster_paged import ManagedClusterPaged @@ -137,6 +143,9 @@ 'ManagedClusterUpgradeProfile', 'CredentialResult', 'CredentialResults', + 'OrchestratorProfile', + 'OrchestratorVersionProfile', + 'OrchestratorVersionProfileListResult', 'OpenShiftManagedClusterPaged', 'OperationValuePaged', 'ManagedClusterPaged', diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile.py new file mode 100644 index 000000000000..ed7eda48c463 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class OrchestratorProfile(Model): + """Contains information about orchestrator. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _validation = { + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(OrchestratorProfile, self).__init__(**kwargs) + self.orchestrator_type = kwargs.get('orchestrator_type', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.is_preview = kwargs.get('is_preview', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile_py3.py new file mode 100644 index 000000000000..3dd9fb586ae5 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_profile_py3.py @@ -0,0 +1,43 @@ +# 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.serialization import Model + + +class OrchestratorProfile(Model): + """Contains information about orchestrator. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + """ + + _validation = { + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + } + + def __init__(self, *, orchestrator_version: str, orchestrator_type: str=None, is_preview: bool=None, **kwargs) -> None: + super(OrchestratorProfile, self).__init__(**kwargs) + self.orchestrator_type = orchestrator_type + self.orchestrator_version = orchestrator_version + self.is_preview = is_preview diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile.py new file mode 100644 index 000000000000..44e619ac7a9b --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class OrchestratorVersionProfile(Model): + """The profile of an orchestrator and its available versions. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Required. Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param default: Installed by default if version is not specified. + :type default: bool + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + :param upgrades: The list of available upgrade versions. + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_30.models.OrchestratorProfile] + """ + + _validation = { + 'orchestrator_type': {'required': True}, + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, + } + + def __init__(self, **kwargs): + super(OrchestratorVersionProfile, self).__init__(**kwargs) + self.orchestrator_type = kwargs.get('orchestrator_type', None) + self.orchestrator_version = kwargs.get('orchestrator_version', None) + self.default = kwargs.get('default', None) + self.is_preview = kwargs.get('is_preview', None) + self.upgrades = kwargs.get('upgrades', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result.py new file mode 100644 index 000000000000..68ad3492253e --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class OrchestratorVersionProfileListResult(Model): + """The list of versions for supported orchestrators. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Id of the orchestrator version profile list result. + :vartype id: str + :ivar name: Name of the orchestrator version profile list result. + :vartype name: str + :ivar type: Type of the orchestrator version profile list result. + :vartype type: str + :param orchestrators: Required. List of orchestrator version profiles. + :type orchestrators: + list[~azure.mgmt.containerservice.v2019_04_30.models.OrchestratorVersionProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'orchestrators': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, + } + + def __init__(self, **kwargs): + super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.orchestrators = kwargs.get('orchestrators', None) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result_py3.py new file mode 100644 index 000000000000..9340b43f4bcd --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_list_result_py3.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class OrchestratorVersionProfileListResult(Model): + """The list of versions for supported orchestrators. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: Id of the orchestrator version profile list result. + :vartype id: str + :ivar name: Name of the orchestrator version profile list result. + :vartype name: str + :ivar type: Type of the orchestrator version profile list result. + :vartype type: str + :param orchestrators: Required. List of orchestrator version profiles. + :type orchestrators: + list[~azure.mgmt.containerservice.v2019_04_30.models.OrchestratorVersionProfile] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'orchestrators': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'orchestrators': {'key': 'properties.orchestrators', 'type': '[OrchestratorVersionProfile]'}, + } + + def __init__(self, *, orchestrators, **kwargs) -> None: + super(OrchestratorVersionProfileListResult, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.orchestrators = orchestrators diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_py3.py new file mode 100644 index 000000000000..df8f7b43e889 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/models/orchestrator_version_profile_py3.py @@ -0,0 +1,53 @@ +# 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.serialization import Model + + +class OrchestratorVersionProfile(Model): + """The profile of an orchestrator and its available versions. + + All required parameters must be populated in order to send to Azure. + + :param orchestrator_type: Required. Orchestrator type. + :type orchestrator_type: str + :param orchestrator_version: Required. Orchestrator version (major, minor, + patch). + :type orchestrator_version: str + :param default: Installed by default if version is not specified. + :type default: bool + :param is_preview: Whether Kubernetes version is currently in preview. + :type is_preview: bool + :param upgrades: The list of available upgrade versions. + :type upgrades: + list[~azure.mgmt.containerservice.v2019_04_30.models.OrchestratorProfile] + """ + + _validation = { + 'orchestrator_type': {'required': True}, + 'orchestrator_version': {'required': True}, + } + + _attribute_map = { + 'orchestrator_type': {'key': 'orchestratorType', 'type': 'str'}, + 'orchestrator_version': {'key': 'orchestratorVersion', 'type': 'str'}, + 'default': {'key': 'default', 'type': 'bool'}, + 'is_preview': {'key': 'isPreview', 'type': 'bool'}, + 'upgrades': {'key': 'upgrades', 'type': '[OrchestratorProfile]'}, + } + + def __init__(self, *, orchestrator_type: str, orchestrator_version: str, default: bool=None, is_preview: bool=None, upgrades=None, **kwargs) -> None: + super(OrchestratorVersionProfile, self).__init__(**kwargs) + self.orchestrator_type = orchestrator_type + self.orchestrator_version = orchestrator_version + self.default = default + self.is_preview = is_preview + self.upgrades = upgrades diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py index 56a23be42577..131ad3c555da 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/__init__.py @@ -13,10 +13,12 @@ from .operations import Operations from .managed_clusters_operations import ManagedClustersOperations from .agent_pools_operations import AgentPoolsOperations +from .container_services_operations import ContainerServicesOperations __all__ = [ 'OpenShiftManagedClustersOperations', 'Operations', 'ManagedClustersOperations', 'AgentPoolsOperations', + 'ContainerServicesOperations', ] diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/container_services_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/container_services_operations.py new file mode 100644 index 000000000000..b5245625f736 --- /dev/null +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/v2019_04_30/operations/container_services_operations.py @@ -0,0 +1,109 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class ContainerServicesOperations(object): + """ContainerServicesOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client Api Version. Constant value: "2019-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-04-01" + + self.config = config + + def list_orchestrators( + self, location, resource_type=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of supported orchestrators in the specified subscription. + + Gets a list of supported orchestrators in the specified subscription. + The operation returns properties of each orchestrator including + version, available upgrades and whether that version or upgrades are in + preview. + + :param location: The name of a supported Azure region. + :type location: str + :param resource_type: resource type for which the list of + orchestrators needs to be returned + :type resource_type: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: OrchestratorVersionProfileListResult or ClientRawResponse if + raw=true + :rtype: + ~azure.mgmt.containerservice.v2019_04_30.models.OrchestratorVersionProfileListResult + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_orchestrators.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'location': self._serialize.url("location", location, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if resource_type is not None: + query_parameters['resource-type'] = self._serialize.query("resource_type", resource_type, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OrchestratorVersionProfileListResult', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_orchestrators.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators'}