Skip to content

Commit

Permalink
[AutoPR] containerservice/resource-manager (#8062)
Browse files Browse the repository at this point in the history
* Generated from 96e53c8b30b238235fadb02b5ebf75533039ab91 (#7277)

fix getting agent pool available versions api path

* [AutoPR containerservice/resource-manager] Aro 2019-09-30 preview API Version (#7595)

* Generated from f66a8dda0377899f5aebb9e8033dfc0476d869ec

adding input file for 2019-09-30-preview tag

* Generated from d40c07cd128fcdb278efe332344f0a6474a56282

fixing spelling mistake

* Generated from d4b5c0f6e47f1343d10df01882c7eb1c37e3ef43

changing api version in the apiverion definition file to be the api version that is being added

* Generated from 6308fd287fe9db58a0a3f20bd2282ed7f88e1b23

update create_update example

* regenerated

* regenerated after fix in swagger

* updated version and history
  • Loading branch information
AutorestCI authored and fengzhou-msft committed Nov 5, 2019
1 parent df2b5e2 commit 602441a
Show file tree
Hide file tree
Showing 31 changed files with 7,986 additions and 15 deletions.
13 changes: 13 additions & 0 deletions sdk/containerservice/azure-mgmt-containerservice/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
Release History
===============

8.0.0 (2019-10-24)
++++++++++++++++++

**Features**

- Model OpenShiftManagedCluster has a new parameter monitor_profile
- Model ManagedCluster has a new parameter private_fqdn
- Added operation ManagedClustersOperations.rotate_cluster_certificates

**Breaking changes**

- Operation AgentPoolsOperations.get_available_agent_pool_versions has a new signature

7.0.0 (2019-08-30)
++++++++++++++++++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ContainerServiceClient(MultiApiClientMixin, SDKClient):
:type profile: azure.profiles.KnownProfiles
"""

DEFAULT_API_VERSION = '2019-08-01'
DEFAULT_API_VERSION = '2019-10-01'
_PROFILE_TAG = "azure.mgmt.containerservice.ContainerServiceClient"
LATEST_PROFILE = ProfileDefinition({
_PROFILE_TAG: {
Expand Down Expand Up @@ -83,6 +83,8 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-04-30: :mod:`v2019_04_30.models<azure.mgmt.containerservice.v2019_04_30.models>`
* 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.containerservice.v2019_06_01.models>`
* 2019-08-01: :mod:`v2019_08_01.models<azure.mgmt.containerservice.v2019_08_01.models>`
* 2019-09-30-preview: :mod:`v2019_09_30_preview.models<azure.mgmt.containerservice.v2019_09_30_preview.models>`
* 2019-10-01: :mod:`v2019_10_01.models<azure.mgmt.containerservice.v2019_10_01.models>`
"""
if api_version == '2017-07-01':
from .v2017_07_01 import models
Expand Down Expand Up @@ -111,6 +113,12 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-08-01':
from .v2019_08_01 import models
return models
elif api_version == '2019-09-30-preview':
from .v2019_09_30_preview import models
return models
elif api_version == '2019-10-01':
from .v2019_10_01 import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand All @@ -121,6 +129,7 @@ def agent_pools(self):
* 2019-04-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_04_01.operations.AgentPoolsOperations>`
* 2019-06-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_06_01.operations.AgentPoolsOperations>`
* 2019-08-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_08_01.operations.AgentPoolsOperations>`
* 2019-10-01: :class:`AgentPoolsOperations<azure.mgmt.containerservice.v2019_10_01.operations.AgentPoolsOperations>`
"""
api_version = self._get_api_version('agent_pools')
if api_version == '2019-02-01':
Expand All @@ -131,6 +140,8 @@ def agent_pools(self):
from .v2019_06_01.operations import AgentPoolsOperations as OperationClass
elif api_version == '2019-08-01':
from .v2019_08_01.operations import AgentPoolsOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_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 Down Expand Up @@ -158,6 +169,7 @@ def managed_clusters(self):
* 2019-04-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_04_01.operations.ManagedClustersOperations>`
* 2019-06-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_06_01.operations.ManagedClustersOperations>`
* 2019-08-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_08_01.operations.ManagedClustersOperations>`
* 2019-10-01: :class:`ManagedClustersOperations<azure.mgmt.containerservice.v2019_10_01.operations.ManagedClustersOperations>`
"""
api_version = self._get_api_version('managed_clusters')
if api_version == '2018-03-31':
Expand All @@ -172,6 +184,8 @@ def managed_clusters(self):
from .v2019_06_01.operations import ManagedClustersOperations as OperationClass
elif api_version == '2019-08-01':
from .v2019_08_01.operations import ManagedClustersOperations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_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 All @@ -182,12 +196,15 @@ def open_shift_managed_clusters(self):
* 2018-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2018_09_30_preview.operations.OpenShiftManagedClustersOperations>`
* 2019-04-30: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2019_04_30.operations.OpenShiftManagedClustersOperations>`
* 2019-09-30-preview: :class:`OpenShiftManagedClustersOperations<azure.mgmt.containerservice.v2019_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
elif api_version == '2019-04-30':
from .v2019_04_30.operations import OpenShiftManagedClustersOperations as OperationClass
elif api_version == '2019-09-30-preview':
from .v2019_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)))
Expand All @@ -202,6 +219,7 @@ def operations(self):
* 2019-04-01: :class:`Operations<azure.mgmt.containerservice.v2019_04_01.operations.Operations>`
* 2019-06-01: :class:`Operations<azure.mgmt.containerservice.v2019_06_01.operations.Operations>`
* 2019-08-01: :class:`Operations<azure.mgmt.containerservice.v2019_08_01.operations.Operations>`
* 2019-10-01: :class:`Operations<azure.mgmt.containerservice.v2019_10_01.operations.Operations>`
"""
api_version = self._get_api_version('operations')
if api_version == '2018-03-31':
Expand All @@ -216,6 +234,8 @@ def operations(self):
from .v2019_06_01.operations import Operations as OperationClass
elif api_version == '2019-08-01':
from .v2019_08_01.operations import Operations as OperationClass
elif api_version == '2019-10-01':
from .v2019_10_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
Expand Up @@ -6,4 +6,4 @@
# --------------------------------------------------------------------------
from .v2017_07_01.models import *
from .v2019_04_30.models import *
from .v2019_08_01.models import *
from .v2019_10_01.models import *
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def get_upgrade_profile(
get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'}

def get_available_agent_pool_versions(
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config):
"""Gets a list of supported versions for the specified agent pool.
Gets a list of supported versions for the specified agent pool.
Expand All @@ -456,8 +456,6 @@ def get_available_agent_pool_versions(
:type resource_group_name: str
:param resource_name: The name of the managed cluster resource.
:type resource_name: str
:param agent_pool_name: The name of the agent pool.
:type agent_pool_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
Expand All @@ -474,8 +472,7 @@ def get_available_agent_pool_versions(
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', min_length=1),
'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'),
'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str')
'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -511,4 +508,4 @@ def get_available_agent_pool_versions(
return client_raw_response

return deserialized
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/availableAgentPoolVersions'}
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'}
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ def get_upgrade_profile(
get_upgrade_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default'}

def get_available_agent_pool_versions(
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config):
self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config):
"""Gets a list of supported versions for the specified agent pool.
Gets a list of supported versions for the specified agent pool.
Expand All @@ -456,8 +456,6 @@ def get_available_agent_pool_versions(
:type resource_group_name: str
:param resource_name: The name of the managed cluster resource.
:type resource_name: str
:param agent_pool_name: The name of the agent pool.
:type agent_pool_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
Expand All @@ -474,8 +472,7 @@ def get_available_agent_pool_versions(
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', min_length=1),
'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'),
'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str')
'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$')
}
url = self._client.format_url(url, **path_format_arguments)

Expand Down Expand Up @@ -511,4 +508,4 @@ def get_available_agent_pool_versions(
return client_raw_response

return deserialized
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/availableAgentPoolVersions'}
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'}
Original file line number Diff line number Diff line change
Expand Up @@ -986,3 +986,84 @@ def get_long_running_output(response):
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
reset_aad_profile.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/resetAADProfile'}


def _rotate_cluster_certificates_initial(
self, resource_group_name, resource_name, custom_headers=None, raw=False, **operation_config):
# Construct URL
url = self.rotate_cluster_certificates.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', min_length=1),
'resourceName': self._serialize.url("resource_name", resource_name, 'str', max_length=63, min_length=1, pattern=r'^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$')
}
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 = {}
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, header_parameters)
response = self._client.send(request, stream=False, **operation_config)

if response.status_code not in [202, 204]:
exp = CloudError(response)
exp.request_id = response.headers.get('x-ms-request-id')
raise exp

if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

def rotate_cluster_certificates(
self, resource_group_name, resource_name, custom_headers=None, raw=False, polling=True, **operation_config):
"""Rotate certificates of a managed cluster.
Rotate certificates of a managed cluster.
: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 dict custom_headers: headers that will be added to the request
:param bool raw: The poller return type is ClientRawResponse, the
direct response alongside the deserialized response
:param polling: True for ARMPolling, False for no polling, or a
polling object for personal polling strategy
:return: An instance of LROPoller that returns None or
ClientRawResponse<None> if raw==True
:rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]]
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
"""
raw_result = self._rotate_cluster_certificates_initial(
resource_group_name=resource_group_name,
resource_name=resource_name,
custom_headers=custom_headers,
raw=True,
**operation_config
)

def get_long_running_output(response):
if raw:
client_raw_response = ClientRawResponse(None, response)
return client_raw_response

lro_delay = operation_config.get(
'long_running_operation_timeout',
self.config.long_running_operation_timeout)
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
elif polling is False: polling_method = NoPolling()
else: polling_method = polling
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ._configuration import ContainerServiceClientConfiguration
from ._container_service_client import ContainerServiceClient
__all__ = ['ContainerServiceClient', 'ContainerServiceClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 msrestazure import AzureConfiguration

from .version import VERSION


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)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

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
Loading

0 comments on commit 602441a

Please sign in to comment.