From c38a006ca4c93863c9c94ccba298eeb7814a4a50 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 18 May 2018 02:17:53 +0000 Subject: [PATCH 1/4] Generated from 3c1665f522ece941d8c827b3e8ee539c2cdaf846 [AKS] add POST endpoint for fetching accessProfiles --- .../models/container_service_py3.py | 2 +- .../managed_cluster_access_profile_py3.py | 2 +- .../models/managed_cluster_py3.py | 2 +- .../operations/managed_clusters_operations.py | 70 +++++++++++++++++++ 4 files changed, 73 insertions(+), 3 deletions(-) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_py3.py index 70060c098b48..ddec4057c76f 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_py3.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/container_service_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class ContainerService(Resource): diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_access_profile_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_access_profile_py3.py index 53d6a6218b74..0d3fb998e970 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_access_profile_py3.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_access_profile_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class ManagedClusterAccessProfile(Resource): diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py index 49327c922f82..38d179965e94 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/models/managed_cluster_py3.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from .resource import Resource +from .resource_py3 import Resource class ManagedCluster(Resource): diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py index 098d54bddfe8..4a3f7898875c 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py @@ -245,6 +245,76 @@ def get_upgrade_profile( return deserialized get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} + def list_credential( + self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): + """Gets an access profile of a managed cluster. + + Gets the accessProfile for the specified role name of the managed + cluster with a specified resource group and name. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param resource_name: The name of the managed cluster resource. + :type resource_name: str + :param role_name: The name of the role for managed cluster + accessProfile resource. + :type role_name: 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: ManagedClusterAccessProfile or ClientRawResponse if raw=true + :rtype: + ~azure.mgmt.containerservice.models.ManagedClusterAccessProfile or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.list_credential.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'resourceName': self._serialize.url("resource_name", resource_name, 'str'), + 'roleName': self._serialize.url("role_name", role_name, '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') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + 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.post(url, query_parameters) + response = self._client.send(request, header_parameters, 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('ManagedClusterAccessProfile', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + list_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} + def get_access_profiles( self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): """Gets access profile of a managed cluster. From db30237c4330dba456f7357d450e891e74b1d411 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 18 May 2018 18:08:53 +0000 Subject: [PATCH 2/4] Generated from a86af5dd1b974ecc3b58e95efc228497137d79a3 Mark GET endpoint for accessProfiles as deprecated --- .../mgmt/containerservice/container_service_client.py | 1 + .../operations/managed_clusters_operations.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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 990fb1d2bb82..e28da4b406f5 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/container_service_client.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +import warnings from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py index 4a3f7898875c..c2a49f28b06f 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py @@ -10,6 +10,7 @@ # -------------------------------------------------------------------------- import uuid +import warnings from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling @@ -183,8 +184,10 @@ def get_upgrade_profile( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Gets upgrade profile for a managed cluster. - Gets the details of the upgrade profile for a managed cluster with a - specified resource group and name. + Use ManagedClusters_ListCredential instead. + + .. warning:: + This method is deprecated :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -201,6 +204,7 @@ def get_upgrade_profile( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + warnings.warn("Method get_upgrade_profile is deprecated", DeprecationWarning) # Construct URL url = self.get_upgrade_profile.metadata['url'] path_format_arguments = { From 260cb5b03e33d6734324fafeefdb8f15c263cf96 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 18 May 2018 21:55:46 +0000 Subject: [PATCH 3/4] Generated from 14544bfbd10b7319f64f1174b84801347ace5dc9 Bump package version --- .../azure/mgmt/containerservice/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py index fc4db3937e08..9797f3dd0011 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "3.0.1" +VERSION = "3.1.0" From 7e80bb4bdfbe9cbedfc2dc3f5fed0019bdd4b732 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 18 May 2018 23:23:52 +0000 Subject: [PATCH 4/4] Generated from a69eb4b470374683c3bc4e86491aa60ae0a161ea Rename to GetAccessProfile --- .../operations/managed_clusters_operations.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py index c2a49f28b06f..85fc5e0ec9b7 100644 --- a/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py +++ b/azure-mgmt-containerservice/azure/mgmt/containerservice/operations/managed_clusters_operations.py @@ -184,10 +184,8 @@ def get_upgrade_profile( self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config): """Gets upgrade profile for a managed cluster. - Use ManagedClusters_ListCredential instead. - - .. warning:: - This method is deprecated + Gets the details of the upgrade profile for a managed cluster with a + specified resource group and name. :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -204,7 +202,6 @@ def get_upgrade_profile( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ - warnings.warn("Method get_upgrade_profile is deprecated", DeprecationWarning) # Construct URL url = self.get_upgrade_profile.metadata['url'] path_format_arguments = { @@ -249,7 +246,7 @@ def get_upgrade_profile( return deserialized get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'} - def list_credential( + def get_access_profile( self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): """Gets an access profile of a managed cluster. @@ -275,7 +272,7 @@ def list_credential( :raises: :class:`CloudError` """ # Construct URL - url = self.list_credential.metadata['url'] + url = self.get_access_profile.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), @@ -317,14 +314,16 @@ def list_credential( return client_raw_response return deserialized - list_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} + get_access_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential'} def get_access_profiles( self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config): """Gets access profile of a managed cluster. - Gets the accessProfile for the specified role name of the managed - cluster with a specified resource group and name. + Use ManagedClusters_GetAccessProfile instead. + + .. warning:: + This method is deprecated :param resource_group_name: The name of the resource group. :type resource_group_name: str @@ -344,6 +343,7 @@ def get_access_profiles( ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ + warnings.warn("Method get_access_profiles is deprecated", DeprecationWarning) # Construct URL url = self.get_access_profiles.metadata['url'] path_format_arguments = {