Skip to content

Commit

Permalink
[AutoPR containerservices/resource-manager] [AKS] add POST endpoint f…
Browse files Browse the repository at this point in the history
…or fetching accessProfiles (#2583)

* Generated from 3c1665f522ece941d8c827b3e8ee539c2cdaf846

[AKS] add POST endpoint for fetching accessProfiles

* Generated from a86af5dd1b974ecc3b58e95efc228497137d79a3

Mark GET endpoint for accessProfiles as deprecated

* Generated from 14544bfbd10b7319f64f1174b84801347ace5dc9

Bump package version

* Generated from a69eb4b470374683c3bc4e86491aa60ae0a161ea

Rename to GetAccessProfile
  • Loading branch information
AutorestCI committed May 25, 2018
1 parent 2e2e825 commit afba301
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

import warnings
from msrest.service_client import SDKClient
from msrest import Serializer, Deserializer
from msrestazure import AzureConfiguration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class ContainerService(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class ManagedClusterAccessProfile(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# regenerated.
# --------------------------------------------------------------------------

from .resource import Resource
from .resource_py3 import Resource


class ManagedCluster(Resource):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -245,9 +246,9 @@ def get_upgrade_profile(
return deserialized
get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default'}

def get_access_profiles(
def get_access_profile(
self, resource_group_name, resource_name, role_name, custom_headers=None, raw=False, **operation_config):
"""Gets access profile of a managed cluster.
"""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.
Expand All @@ -271,6 +272,79 @@ def get_access_profiles(
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
# Construct 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'),
'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
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.
Use ManagedClusters_GetAccessProfile instead.
.. warning::
This method is deprecated
: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<msrest:optionsforoperations>`.
:return: ManagedClusterAccessProfile or ClientRawResponse if raw=true
:rtype:
~azure.mgmt.containerservice.models.ManagedClusterAccessProfile or
~msrest.pipeline.ClientRawResponse
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
warnings.warn("Method get_access_profiles is deprecated", DeprecationWarning)
# Construct URL
url = self.get_access_profiles.metadata['url']
path_format_arguments = {
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "3.0.1"
VERSION = "3.1.0"

0 comments on commit afba301

Please sign in to comment.