Skip to content

Commit 0c4cd74

Browse files
author
SDK Automation
committed
Generated from 7588ae21f15638fb7da98fada769e60310f84549
1 parent d7e64e1 commit 0c4cd74

File tree

4 files changed

+198
-198
lines changed

4 files changed

+198
-198
lines changed

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_agent_pools_operations.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,102 @@ def get_available_agent_pool_versions(
509509

510510
return deserialized
511511
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'}
512+
513+
514+
def _upgrade_node_image_version_initial(
515+
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config):
516+
# Construct URL
517+
url = self.upgrade_node_image_version.metadata['url']
518+
path_format_arguments = {
519+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
520+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
521+
'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]$'),
522+
'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str')
523+
}
524+
url = self._client.format_url(url, **path_format_arguments)
525+
526+
# Construct parameters
527+
query_parameters = {}
528+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
529+
530+
# Construct headers
531+
header_parameters = {}
532+
header_parameters['Accept'] = 'application/json'
533+
if self.config.generate_client_request_id:
534+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
535+
if custom_headers:
536+
header_parameters.update(custom_headers)
537+
if self.config.accept_language is not None:
538+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
539+
540+
# Construct and send request
541+
request = self._client.post(url, query_parameters, header_parameters)
542+
response = self._client.send(request, stream=False, **operation_config)
543+
544+
if response.status_code not in [200, 202]:
545+
exp = CloudError(response)
546+
exp.request_id = response.headers.get('x-ms-request-id')
547+
raise exp
548+
549+
deserialized = None
550+
551+
if response.status_code == 202:
552+
deserialized = self._deserialize('AgentPool', response)
553+
554+
if raw:
555+
client_raw_response = ClientRawResponse(deserialized, response)
556+
return client_raw_response
557+
558+
return deserialized
559+
560+
def upgrade_node_image_version(
561+
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config):
562+
"""Upgrade node image version of an agent pool to the latest.
563+
564+
Upgrade node image version of an agent pool to the latest.
565+
566+
:param resource_group_name: The name of the resource group.
567+
:type resource_group_name: str
568+
:param resource_name: The name of the managed cluster resource.
569+
:type resource_name: str
570+
:param agent_pool_name: The name of the agent pool.
571+
:type agent_pool_name: str
572+
:param dict custom_headers: headers that will be added to the request
573+
:param bool raw: The poller return type is ClientRawResponse, the
574+
direct response alongside the deserialized response
575+
:param polling: True for ARMPolling, False for no polling, or a
576+
polling object for personal polling strategy
577+
:return: An instance of LROPoller that returns AgentPool or
578+
ClientRawResponse<AgentPool> if raw==True
579+
:rtype:
580+
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool]
581+
or
582+
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool]]
583+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
584+
"""
585+
raw_result = self._upgrade_node_image_version_initial(
586+
resource_group_name=resource_group_name,
587+
resource_name=resource_name,
588+
agent_pool_name=agent_pool_name,
589+
custom_headers=custom_headers,
590+
raw=True,
591+
**operation_config
592+
)
593+
594+
def get_long_running_output(response):
595+
deserialized = self._deserialize('AgentPool', response)
596+
597+
if raw:
598+
client_raw_response = ClientRawResponse(deserialized, response)
599+
return client_raw_response
600+
601+
return deserialized
602+
603+
lro_delay = operation_config.get(
604+
'long_running_operation_timeout',
605+
self.config.long_running_operation_timeout)
606+
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
607+
elif polling is False: polling_method = NoPolling()
608+
else: polling_method = polling
609+
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
610+
upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'}

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_07_01/operations/_managed_clusters_operations.py

Lines changed: 0 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1137,102 +1137,3 @@ def get_long_running_output(response):
11371137
else: polling_method = polling
11381138
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
11391139
rotate_cluster_certificates.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates'}
1140-
1141-
1142-
def _upgrade_node_image_version_initial(
1143-
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config):
1144-
# Construct URL
1145-
url = self.upgrade_node_image_version.metadata['url']
1146-
path_format_arguments = {
1147-
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
1148-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
1149-
'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]$'),
1150-
'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str')
1151-
}
1152-
url = self._client.format_url(url, **path_format_arguments)
1153-
1154-
# Construct parameters
1155-
query_parameters = {}
1156-
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
1157-
1158-
# Construct headers
1159-
header_parameters = {}
1160-
header_parameters['Accept'] = 'application/json'
1161-
if self.config.generate_client_request_id:
1162-
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
1163-
if custom_headers:
1164-
header_parameters.update(custom_headers)
1165-
if self.config.accept_language is not None:
1166-
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
1167-
1168-
# Construct and send request
1169-
request = self._client.post(url, query_parameters, header_parameters)
1170-
response = self._client.send(request, stream=False, **operation_config)
1171-
1172-
if response.status_code not in [200, 202]:
1173-
exp = CloudError(response)
1174-
exp.request_id = response.headers.get('x-ms-request-id')
1175-
raise exp
1176-
1177-
deserialized = None
1178-
1179-
if response.status_code == 202:
1180-
deserialized = self._deserialize('AgentPool', response)
1181-
1182-
if raw:
1183-
client_raw_response = ClientRawResponse(deserialized, response)
1184-
return client_raw_response
1185-
1186-
return deserialized
1187-
1188-
def upgrade_node_image_version(
1189-
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config):
1190-
"""Upgrade node image version of an agent pool to the latest.
1191-
1192-
Upgrade node image version of an agent pool to the latest.
1193-
1194-
:param resource_group_name: The name of the resource group.
1195-
:type resource_group_name: str
1196-
:param resource_name: The name of the managed cluster resource.
1197-
:type resource_name: str
1198-
:param agent_pool_name: The name of the agent pool.
1199-
:type agent_pool_name: str
1200-
:param dict custom_headers: headers that will be added to the request
1201-
:param bool raw: The poller return type is ClientRawResponse, the
1202-
direct response alongside the deserialized response
1203-
:param polling: True for ARMPolling, False for no polling, or a
1204-
polling object for personal polling strategy
1205-
:return: An instance of LROPoller that returns AgentPool or
1206-
ClientRawResponse<AgentPool> if raw==True
1207-
:rtype:
1208-
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool]
1209-
or
1210-
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_07_01.models.AgentPool]]
1211-
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
1212-
"""
1213-
raw_result = self._upgrade_node_image_version_initial(
1214-
resource_group_name=resource_group_name,
1215-
resource_name=resource_name,
1216-
agent_pool_name=agent_pool_name,
1217-
custom_headers=custom_headers,
1218-
raw=True,
1219-
**operation_config
1220-
)
1221-
1222-
def get_long_running_output(response):
1223-
deserialized = self._deserialize('AgentPool', response)
1224-
1225-
if raw:
1226-
client_raw_response = ClientRawResponse(deserialized, response)
1227-
return client_raw_response
1228-
1229-
return deserialized
1230-
1231-
lro_delay = operation_config.get(
1232-
'long_running_operation_timeout',
1233-
self.config.long_running_operation_timeout)
1234-
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
1235-
elif polling is False: polling_method = NoPolling()
1236-
else: polling_method = polling
1237-
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
1238-
upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'}

sdk/containerservice/azure-mgmt-containerservice/azure/mgmt/containerservice/v2020_09_01/operations/_agent_pools_operations.py

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,3 +509,102 @@ def get_available_agent_pool_versions(
509509

510510
return deserialized
511511
get_available_agent_pool_versions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions'}
512+
513+
514+
def _upgrade_node_image_version_initial(
515+
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, **operation_config):
516+
# Construct URL
517+
url = self.upgrade_node_image_version.metadata['url']
518+
path_format_arguments = {
519+
'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'),
520+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', min_length=1),
521+
'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]$'),
522+
'agentPoolName': self._serialize.url("agent_pool_name", agent_pool_name, 'str')
523+
}
524+
url = self._client.format_url(url, **path_format_arguments)
525+
526+
# Construct parameters
527+
query_parameters = {}
528+
query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str')
529+
530+
# Construct headers
531+
header_parameters = {}
532+
header_parameters['Accept'] = 'application/json'
533+
if self.config.generate_client_request_id:
534+
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
535+
if custom_headers:
536+
header_parameters.update(custom_headers)
537+
if self.config.accept_language is not None:
538+
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
539+
540+
# Construct and send request
541+
request = self._client.post(url, query_parameters, header_parameters)
542+
response = self._client.send(request, stream=False, **operation_config)
543+
544+
if response.status_code not in [200, 202]:
545+
exp = CloudError(response)
546+
exp.request_id = response.headers.get('x-ms-request-id')
547+
raise exp
548+
549+
deserialized = None
550+
551+
if response.status_code == 202:
552+
deserialized = self._deserialize('AgentPool', response)
553+
554+
if raw:
555+
client_raw_response = ClientRawResponse(deserialized, response)
556+
return client_raw_response
557+
558+
return deserialized
559+
560+
def upgrade_node_image_version(
561+
self, resource_group_name, resource_name, agent_pool_name, custom_headers=None, raw=False, polling=True, **operation_config):
562+
"""Upgrade node image version of an agent pool to the latest.
563+
564+
Upgrade node image version of an agent pool to the latest.
565+
566+
:param resource_group_name: The name of the resource group.
567+
:type resource_group_name: str
568+
:param resource_name: The name of the managed cluster resource.
569+
:type resource_name: str
570+
:param agent_pool_name: The name of the agent pool.
571+
:type agent_pool_name: str
572+
:param dict custom_headers: headers that will be added to the request
573+
:param bool raw: The poller return type is ClientRawResponse, the
574+
direct response alongside the deserialized response
575+
:param polling: True for ARMPolling, False for no polling, or a
576+
polling object for personal polling strategy
577+
:return: An instance of LROPoller that returns AgentPool or
578+
ClientRawResponse<AgentPool> if raw==True
579+
:rtype:
580+
~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool]
581+
or
582+
~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.containerservice.v2020_09_01.models.AgentPool]]
583+
:raises: :class:`CloudError<msrestazure.azure_exceptions.CloudError>`
584+
"""
585+
raw_result = self._upgrade_node_image_version_initial(
586+
resource_group_name=resource_group_name,
587+
resource_name=resource_name,
588+
agent_pool_name=agent_pool_name,
589+
custom_headers=custom_headers,
590+
raw=True,
591+
**operation_config
592+
)
593+
594+
def get_long_running_output(response):
595+
deserialized = self._deserialize('AgentPool', response)
596+
597+
if raw:
598+
client_raw_response = ClientRawResponse(deserialized, response)
599+
return client_raw_response
600+
601+
return deserialized
602+
603+
lro_delay = operation_config.get(
604+
'long_running_operation_timeout',
605+
self.config.long_running_operation_timeout)
606+
if polling is True: polling_method = ARMPolling(lro_delay, **operation_config)
607+
elif polling is False: polling_method = NoPolling()
608+
else: polling_method = polling
609+
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
610+
upgrade_node_image_version.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeNodeImageVersion'}

0 commit comments

Comments
 (0)