Skip to content

Commit

Permalink
[AutoRelease] t2-hybridkubernetes-2021-10-04-45305 (#21037)
Browse files Browse the repository at this point in the history
* CodeGen from PR 15956 in Azure/azure-rest-api-specs
New GA version changes - 2021-10-01 (#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>
  • Loading branch information
5 people authored Oct 20, 2021
1 parent 882ae75 commit d24809b
Show file tree
Hide file tree
Showing 14 changed files with 504 additions and 64 deletions.
6 changes: 6 additions & 0 deletions sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release History

## 1.1.0 (2021-10-20)

**Features**

- Added operation ConnectedClusterOperations.list_cluster_user_credential

## 1.0.0 (2021-05-19)

**Features**
Expand Down
11 changes: 7 additions & 4 deletions sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"autorest": "3.3.0",
"use": "@autorest/python@5.6.6",
"commit": "e34c5f11d61ca17fdc9fd0f70446dd54b94d67f1",
"autorest": "3.4.5",
"use": [
"@autorest/python@5.8.4",
"@autorest/modelerfour@4.19.2"
],
"commit": "9a19506631005d0ff1e3f394c86a9ce10cf51910",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"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",
"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",
"readme": "specification/hybridkubernetes/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-03-01"
self.api_version = "2021-10-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"chosen_version": "2021-10-01",
"total_api_version_list": ["2021-10-01"],
"client": {
"name": "ConnectedKubernetesClient",
"filename": "_connected_kubernetes_client",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "1.1.0"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2021-03-01"
self.api_version = "2021-10-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,22 @@ async def _create_initial(
resource_group_name: str,
cluster_name: str,
connected_cluster: "_models.ConnectedCluster",
**kwargs
**kwargs: Any
) -> "_models.ConnectedCluster":
cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

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

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

Expand All @@ -180,7 +180,7 @@ async def update(
resource_group_name: str,
cluster_name: str,
connected_cluster_patch: "_models.ConnectedClusterPatch",
**kwargs
**kwargs: Any
) -> "_models.ConnectedCluster":
"""Updates a connected cluster.
Expand All @@ -202,15 +202,15 @@ async def update(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

# Construct URL
url = self.update.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -248,7 +248,7 @@ async def get(
self,
resource_group_name: str,
cluster_name: str,
**kwargs
**kwargs: Any
) -> "_models.ConnectedCluster":
"""Get the properties of the specified connected cluster.
Expand All @@ -269,14 +269,14 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
accept = "application/json"

# Construct URL
url = self.get.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)
Expand Down Expand Up @@ -310,21 +310,21 @@ async def _delete_initial(
self,
resource_group_name: str,
cluster_name: str,
**kwargs
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
accept = "application/json"

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

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

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

async def list_cluster_user_credential(
self,
resource_group_name: str,
cluster_name: str,
properties: "_models.ListClusterUserCredentialProperties",
**kwargs: Any
) -> "_models.CredentialResults":
"""Gets cluster user credentials of a connected cluster.
Gets cluster user credentials of the connected cluster with a specified resource group and
name.
:param resource_group_name: The name of the resource group. The name is case insensitive.
:type resource_group_name: str
:param cluster_name: The name of the Kubernetes cluster on which get is called.
:type cluster_name: str
:param properties: ListClusterUserCredential properties.
:type properties: ~connected_kubernetes_client.models.ListClusterUserCredentialProperties
:keyword callable cls: A custom type or function that will be passed the direct response
:return: CredentialResults, or the result of cls(response)
:rtype: ~connected_kubernetes_client.models.CredentialResults
:raises: ~azure.core.exceptions.HttpResponseError
"""
cls = kwargs.pop('cls', None) # type: ClsType["_models.CredentialResults"]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-10-01"
content_type = kwargs.pop("content_type", "application/json")
accept = "application/json"

# Construct URL
url = self.list_cluster_user_credential.metadata['url'] # type: ignore
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1),
'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1),
'clusterName': self._serialize.url("cluster_name", cluster_name, 'str'),
}
url = self._client.format_url(url, **path_format_arguments)

# Construct parameters
query_parameters = {} # type: Dict[str, Any]
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')

# Construct headers
header_parameters = {} # type: Dict[str, Any]
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
header_parameters['Accept'] = self._serialize.header("accept", accept, 'str')

body_content_kwargs = {} # type: Dict[str, Any]
body_content = self._serialize.body(properties, 'ListClusterUserCredentialProperties')
body_content_kwargs['content'] = body_content
request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs)
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
response = pipeline_response.http_response

if response.status_code not in [200]:
map_error(status_code=response.status_code, response=response, error_map=error_map)
error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response)
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)

deserialized = self._deserialize('CredentialResults', pipeline_response)

if cls:
return cls(pipeline_response, deserialized, {})

return deserialized
list_cluster_user_credential.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredential'} # type: ignore

def list_by_resource_group(
self,
resource_group_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ConnectedClusterList"]:
"""Lists all connected clusters.
Expand All @@ -438,7 +508,7 @@ def list_by_resource_group(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
accept = "application/json"

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

def list_by_subscription(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ConnectedClusterList"]:
"""Lists all connected clusters.
Expand All @@ -508,7 +578,7 @@ def list_by_subscription(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2021-03-01"
api_version = "2021-10-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

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

def prepare_request(next_link=None):
Expand Down
Loading

0 comments on commit d24809b

Please sign in to comment.