Skip to content

Commit d24809b

Browse files
Azure CLI BotSDKAutosikasiremsyyc
authored
[AutoRelease] t2-hybridkubernetes-2021-10-04-45305 (Azure#21037)
* CodeGen from PR 15956 in Azure/azure-rest-api-specs New GA version changes - 2021-10-01 (Azure#15956) * New GA api-version changes- 2021-01-01 * readme changes * readme changes * add systemdata definition * system data ref fix * system data ref fix * fix * fix * fix * remove empty patch section * revert patch section * lint fix * lint fix * lintfix * readme changes * Update readme.md * remove property bag from cc update example * Fixing listClusterUserCreds examples * hide creds * example file naming changes and clientProxy flag correction Co-authored-by: Siri Teja Reddy Kasireddy <sikasire@microsoft.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> * version,CHANGELOG * Update CHANGELOG.md Co-authored-by: SDKAuto <sdkautomation@microsoft.com> Co-authored-by: Siri Teja Reddy Kasireddy <sikasire@microsoft.com> Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com> Co-authored-by: PythonSdkPipelines <PythonSdkPipelines> Co-authored-by: Yuchao Yan <yuchaoyan@microsoft.com>
1 parent 882ae75 commit d24809b

File tree

14 files changed

+504
-64
lines changed

14 files changed

+504
-64
lines changed

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Release History
22

3+
## 1.1.0 (2021-10-20)
4+
5+
**Features**
6+
7+
- Added operation ConnectedClusterOperations.list_cluster_user_credential
8+
39
## 1.0.0 (2021-05-19)
410

511
**Features**
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
{
2-
"autorest": "3.3.0",
3-
"use": "@autorest/python@5.6.6",
4-
"commit": "e34c5f11d61ca17fdc9fd0f70446dd54b94d67f1",
2+
"autorest": "3.4.5",
3+
"use": [
4+
"@autorest/python@5.8.4",
5+
"@autorest/modelerfour@4.19.2"
6+
],
7+
"commit": "9a19506631005d0ff1e3f394c86a9ce10cf51910",
58
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
6-
"autorest_command": "autorest specification/hybridkubernetes/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.6.6 --version=3.3.0",
9+
"autorest_command": "autorest specification/hybridkubernetes/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5",
710
"readme": "specification/hybridkubernetes/resource-manager/readme.md"
811
}

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def __init__(
4848

4949
self.credential = credential
5050
self.subscription_id = subscription_id
51-
self.api_version = "2021-03-01"
51+
self.api_version = "2021-10-01"
5252
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5353
kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION))
5454
self._configure(**kwargs)

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"chosen_version": "2021-03-01",
3-
"total_api_version_list": ["2021-03-01"],
2+
"chosen_version": "2021-10-01",
3+
"total_api_version_list": ["2021-10-01"],
44
"client": {
55
"name": "ConnectedKubernetesClient",
66
"filename": "_connected_kubernetes_client",

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "1.0.0"
9+
VERSION = "1.1.0"

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-03-01"
48+
self.api_version = "2021-10-01"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_connected_cluster_operations.py

Lines changed: 95 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,22 +48,22 @@ async def _create_initial(
4848
resource_group_name: str,
4949
cluster_name: str,
5050
connected_cluster: "_models.ConnectedCluster",
51-
**kwargs
51+
**kwargs: Any
5252
) -> "_models.ConnectedCluster":
5353
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"]
5454
error_map = {
5555
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
5656
}
5757
error_map.update(kwargs.pop('error_map', {}))
58-
api_version = "2021-03-01"
58+
api_version = "2021-10-01"
5959
content_type = kwargs.pop("content_type", "application/json")
6060
accept = "application/json"
6161

6262
# Construct URL
6363
url = self._create_initial.metadata['url'] # type: ignore
6464
path_format_arguments = {
6565
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
66-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
66+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
6767
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
6868
}
6969
url = self._client.format_url(url, **path_format_arguments)
@@ -106,7 +106,7 @@ async def begin_create(
106106
resource_group_name: str,
107107
cluster_name: str,
108108
connected_cluster: "_models.ConnectedCluster",
109-
**kwargs
109+
**kwargs: Any
110110
) -> AsyncLROPoller["_models.ConnectedCluster"]:
111111
"""Register a new Kubernetes cluster with Azure Resource Manager.
112112
@@ -121,8 +121,8 @@ async def begin_create(
121121
:type connected_cluster: ~connected_kubernetes_client.models.ConnectedCluster
122122
:keyword callable cls: A custom type or function that will be passed the direct response
123123
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
124-
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
125-
False for no polling, or your own initialized polling object for a personal polling strategy.
124+
:keyword polling: By default, your polling method will be AsyncARMPolling.
125+
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
126126
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
127127
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
128128
:return: An instance of AsyncLROPoller that returns either ConnectedCluster or the result of cls(response)
@@ -157,7 +157,7 @@ def get_long_running_output(pipeline_response):
157157

158158
path_format_arguments = {
159159
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
160-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
160+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
161161
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
162162
}
163163

@@ -180,7 +180,7 @@ async def update(
180180
resource_group_name: str,
181181
cluster_name: str,
182182
connected_cluster_patch: "_models.ConnectedClusterPatch",
183-
**kwargs
183+
**kwargs: Any
184184
) -> "_models.ConnectedCluster":
185185
"""Updates a connected cluster.
186186
@@ -202,15 +202,15 @@ async def update(
202202
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
203203
}
204204
error_map.update(kwargs.pop('error_map', {}))
205-
api_version = "2021-03-01"
205+
api_version = "2021-10-01"
206206
content_type = kwargs.pop("content_type", "application/json")
207207
accept = "application/json"
208208

209209
# Construct URL
210210
url = self.update.metadata['url'] # type: ignore
211211
path_format_arguments = {
212212
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
213-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
213+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
214214
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
215215
}
216216
url = self._client.format_url(url, **path_format_arguments)
@@ -248,7 +248,7 @@ async def get(
248248
self,
249249
resource_group_name: str,
250250
cluster_name: str,
251-
**kwargs
251+
**kwargs: Any
252252
) -> "_models.ConnectedCluster":
253253
"""Get the properties of the specified connected cluster.
254254
@@ -269,14 +269,14 @@ async def get(
269269
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
270270
}
271271
error_map.update(kwargs.pop('error_map', {}))
272-
api_version = "2021-03-01"
272+
api_version = "2021-10-01"
273273
accept = "application/json"
274274

275275
# Construct URL
276276
url = self.get.metadata['url'] # type: ignore
277277
path_format_arguments = {
278278
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
279-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
279+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
280280
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
281281
}
282282
url = self._client.format_url(url, **path_format_arguments)
@@ -310,21 +310,21 @@ async def _delete_initial(
310310
self,
311311
resource_group_name: str,
312312
cluster_name: str,
313-
**kwargs
313+
**kwargs: Any
314314
) -> None:
315315
cls = kwargs.pop('cls', None) # type: ClsType[None]
316316
error_map = {
317317
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
318318
}
319319
error_map.update(kwargs.pop('error_map', {}))
320-
api_version = "2021-03-01"
320+
api_version = "2021-10-01"
321321
accept = "application/json"
322322

323323
# Construct URL
324324
url = self._delete_initial.metadata['url'] # type: ignore
325325
path_format_arguments = {
326326
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
327-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
327+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
328328
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
329329
}
330330
url = self._client.format_url(url, **path_format_arguments)
@@ -355,7 +355,7 @@ async def begin_delete(
355355
self,
356356
resource_group_name: str,
357357
cluster_name: str,
358-
**kwargs
358+
**kwargs: Any
359359
) -> AsyncLROPoller[None]:
360360
"""Delete a connected cluster.
361361
@@ -367,8 +367,8 @@ async def begin_delete(
367367
:type cluster_name: str
368368
:keyword callable cls: A custom type or function that will be passed the direct response
369369
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
370-
:keyword polling: Pass in True if you'd like the AsyncARMPolling polling method,
371-
False for no polling, or your own initialized polling object for a personal polling strategy.
370+
:keyword polling: By default, your polling method will be AsyncARMPolling.
371+
Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy.
372372
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
373373
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
374374
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
@@ -399,7 +399,7 @@ def get_long_running_output(pipeline_response):
399399

400400
path_format_arguments = {
401401
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
402-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
402+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
403403
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
404404
}
405405

@@ -417,10 +417,80 @@ def get_long_running_output(pipeline_response):
417417
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
418418
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}'} # type: ignore
419419

420+
async def list_cluster_user_credential(
421+
self,
422+
resource_group_name: str,
423+
cluster_name: str,
424+
properties: "_models.ListClusterUserCredentialProperties",
425+
**kwargs: Any
426+
) -> "_models.CredentialResults":
427+
"""Gets cluster user credentials of a connected cluster.
428+
429+
Gets cluster user credentials of the connected cluster with a specified resource group and
430+
name.
431+
432+
:param resource_group_name: The name of the resource group. The name is case insensitive.
433+
:type resource_group_name: str
434+
:param cluster_name: The name of the Kubernetes cluster on which get is called.
435+
:type cluster_name: str
436+
:param properties: ListClusterUserCredential properties.
437+
:type properties: ~connected_kubernetes_client.models.ListClusterUserCredentialProperties
438+
:keyword callable cls: A custom type or function that will be passed the direct response
439+
:return: CredentialResults, or the result of cls(response)
440+
:rtype: ~connected_kubernetes_client.models.CredentialResults
441+
:raises: ~azure.core.exceptions.HttpResponseError
442+
"""
443+
cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"]
444+
error_map = {
445+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
446+
}
447+
error_map.update(kwargs.pop('error_map', {}))
448+
api_version = "2021-10-01"
449+
content_type = kwargs.pop("content_type", "application/json")
450+
accept = "application/json"
451+
452+
# Construct URL
453+
url = self.list_cluster_user_credential.metadata['url'] # type: ignore
454+
path_format_arguments = {
455+
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
456+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
457+
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
458+
}
459+
url = self._client.format_url(url, **path_format_arguments)
460+
461+
# Construct parameters
462+
query_parameters = {} # type: Dict[str, Any]
463+
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
464+
465+
# Construct headers
466+
header_parameters = {} # type: Dict[str, Any]
467+
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
468+
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')
469+
470+
body_content_kwargs = {} # type: Dict[str, Any]
471+
body_content = self._serialize.body(properties, 'ListClusterUserCredentialProperties')
472+
body_content_kwargs['content'] = body_content
473+
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
474+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
475+
response = pipeline_response.http_response
476+
477+
if response.status_code not in [200]:
478+
map_error(status_code=response.status_code, response=response, error_map=error_map)
479+
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
480+
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
481+
482+
deserialized = self._deserialize('CredentialResults', pipeline_response)
483+
484+
if cls:
485+
return cls(pipeline_response, deserialized, {})
486+
487+
return deserialized
488+
list_cluster_user_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential'} # type: ignore
489+
420490
def list_by_resource_group(
421491
self,
422492
resource_group_name: str,
423-
**kwargs
493+
**kwargs: Any
424494
) -> AsyncIterable["_models.ConnectedClusterList"]:
425495
"""Lists all connected clusters.
426496
@@ -438,7 +508,7 @@ def list_by_resource_group(
438508
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
439509
}
440510
error_map.update(kwargs.pop('error_map', {}))
441-
api_version = "2021-03-01"
511+
api_version = "2021-10-01"
442512
accept = "application/json"
443513

444514
def prepare_request(next_link=None):
@@ -451,7 +521,7 @@ def prepare_request(next_link=None):
451521
url = self.list_by_resource_group.metadata['url'] # type: ignore
452522
path_format_arguments = {
453523
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
454-
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
524+
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
455525
}
456526
url = self._client.format_url(url, **path_format_arguments)
457527
# Construct parameters
@@ -492,7 +562,7 @@ async def get_next(next_link=None):
492562

493563
def list_by_subscription(
494564
self,
495-
**kwargs
565+
**kwargs: Any
496566
) -> AsyncIterable["_models.ConnectedClusterList"]:
497567
"""Lists all connected clusters.
498568
@@ -508,7 +578,7 @@ def list_by_subscription(
508578
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
509579
}
510580
error_map.update(kwargs.pop('error_map', {}))
511-
api_version = "2021-03-01"
581+
api_version = "2021-10-01"
512582
accept = "application/json"
513583

514584
def prepare_request(next_link=None):

sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:
4343

4444
def get(
4545
self,
46-
**kwargs
46+
**kwargs: Any
4747
) -> AsyncIterable["_models.OperationList"]:
4848
"""Lists all of the available API operations for Connected Cluster resource.
4949
@@ -57,7 +57,7 @@ def get(
5757
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
5858
}
5959
error_map.update(kwargs.pop('error_map', {}))
60-
api_version = "2021-03-01"
60+
api_version = "2021-10-01"
6161
accept = "application/json"
6262

6363
def prepare_request(next_link=None):

0 commit comments

Comments
 (0)