From c75710a0045c222598991a713e6ed575165297f9 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 7 May 2021 09:13:58 +0000 Subject: [PATCH] CodeGen from PR 14276 in Azure/azure-rest-api-specs hybridkubernetes wave4 (#14276) Co-authored-by: Yan Zhang (WICRESOFT NORTH AMERICA LTD) --- .../azure-mgmt-hybridkubernetes/MANIFEST.in | 1 + .../azure-mgmt-hybridkubernetes/_meta.json | 8 + .../mgmt/hybridkubernetes/_configuration.py | 2 +- .../_connected_kubernetes_client.py | 23 +- .../mgmt/hybridkubernetes/_metadata.json | 104 ++++++ .../azure/mgmt/hybridkubernetes/_version.py | 1 - .../hybridkubernetes/aio/_configuration.py | 2 +- .../aio/_connected_kubernetes_client.py | 22 +- .../_connected_cluster_operations.py | 127 ++------ .../aio/operations/_operations.py | 8 +- .../mgmt/hybridkubernetes/models/__init__.py | 27 +- .../_connected_kubernetes_client_enums.py | 24 +- .../mgmt/hybridkubernetes/models/_models.py | 283 ++++------------ .../hybridkubernetes/models/_models_py3.py | 304 +++++------------- .../_connected_cluster_operations.py | 128 ++------ .../operations/_operations.py | 8 +- 16 files changed, 386 insertions(+), 686 deletions(-) create mode 100644 sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_meta.json create mode 100644 sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_metadata.json diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/MANIFEST.in b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/MANIFEST.in index a3cb07df8765..3a9b6517412b 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/MANIFEST.in +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/MANIFEST.in @@ -1,3 +1,4 @@ +include _meta.json recursive-include tests *.py *.yaml include *.md include azure/__init__.py diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_meta.json b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_meta.json new file mode 100644 index 000000000000..267624bb2fb4 --- /dev/null +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/_meta.json @@ -0,0 +1,8 @@ +{ + "autorest": "3.3.0", + "use": "@autorest/python@5.6.6", + "commit": "e34c5f11d61ca17fdc9fd0f70446dd54b94d67f1", + "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", + "readme": "specification/hybridkubernetes/resource-manager/readme.md" +} \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_configuration.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_configuration.py index 1d51f3a1bdde..94b86be667aa 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_configuration.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-01-01-preview" + self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_connected_kubernetes_client.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_connected_kubernetes_client.py index 2902a78c0d4f..9b129da73865 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_connected_kubernetes_client.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_connected_kubernetes_client.py @@ -16,6 +16,7 @@ from typing import Any, Optional from azure.core.credentials import TokenCredential + from azure.core.pipeline.transport import HttpRequest, HttpResponse from ._configuration import ConnectedKubernetesClientConfiguration from .operations import ConnectedClusterOperations @@ -27,9 +28,9 @@ class ConnectedKubernetesClient(object): """Azure Connected Cluster Resource Provider API for adopting any Kubernetes Cluster. :ivar connected_cluster: ConnectedClusterOperations operations - :vartype connected_cluster: azure.mgmt.hybridkubernetes.operations.ConnectedClusterOperations + :vartype connected_cluster: connected_kubernetes_client.operations.ConnectedClusterOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.hybridkubernetes.operations.Operations + :vartype operations: connected_kubernetes_client.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -61,6 +62,24 @@ def __init__( self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + def _send_request(self, http_request, **kwargs): + # type: (HttpRequest, Any) -> HttpResponse + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.HttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + def close(self): # type: () -> None self._client.close() diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_metadata.json b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_metadata.json new file mode 100644 index 000000000000..f76dc3a23ee3 --- /dev/null +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_metadata.json @@ -0,0 +1,104 @@ +{ + "chosen_version": "2021-03-01", + "total_api_version_list": ["2021-03-01"], + "client": { + "name": "ConnectedKubernetesClient", + "filename": "_connected_kubernetes_client", + "description": "Azure Connected Cluster Resource Provider API for adopting any Kubernetes Cluster.", + "base_url": "\u0027https://management.azure.com\u0027", + "custom_base_url": null, + "azure_arm": true, + "has_lro_operations": true, + "client_side_validation": false, + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConnectedKubernetesClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"ConnectedKubernetesClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + }, + "global_parameters": { + "sync": { + "credential": { + "signature": "credential, # type: \"TokenCredential\"", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials.TokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id, # type: str", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "async": { + "credential": { + "signature": "credential: \"AsyncTokenCredential\",", + "description": "Credential needed for the client to connect to Azure.", + "docstring_type": "~azure.core.credentials_async.AsyncTokenCredential", + "required": true + }, + "subscription_id": { + "signature": "subscription_id: str,", + "description": "The ID of the target subscription.", + "docstring_type": "str", + "required": true + } + }, + "constant": { + }, + "call": "credential, subscription_id", + "service_client_specific": { + "sync": { + "api_version": { + "signature": "api_version=None, # type: Optional[str]", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url=None, # type: Optional[str]", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile=KnownProfiles.default, # type: KnownProfiles", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + }, + "async": { + "api_version": { + "signature": "api_version: Optional[str] = None,", + "description": "API version to use if no profile is provided, or if missing in profile.", + "docstring_type": "str", + "required": false + }, + "base_url": { + "signature": "base_url: Optional[str] = None,", + "description": "Service URL", + "docstring_type": "str", + "required": false + }, + "profile": { + "signature": "profile: KnownProfiles = KnownProfiles.default,", + "description": "A profile definition, from KnownProfiles to dict.", + "docstring_type": "azure.profiles.KnownProfiles", + "required": false + } + } + } + }, + "config": { + "credential": true, + "credential_scopes": ["https://management.azure.com/.default"], + "credential_default_policy_type": "BearerTokenCredentialPolicy", + "credential_default_policy_type_has_async_version": true, + "credential_key_header_name": null, + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}" + }, + "operation_groups": { + "connected_cluster": "ConnectedClusterOperations", + "operations": "Operations" + } +} \ No newline at end of file diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py index 515f51c112dd..e5754a47ce68 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/_version.py @@ -7,4 +7,3 @@ # -------------------------------------------------------------------------- VERSION = "1.0.0b1" - diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_configuration.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_configuration.py index b86c11133e1c..f57e8e5affd3 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_configuration.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_configuration.py @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2020-01-01-preview" + self.api_version = "2021-03-01" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-hybridkubernetes/{}'.format(VERSION)) self._configure(**kwargs) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_connected_kubernetes_client.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_connected_kubernetes_client.py index dbeb301cbdb0..0e3010cb1ba1 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_connected_kubernetes_client.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/_connected_kubernetes_client.py @@ -8,6 +8,7 @@ from typing import Any, Optional, TYPE_CHECKING +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest from azure.mgmt.core import AsyncARMPipelineClient from msrest import Deserializer, Serializer @@ -25,9 +26,9 @@ class ConnectedKubernetesClient(object): """Azure Connected Cluster Resource Provider API for adopting any Kubernetes Cluster. :ivar connected_cluster: ConnectedClusterOperations operations - :vartype connected_cluster: azure.mgmt.hybridkubernetes.aio.operations.ConnectedClusterOperations + :vartype connected_cluster: connected_kubernetes_client.aio.operations.ConnectedClusterOperations :ivar operations: Operations operations - :vartype operations: azure.mgmt.hybridkubernetes.aio.operations.Operations + :vartype operations: connected_kubernetes_client.aio.operations.Operations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -58,6 +59,23 @@ def __init__( self.operations = Operations( self._client, self._config, self._serialize, self._deserialize) + async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: + """Runs the network request through the client's chained policies. + + :param http_request: The network request you want to make. Required. + :type http_request: ~azure.core.pipeline.transport.HttpRequest + :keyword bool stream: Whether the response payload will be streamed. Defaults to True. + :return: The response of your network call. Does not do error handling on your response. + :rtype: ~azure.core.pipeline.transport.AsyncHttpResponse + """ + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + } + http_request.url = self._client.format_url(http_request.url, **path_format_arguments) + stream = kwargs.pop("stream", True) + pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs) + return pipeline_response.http_response + async def close(self) -> None: await self._client.close() diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_connected_cluster_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_connected_cluster_operations.py index a7c3b8946182..8918c02adb09 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_connected_cluster_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_connected_cluster_operations.py @@ -28,7 +28,7 @@ class ConnectedClusterOperations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridkubernetes.models + :type models: ~connected_kubernetes_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -55,7 +55,7 @@ async def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -86,7 +86,7 @@ async def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -118,15 +118,15 @@ async def begin_create( :param cluster_name: The name of the Kubernetes cluster on which get is called. :type cluster_name: str :param connected_cluster: Parameters supplied to Create a Connected Cluster. - :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. :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) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] + :rtype: ~azure.core.polling.AsyncLROPoller[~connected_kubernetes_client.models.ConnectedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] @@ -191,10 +191,10 @@ async def update( :param cluster_name: The name of the Kubernetes cluster on which get is called. :type cluster_name: str :param connected_cluster_patch: Parameters supplied to update Connected Cluster. - :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch + :type connected_cluster_patch: ~connected_kubernetes_client.models.ConnectedClusterPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: ConnectedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :rtype: ~connected_kubernetes_client.models.ConnectedCluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"] @@ -202,7 +202,7 @@ async def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -233,7 +233,7 @@ async def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectedCluster', pipeline_response) @@ -261,7 +261,7 @@ async def get( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ConnectedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :rtype: ~connected_kubernetes_client.models.ConnectedCluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"] @@ -269,7 +269,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -295,7 +295,7 @@ async def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectedCluster', pipeline_response) @@ -317,7 +317,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -343,7 +343,7 @@ async def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :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. :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) @@ -417,85 +417,6 @@ 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_credentials( - self, - resource_group_name: str, - cluster_name: str, - client_proxy: Optional[bool] = None, - client_authentication_details: Optional["_models.AuthenticationDetails"] = None, - **kwargs - ) -> "_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 client_proxy: Parameter to indicate whether the request is for client side proxy or not. - :type client_proxy: bool - :param client_authentication_details: Authentication parameters supplied by the user to fetch - credentials for accessing the cluster. - :type client_authentication_details: ~azure.mgmt.hybridkubernetes.models.AuthenticationDetails - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CredentialResults, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.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 = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.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\._\(\)]+$'), - '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') - if client_proxy is not None: - query_parameters['ClientProxy'] = self._serialize.query("client_proxy", client_proxy, 'bool') - - # 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] - if client_authentication_details is not None: - body_content = self._serialize.body(client_authentication_details, 'AuthenticationDetails') - else: - body_content = None - 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(_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_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredentials'} # type: ignore - def list_by_resource_group( self, resource_group_name: str, @@ -509,7 +430,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConnectedClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridkubernetes.models.ConnectedClusterList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_kubernetes_client.models.ConnectedClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedClusterList"] @@ -517,7 +438,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -558,7 +479,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -579,7 +500,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConnectedClusterList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridkubernetes.models.ConnectedClusterList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_kubernetes_client.models.ConnectedClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedClusterList"] @@ -587,7 +508,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -627,7 +548,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py index c770363bcc1b..d9f99f389f57 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/aio/operations/_operations.py @@ -26,7 +26,7 @@ class Operations: instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridkubernetes.models + :type models: ~connected_kubernetes_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -49,7 +49,7 @@ def get( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.hybridkubernetes.models.OperationList] + :rtype: ~azure.core.async_paging.AsyncItemPaged[~connected_kubernetes_client.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -57,7 +57,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -93,7 +93,7 @@ async def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/__init__.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/__init__.py index 5067af8b7115..2c3091d2c8b6 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/__init__.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/__init__.py @@ -7,72 +7,59 @@ # -------------------------------------------------------------------------- try: - from ._models_py3 import AuthenticationDetails - from ._models_py3 import AuthenticationDetailsValue from ._models_py3 import ConnectedCluster - from ._models_py3 import ConnectedClusterAADProfile from ._models_py3 import ConnectedClusterIdentity from ._models_py3 import ConnectedClusterList from ._models_py3 import ConnectedClusterPatch - from ._models_py3 import CredentialResult - from ._models_py3 import CredentialResults from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse - from ._models_py3 import HybridConnectionConfig from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationList from ._models_py3 import Resource + from ._models_py3 import SystemData from ._models_py3 import TrackedResource except (SyntaxError, ImportError): - from ._models import AuthenticationDetails # type: ignore - from ._models import AuthenticationDetailsValue # type: ignore from ._models import ConnectedCluster # type: ignore - from ._models import ConnectedClusterAADProfile # type: ignore from ._models import ConnectedClusterIdentity # type: ignore from ._models import ConnectedClusterList # type: ignore from ._models import ConnectedClusterPatch # type: ignore - from ._models import CredentialResult # type: ignore - from ._models import CredentialResults # type: ignore from ._models import ErrorAdditionalInfo # type: ignore from ._models import ErrorDetail # type: ignore from ._models import ErrorResponse # type: ignore - from ._models import HybridConnectionConfig # type: ignore from ._models import Operation # type: ignore from ._models import OperationDisplay # type: ignore from ._models import OperationList # type: ignore from ._models import Resource # type: ignore + from ._models import SystemData # type: ignore from ._models import TrackedResource # type: ignore from ._connected_kubernetes_client_enums import ( - AuthenticationMethod, ConnectivityStatus, + CreatedByType, + LastModifiedByType, ProvisioningState, ResourceIdentityType, ) __all__ = [ - 'AuthenticationDetails', - 'AuthenticationDetailsValue', 'ConnectedCluster', - 'ConnectedClusterAADProfile', 'ConnectedClusterIdentity', 'ConnectedClusterList', 'ConnectedClusterPatch', - 'CredentialResult', - 'CredentialResults', 'ErrorAdditionalInfo', 'ErrorDetail', 'ErrorResponse', - 'HybridConnectionConfig', 'Operation', 'OperationDisplay', 'OperationList', 'Resource', + 'SystemData', 'TrackedResource', - 'AuthenticationMethod', 'ConnectivityStatus', + 'CreatedByType', + 'LastModifiedByType', 'ProvisioningState', 'ResourceIdentityType', ] diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_connected_kubernetes_client_enums.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_connected_kubernetes_client_enums.py index 75840ee05a40..84f185bf193a 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_connected_kubernetes_client_enums.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_connected_kubernetes_client_enums.py @@ -26,12 +26,6 @@ def __getattr__(cls, name): raise AttributeError(name) -class AuthenticationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): - """The mode of client authentication. - """ - - TOKEN = "Token" - class ConnectivityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Represents the connectivity status of the connected cluster. """ @@ -41,6 +35,24 @@ class ConnectivityStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): OFFLINE = "Offline" EXPIRED = "Expired" +class CreatedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that created the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + +class LastModifiedByType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The type of identity that last modified the resource. + """ + + USER = "User" + APPLICATION = "Application" + MANAGED_IDENTITY = "ManagedIdentity" + KEY = "Key" + class ProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """The current deployment state of connectedClusters. """ diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models.py index aa9b700380ed..030d3aba9563 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models.py @@ -10,56 +10,6 @@ import msrest.serialization -class AuthenticationDetails(msrest.serialization.Model): - """Authentication details of the user. - - All required parameters must be populated in order to send to Azure. - - :param authentication_method: Required. The mode of client authentication. Possible values - include: "Token". - :type authentication_method: str or ~azure.mgmt.hybridkubernetes.models.AuthenticationMethod - :param value: Required. Authentication token value. - :type value: ~azure.mgmt.hybridkubernetes.models.AuthenticationDetailsValue - """ - - _validation = { - 'authentication_method': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'AuthenticationDetailsValue'}, - } - - def __init__( - self, - **kwargs - ): - super(AuthenticationDetails, self).__init__(**kwargs) - self.authentication_method = kwargs['authentication_method'] - self.value = kwargs['value'] - - -class AuthenticationDetailsValue(msrest.serialization.Model): - """Authentication token value. - - :param token: Authentication token. - :type token: str - """ - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(AuthenticationDetailsValue, self).__init__(**kwargs) - self.token = kwargs.get('token', None) - - class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -98,7 +48,7 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -162,12 +112,12 @@ class ConnectedCluster(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param identity: Required. The identity of the connected cluster. - :type identity: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterIdentity + :type identity: ~connected_kubernetes_client.models.ConnectedClusterIdentity + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~connected_kubernetes_client.models.SystemData :param agent_public_key_certificate: Required. Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. :type agent_public_key_certificate: str - :param aad_profile: Required. AAD profile of the connected cluster. - :type aad_profile: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterAADProfile :ivar kubernetes_version: The Kubernetes version of the connected cluster resource. :vartype kubernetes_version: str :ivar total_node_count: Number of nodes present in the connected cluster resource. @@ -179,7 +129,7 @@ class ConnectedCluster(TrackedResource): :param provisioning_state: Provisioning state of the connected cluster resource. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.hybridkubernetes.models.ProvisioningState + :type provisioning_state: str or ~connected_kubernetes_client.models.ProvisioningState :param distribution: The Kubernetes distribution running on this connected cluster. :type distribution: str :param infrastructure: The infrastructure on which the Kubernetes cluster represented by this @@ -193,9 +143,9 @@ class ConnectedCluster(TrackedResource): :ivar last_connectivity_time: Time representing the last instance when heart beat was received from the cluster. :vartype last_connectivity_time: ~datetime.datetime - :param connectivity_status: Represents the connectivity status of the connected cluster. + :ivar connectivity_status: Represents the connectivity status of the connected cluster. Possible values include: "Connecting", "Connected", "Offline", "Expired". - :type connectivity_status: str or ~azure.mgmt.hybridkubernetes.models.ConnectivityStatus + :vartype connectivity_status: str or ~connected_kubernetes_client.models.ConnectivityStatus """ _validation = { @@ -204,8 +154,8 @@ class ConnectedCluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'identity': {'required': True}, + 'system_data': {'readonly': True}, 'agent_public_key_certificate': {'required': True}, - 'aad_profile': {'required': True}, 'kubernetes_version': {'readonly': True}, 'total_node_count': {'readonly': True}, 'total_core_count': {'readonly': True}, @@ -213,6 +163,7 @@ class ConnectedCluster(TrackedResource): 'offering': {'readonly': True}, 'managed_identity_certificate_expiration_time': {'readonly': True}, 'last_connectivity_time': {'readonly': True}, + 'connectivity_status': {'readonly': True}, } _attribute_map = { @@ -222,8 +173,8 @@ class ConnectedCluster(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'ConnectedClusterIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'agent_public_key_certificate': {'key': 'properties.agentPublicKeyCertificate', 'type': 'str'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ConnectedClusterAADProfile'}, 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, 'total_node_count': {'key': 'properties.totalNodeCount', 'type': 'int'}, 'total_core_count': {'key': 'properties.totalCoreCount', 'type': 'int'}, @@ -243,8 +194,8 @@ def __init__( ): super(ConnectedCluster, self).__init__(**kwargs) self.identity = kwargs['identity'] + self.system_data = None self.agent_public_key_certificate = kwargs['agent_public_key_certificate'] - self.aad_profile = kwargs['aad_profile'] self.kubernetes_version = None self.total_node_count = None self.total_core_count = None @@ -255,42 +206,7 @@ def __init__( self.offering = None self.managed_identity_certificate_expiration_time = None self.last_connectivity_time = None - self.connectivity_status = kwargs.get('connectivity_status', None) - - -class ConnectedClusterAADProfile(msrest.serialization.Model): - """AAD profile of the connected cluster. - - All required parameters must be populated in order to send to Azure. - - :param tenant_id: Required. The aad tenant id which is configured on target K8s cluster. - :type tenant_id: str - :param client_app_id: Required. The client app id configured on target K8 cluster. - :type client_app_id: str - :param server_app_id: Required. The server app id to access AD server. - :type server_app_id: str - """ - - _validation = { - 'tenant_id': {'required': True}, - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_app_id': {'key': 'clientAppId', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppId', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(ConnectedClusterAADProfile, self).__init__(**kwargs) - self.tenant_id = kwargs['tenant_id'] - self.client_app_id = kwargs['client_app_id'] - self.server_app_id = kwargs['server_app_id'] + self.connectivity_status = None class ConnectedClusterIdentity(msrest.serialization.Model): @@ -308,8 +224,9 @@ class ConnectedClusterIdentity(msrest.serialization.Model): :vartype tenant_id: str :param type: Required. The type of identity used for the connected cluster. The type 'SystemAssigned, includes a system created identity. The type 'None' means no identity is - assigned to the connected cluster. Possible values include: "None", "SystemAssigned". - :type type: str or ~azure.mgmt.hybridkubernetes.models.ResourceIdentityType + assigned to the connected cluster. Possible values include: "None", "SystemAssigned". Default + value: "SystemAssigned". + :type type: str or ~connected_kubernetes_client.models.ResourceIdentityType """ _validation = { @@ -331,14 +248,14 @@ def __init__( super(ConnectedClusterIdentity, self).__init__(**kwargs) self.principal_id = None self.tenant_id = None - self.type = kwargs['type'] + self.type = kwargs.get('type', "SystemAssigned") class ConnectedClusterList(msrest.serialization.Model): """The paginated list of connected Clusters. :param value: The list of connected clusters. - :type value: list[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] + :type value: list[~connected_kubernetes_client.models.ConnectedCluster] :param next_link: The link to fetch the next page of connected cluster. :type next_link: str """ @@ -362,14 +279,14 @@ class ConnectedClusterPatch(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param agent_public_key_certificate: Base64 encoded public certificate used by the agent to do - the initial handshake to the backend services in Azure. - :type agent_public_key_certificate: str + :param properties: Describes the connected cluster resource properties that can be updated + during PATCH operation. + :type properties: str """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'agent_public_key_certificate': {'key': 'properties.agentPublicKeyCertificate', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'str'}, } def __init__( @@ -378,68 +295,7 @@ def __init__( ): super(ConnectedClusterPatch, self).__init__(**kwargs) self.tags = kwargs.get('tags', None) - self.agent_public_key_certificate = kwargs.get('agent_public_key_certificate', None) - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar hybrid_connection_config: Contains the REP (rendezvous endpoint) and “Sender” access - token. - :vartype hybrid_connection_config: ~azure.mgmt.hybridkubernetes.models.HybridConnectionConfig - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.hybridkubernetes.models.CredentialResult] - """ - - _validation = { - 'hybrid_connection_config': {'readonly': True}, - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'hybrid_connection_config': {'key': 'hybridConnectionConfig', 'type': 'HybridConnectionConfig'}, - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.hybrid_connection_config = None - self.kubeconfigs = None + self.properties = kwargs.get('properties', None) class ErrorAdditionalInfo(msrest.serialization.Model): @@ -450,7 +306,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: str """ _validation = { @@ -460,7 +316,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + 'info': {'key': 'info', 'type': 'str'}, } def __init__( @@ -484,9 +340,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridkubernetes.models.ErrorDetail] + :vartype details: list[~connected_kubernetes_client.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo] + :vartype additional_info: list[~connected_kubernetes_client.models.ErrorAdditionalInfo] """ _validation = { @@ -521,7 +377,7 @@ class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :param error: The error object. - :type error: ~azure.mgmt.hybridkubernetes.models.ErrorDetail + :type error: ~connected_kubernetes_client.models.ErrorDetail """ _attribute_map = { @@ -536,46 +392,6 @@ def __init__( self.error = kwargs.get('error', None) -class HybridConnectionConfig(msrest.serialization.Model): - """Contains the REP (rendezvous endpoint) and “Sender” access token. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar expiration_time: Timestamp when this token will be expired. - :vartype expiration_time: long - :ivar hybrid_connection_name: Name of the connection. - :vartype hybrid_connection_name: str - :ivar relay: Name of the relay. - :vartype relay: str - :ivar token: Sender access token. - :vartype token: str - """ - - _validation = { - 'expiration_time': {'readonly': True}, - 'hybrid_connection_name': {'readonly': True}, - 'relay': {'readonly': True}, - 'token': {'readonly': True}, - } - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'long'}, - 'hybrid_connection_name': {'key': 'hybridConnectionName', 'type': 'str'}, - 'relay': {'key': 'relay', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HybridConnectionConfig, self).__init__(**kwargs) - self.expiration_time = None - self.hybrid_connection_name = None - self.relay = None - self.token = None - - class Operation(msrest.serialization.Model): """The Connected cluster API operation. @@ -584,7 +400,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. :vartype name: str :ivar display: The object that represents the operation. - :vartype display: ~azure.mgmt.hybridkubernetes.models.OperationDisplay + :vartype display: ~connected_kubernetes_client.models.OperationDisplay """ _validation = { @@ -643,7 +459,7 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of connected cluster API operations. - :vartype value: list[~azure.mgmt.hybridkubernetes.models.Operation] + :vartype value: list[~connected_kubernetes_client.models.Operation] :param next_link: The link to fetch the next page of connected cluster API operations. :type next_link: str """ @@ -664,3 +480,44 @@ def __init__( super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = kwargs.get('next_link', None) + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~connected_kubernetes_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~connected_kubernetes_client.models.LastModifiedByType + :param last_modified_at: The timestamp of resource modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = kwargs.get('created_by', None) + self.created_by_type = kwargs.get('created_by_type', None) + self.created_at = kwargs.get('created_at', None) + self.last_modified_by = kwargs.get('last_modified_by', None) + self.last_modified_by_type = kwargs.get('last_modified_by_type', None) + self.last_modified_at = kwargs.get('last_modified_at', None) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models_py3.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models_py3.py index a3ca24ac88f9..90e1b0bd198d 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models_py3.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/models/_models_py3.py @@ -6,6 +6,7 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- +import datetime from typing import Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError @@ -14,61 +15,6 @@ from ._connected_kubernetes_client_enums import * -class AuthenticationDetails(msrest.serialization.Model): - """Authentication details of the user. - - All required parameters must be populated in order to send to Azure. - - :param authentication_method: Required. The mode of client authentication. Possible values - include: "Token". - :type authentication_method: str or ~azure.mgmt.hybridkubernetes.models.AuthenticationMethod - :param value: Required. Authentication token value. - :type value: ~azure.mgmt.hybridkubernetes.models.AuthenticationDetailsValue - """ - - _validation = { - 'authentication_method': {'required': True}, - 'value': {'required': True}, - } - - _attribute_map = { - 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'AuthenticationDetailsValue'}, - } - - def __init__( - self, - *, - authentication_method: Union[str, "AuthenticationMethod"], - value: "AuthenticationDetailsValue", - **kwargs - ): - super(AuthenticationDetails, self).__init__(**kwargs) - self.authentication_method = authentication_method - self.value = value - - -class AuthenticationDetailsValue(msrest.serialization.Model): - """Authentication token value. - - :param token: Authentication token. - :type token: str - """ - - _attribute_map = { - 'token': {'key': 'token', 'type': 'str'}, - } - - def __init__( - self, - *, - token: Optional[str] = None, - **kwargs - ): - super(AuthenticationDetailsValue, self).__init__(**kwargs) - self.token = token - - class Resource(msrest.serialization.Model): """Common fields that are returned in the response for all Azure Resource Manager resources. @@ -107,7 +53,7 @@ def __init__( class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource. + """The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location'. Variables are only populated by the server, and will be ignored when sending a request. @@ -174,12 +120,12 @@ class ConnectedCluster(TrackedResource): :param location: Required. The geo-location where the resource lives. :type location: str :param identity: Required. The identity of the connected cluster. - :type identity: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterIdentity + :type identity: ~connected_kubernetes_client.models.ConnectedClusterIdentity + :ivar system_data: Metadata pertaining to creation and last modification of the resource. + :vartype system_data: ~connected_kubernetes_client.models.SystemData :param agent_public_key_certificate: Required. Base64 encoded public certificate used by the agent to do the initial handshake to the backend services in Azure. :type agent_public_key_certificate: str - :param aad_profile: Required. AAD profile of the connected cluster. - :type aad_profile: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterAADProfile :ivar kubernetes_version: The Kubernetes version of the connected cluster resource. :vartype kubernetes_version: str :ivar total_node_count: Number of nodes present in the connected cluster resource. @@ -191,7 +137,7 @@ class ConnectedCluster(TrackedResource): :param provisioning_state: Provisioning state of the connected cluster resource. Possible values include: "Succeeded", "Failed", "Canceled", "Provisioning", "Updating", "Deleting", "Accepted". - :type provisioning_state: str or ~azure.mgmt.hybridkubernetes.models.ProvisioningState + :type provisioning_state: str or ~connected_kubernetes_client.models.ProvisioningState :param distribution: The Kubernetes distribution running on this connected cluster. :type distribution: str :param infrastructure: The infrastructure on which the Kubernetes cluster represented by this @@ -205,9 +151,9 @@ class ConnectedCluster(TrackedResource): :ivar last_connectivity_time: Time representing the last instance when heart beat was received from the cluster. :vartype last_connectivity_time: ~datetime.datetime - :param connectivity_status: Represents the connectivity status of the connected cluster. + :ivar connectivity_status: Represents the connectivity status of the connected cluster. Possible values include: "Connecting", "Connected", "Offline", "Expired". - :type connectivity_status: str or ~azure.mgmt.hybridkubernetes.models.ConnectivityStatus + :vartype connectivity_status: str or ~connected_kubernetes_client.models.ConnectivityStatus """ _validation = { @@ -216,8 +162,8 @@ class ConnectedCluster(TrackedResource): 'type': {'readonly': True}, 'location': {'required': True}, 'identity': {'required': True}, + 'system_data': {'readonly': True}, 'agent_public_key_certificate': {'required': True}, - 'aad_profile': {'required': True}, 'kubernetes_version': {'readonly': True}, 'total_node_count': {'readonly': True}, 'total_core_count': {'readonly': True}, @@ -225,6 +171,7 @@ class ConnectedCluster(TrackedResource): 'offering': {'readonly': True}, 'managed_identity_certificate_expiration_time': {'readonly': True}, 'last_connectivity_time': {'readonly': True}, + 'connectivity_status': {'readonly': True}, } _attribute_map = { @@ -234,8 +181,8 @@ class ConnectedCluster(TrackedResource): 'tags': {'key': 'tags', 'type': '{str}'}, 'location': {'key': 'location', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'ConnectedClusterIdentity'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, 'agent_public_key_certificate': {'key': 'properties.agentPublicKeyCertificate', 'type': 'str'}, - 'aad_profile': {'key': 'properties.aadProfile', 'type': 'ConnectedClusterAADProfile'}, 'kubernetes_version': {'key': 'properties.kubernetesVersion', 'type': 'str'}, 'total_node_count': {'key': 'properties.totalNodeCount', 'type': 'int'}, 'total_core_count': {'key': 'properties.totalCoreCount', 'type': 'int'}, @@ -255,18 +202,16 @@ def __init__( location: str, identity: "ConnectedClusterIdentity", agent_public_key_certificate: str, - aad_profile: "ConnectedClusterAADProfile", tags: Optional[Dict[str, str]] = None, provisioning_state: Optional[Union[str, "ProvisioningState"]] = None, distribution: Optional[str] = None, infrastructure: Optional[str] = None, - connectivity_status: Optional[Union[str, "ConnectivityStatus"]] = None, **kwargs ): super(ConnectedCluster, self).__init__(tags=tags, location=location, **kwargs) self.identity = identity + self.system_data = None self.agent_public_key_certificate = agent_public_key_certificate - self.aad_profile = aad_profile self.kubernetes_version = None self.total_node_count = None self.total_core_count = None @@ -277,46 +222,7 @@ def __init__( self.offering = None self.managed_identity_certificate_expiration_time = None self.last_connectivity_time = None - self.connectivity_status = connectivity_status - - -class ConnectedClusterAADProfile(msrest.serialization.Model): - """AAD profile of the connected cluster. - - All required parameters must be populated in order to send to Azure. - - :param tenant_id: Required. The aad tenant id which is configured on target K8s cluster. - :type tenant_id: str - :param client_app_id: Required. The client app id configured on target K8 cluster. - :type client_app_id: str - :param server_app_id: Required. The server app id to access AD server. - :type server_app_id: str - """ - - _validation = { - 'tenant_id': {'required': True}, - 'client_app_id': {'required': True}, - 'server_app_id': {'required': True}, - } - - _attribute_map = { - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'client_app_id': {'key': 'clientAppId', 'type': 'str'}, - 'server_app_id': {'key': 'serverAppId', 'type': 'str'}, - } - - def __init__( - self, - *, - tenant_id: str, - client_app_id: str, - server_app_id: str, - **kwargs - ): - super(ConnectedClusterAADProfile, self).__init__(**kwargs) - self.tenant_id = tenant_id - self.client_app_id = client_app_id - self.server_app_id = server_app_id + self.connectivity_status = None class ConnectedClusterIdentity(msrest.serialization.Model): @@ -334,8 +240,9 @@ class ConnectedClusterIdentity(msrest.serialization.Model): :vartype tenant_id: str :param type: Required. The type of identity used for the connected cluster. The type 'SystemAssigned, includes a system created identity. The type 'None' means no identity is - assigned to the connected cluster. Possible values include: "None", "SystemAssigned". - :type type: str or ~azure.mgmt.hybridkubernetes.models.ResourceIdentityType + assigned to the connected cluster. Possible values include: "None", "SystemAssigned". Default + value: "SystemAssigned". + :type type: str or ~connected_kubernetes_client.models.ResourceIdentityType """ _validation = { @@ -353,7 +260,7 @@ class ConnectedClusterIdentity(msrest.serialization.Model): def __init__( self, *, - type: Union[str, "ResourceIdentityType"], + type: Union[str, "ResourceIdentityType"] = "SystemAssigned", **kwargs ): super(ConnectedClusterIdentity, self).__init__(**kwargs) @@ -366,7 +273,7 @@ class ConnectedClusterList(msrest.serialization.Model): """The paginated list of connected Clusters. :param value: The list of connected clusters. - :type value: list[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] + :type value: list[~connected_kubernetes_client.models.ConnectedCluster] :param next_link: The link to fetch the next page of connected cluster. :type next_link: str """ @@ -393,87 +300,26 @@ class ConnectedClusterPatch(msrest.serialization.Model): :param tags: A set of tags. Resource tags. :type tags: dict[str, str] - :param agent_public_key_certificate: Base64 encoded public certificate used by the agent to do - the initial handshake to the backend services in Azure. - :type agent_public_key_certificate: str + :param properties: Describes the connected cluster resource properties that can be updated + during PATCH operation. + :type properties: str """ _attribute_map = { 'tags': {'key': 'tags', 'type': '{str}'}, - 'agent_public_key_certificate': {'key': 'properties.agentPublicKeyCertificate', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'str'}, } def __init__( self, *, tags: Optional[Dict[str, str]] = None, - agent_public_key_certificate: Optional[str] = None, + properties: Optional[str] = None, **kwargs ): super(ConnectedClusterPatch, self).__init__(**kwargs) self.tags = tags - self.agent_public_key_certificate = agent_public_key_certificate - - -class CredentialResult(msrest.serialization.Model): - """The credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The name of the credential. - :vartype name: str - :ivar value: Base64-encoded Kubernetes configuration file. - :vartype value: bytearray - """ - - _validation = { - 'name': {'readonly': True}, - 'value': {'readonly': True}, - } - - _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'value': {'key': 'value', 'type': 'bytearray'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResult, self).__init__(**kwargs) - self.name = None - self.value = None - - -class CredentialResults(msrest.serialization.Model): - """The list of credential result response. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar hybrid_connection_config: Contains the REP (rendezvous endpoint) and “Sender” access - token. - :vartype hybrid_connection_config: ~azure.mgmt.hybridkubernetes.models.HybridConnectionConfig - :ivar kubeconfigs: Base64-encoded Kubernetes configuration file. - :vartype kubeconfigs: list[~azure.mgmt.hybridkubernetes.models.CredentialResult] - """ - - _validation = { - 'hybrid_connection_config': {'readonly': True}, - 'kubeconfigs': {'readonly': True}, - } - - _attribute_map = { - 'hybrid_connection_config': {'key': 'hybridConnectionConfig', 'type': 'HybridConnectionConfig'}, - 'kubeconfigs': {'key': 'kubeconfigs', 'type': '[CredentialResult]'}, - } - - def __init__( - self, - **kwargs - ): - super(CredentialResults, self).__init__(**kwargs) - self.hybrid_connection_config = None - self.kubeconfigs = None + self.properties = properties class ErrorAdditionalInfo(msrest.serialization.Model): @@ -484,7 +330,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): :ivar type: The additional info type. :vartype type: str :ivar info: The additional info. - :vartype info: object + :vartype info: str """ _validation = { @@ -494,7 +340,7 @@ class ErrorAdditionalInfo(msrest.serialization.Model): _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, - 'info': {'key': 'info', 'type': 'object'}, + 'info': {'key': 'info', 'type': 'str'}, } def __init__( @@ -518,9 +364,9 @@ class ErrorDetail(msrest.serialization.Model): :ivar target: The error target. :vartype target: str :ivar details: The error details. - :vartype details: list[~azure.mgmt.hybridkubernetes.models.ErrorDetail] + :vartype details: list[~connected_kubernetes_client.models.ErrorDetail] :ivar additional_info: The error additional info. - :vartype additional_info: list[~azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo] + :vartype additional_info: list[~connected_kubernetes_client.models.ErrorAdditionalInfo] """ _validation = { @@ -555,7 +401,7 @@ class ErrorResponse(msrest.serialization.Model): """Common error response for all Azure Resource Manager APIs to return error details for failed operations. (This also follows the OData error response format.). :param error: The error object. - :type error: ~azure.mgmt.hybridkubernetes.models.ErrorDetail + :type error: ~connected_kubernetes_client.models.ErrorDetail """ _attribute_map = { @@ -572,46 +418,6 @@ def __init__( self.error = error -class HybridConnectionConfig(msrest.serialization.Model): - """Contains the REP (rendezvous endpoint) and “Sender” access token. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar expiration_time: Timestamp when this token will be expired. - :vartype expiration_time: long - :ivar hybrid_connection_name: Name of the connection. - :vartype hybrid_connection_name: str - :ivar relay: Name of the relay. - :vartype relay: str - :ivar token: Sender access token. - :vartype token: str - """ - - _validation = { - 'expiration_time': {'readonly': True}, - 'hybrid_connection_name': {'readonly': True}, - 'relay': {'readonly': True}, - 'token': {'readonly': True}, - } - - _attribute_map = { - 'expiration_time': {'key': 'expirationTime', 'type': 'long'}, - 'hybrid_connection_name': {'key': 'hybridConnectionName', 'type': 'str'}, - 'relay': {'key': 'relay', 'type': 'str'}, - 'token': {'key': 'token', 'type': 'str'}, - } - - def __init__( - self, - **kwargs - ): - super(HybridConnectionConfig, self).__init__(**kwargs) - self.expiration_time = None - self.hybrid_connection_name = None - self.relay = None - self.token = None - - class Operation(msrest.serialization.Model): """The Connected cluster API operation. @@ -620,7 +426,7 @@ class Operation(msrest.serialization.Model): :ivar name: Operation name: {Microsoft.Kubernetes}/{resource}/{operation}. :vartype name: str :ivar display: The object that represents the operation. - :vartype display: ~azure.mgmt.hybridkubernetes.models.OperationDisplay + :vartype display: ~connected_kubernetes_client.models.OperationDisplay """ _validation = { @@ -684,7 +490,7 @@ class OperationList(msrest.serialization.Model): Variables are only populated by the server, and will be ignored when sending a request. :ivar value: The list of connected cluster API operations. - :vartype value: list[~azure.mgmt.hybridkubernetes.models.Operation] + :vartype value: list[~connected_kubernetes_client.models.Operation] :param next_link: The link to fetch the next page of connected cluster API operations. :type next_link: str """ @@ -707,3 +513,51 @@ def __init__( super(OperationList, self).__init__(**kwargs) self.value = None self.next_link = next_link + + +class SystemData(msrest.serialization.Model): + """Metadata pertaining to creation and last modification of the resource. + + :param created_by: The identity that created the resource. + :type created_by: str + :param created_by_type: The type of identity that created the resource. Possible values + include: "User", "Application", "ManagedIdentity", "Key". + :type created_by_type: str or ~connected_kubernetes_client.models.CreatedByType + :param created_at: The timestamp of resource creation (UTC). + :type created_at: ~datetime.datetime + :param last_modified_by: The identity that last modified the resource. + :type last_modified_by: str + :param last_modified_by_type: The type of identity that last modified the resource. Possible + values include: "User", "Application", "ManagedIdentity", "Key". + :type last_modified_by_type: str or ~connected_kubernetes_client.models.LastModifiedByType + :param last_modified_at: The timestamp of resource modification (UTC). + :type last_modified_at: ~datetime.datetime + """ + + _attribute_map = { + 'created_by': {'key': 'createdBy', 'type': 'str'}, + 'created_by_type': {'key': 'createdByType', 'type': 'str'}, + 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, + 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, + 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, + 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "LastModifiedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs + ): + super(SystemData, self).__init__(**kwargs) + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_connected_cluster_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_connected_cluster_operations.py index 94618ee551a6..9efeb126fead 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_connected_cluster_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_connected_cluster_operations.py @@ -32,7 +32,7 @@ class ConnectedClusterOperations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridkubernetes.models + :type models: ~connected_kubernetes_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -60,7 +60,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -91,7 +91,7 @@ def _create_initial( if response.status_code not in [200, 201]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if response.status_code == 200: @@ -124,15 +124,15 @@ def begin_create( :param cluster_name: The name of the Kubernetes cluster on which get is called. :type cluster_name: str :param connected_cluster: Parameters supplied to Create a Connected Cluster. - :type connected_cluster: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ConnectedCluster or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.hybridkubernetes.models.ConnectedCluster] + :rtype: ~azure.core.polling.LROPoller[~connected_kubernetes_client.models.ConnectedCluster] :raises ~azure.core.exceptions.HttpResponseError: """ polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] @@ -198,10 +198,10 @@ def update( :param cluster_name: The name of the Kubernetes cluster on which get is called. :type cluster_name: str :param connected_cluster_patch: Parameters supplied to update Connected Cluster. - :type connected_cluster_patch: ~azure.mgmt.hybridkubernetes.models.ConnectedClusterPatch + :type connected_cluster_patch: ~connected_kubernetes_client.models.ConnectedClusterPatch :keyword callable cls: A custom type or function that will be passed the direct response :return: ConnectedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :rtype: ~connected_kubernetes_client.models.ConnectedCluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"] @@ -209,7 +209,7 @@ def update( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -240,7 +240,7 @@ def update( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectedCluster', pipeline_response) @@ -269,7 +269,7 @@ def get( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: ConnectedCluster, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.models.ConnectedCluster + :rtype: ~connected_kubernetes_client.models.ConnectedCluster :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedCluster"] @@ -277,7 +277,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -303,7 +303,7 @@ def get( if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) deserialized = self._deserialize('ConnectedCluster', pipeline_response) @@ -326,7 +326,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" # Construct URL @@ -352,7 +352,7 @@ def _delete_initial( if response.status_code not in [200, 202, 204]: map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) if cls: @@ -377,8 +377,8 @@ 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: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy + :keyword polling: Pass in True if you'd like the ARMPolling polling method, + False for no polling, or your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -427,86 +427,6 @@ def get_long_running_output(pipeline_response): return LROPoller(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 - def list_cluster_user_credentials( - self, - resource_group_name, # type: str - cluster_name, # type: str - client_proxy=None, # type: Optional[bool] - client_authentication_details=None, # type: Optional["_models.AuthenticationDetails"] - **kwargs # type: Any - ): - # type: (...) -> "_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 client_proxy: Parameter to indicate whether the request is for client side proxy or not. - :type client_proxy: bool - :param client_authentication_details: Authentication parameters supplied by the user to fetch - credentials for accessing the cluster. - :type client_authentication_details: ~azure.mgmt.hybridkubernetes.models.AuthenticationDetails - :keyword callable cls: A custom type or function that will be passed the direct response - :return: CredentialResults, or the result of cls(response) - :rtype: ~azure.mgmt.hybridkubernetes.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 = "2020-01-01-preview" - content_type = kwargs.pop("content_type", "application/json") - accept = "application/json" - - # Construct URL - url = self.list_cluster_user_credentials.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\._\(\)]+$'), - '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') - if client_proxy is not None: - query_parameters['ClientProxy'] = self._serialize.query("client_proxy", client_proxy, 'bool') - - # 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] - if client_authentication_details is not None: - body_content = self._serialize.body(client_authentication_details, 'AuthenticationDetails') - else: - body_content = None - body_content_kwargs['content'] = body_content - request = self._client.post(url, query_parameters, header_parameters, **body_content_kwargs) - pipeline_response = 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(_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_credentials.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}/listClusterUserCredentials'} # type: ignore - def list_by_resource_group( self, resource_group_name, # type: str @@ -521,7 +441,7 @@ def list_by_resource_group( :type resource_group_name: str :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConnectedClusterList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridkubernetes.models.ConnectedClusterList] + :rtype: ~azure.core.paging.ItemPaged[~connected_kubernetes_client.models.ConnectedClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedClusterList"] @@ -529,7 +449,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -570,7 +490,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) @@ -592,7 +512,7 @@ def list_by_subscription( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either ConnectedClusterList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridkubernetes.models.ConnectedClusterList] + :rtype: ~azure.core.paging.ItemPaged[~connected_kubernetes_client.models.ConnectedClusterList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.ConnectedClusterList"] @@ -600,7 +520,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -640,7 +560,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py index 29e420a46c50..4effb139b9c8 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/azure/mgmt/hybridkubernetes/operations/_operations.py @@ -30,7 +30,7 @@ class Operations(object): instantiates it for you and attaches it as an attribute. :ivar models: Alias to model classes used in this operation group. - :type models: ~azure.mgmt.hybridkubernetes.models + :type models: ~connected_kubernetes_client.models :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. @@ -54,7 +54,7 @@ def get( :keyword callable cls: A custom type or function that will be passed the direct response :return: An iterator like instance of either OperationList or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.hybridkubernetes.models.OperationList] + :rtype: ~azure.core.paging.ItemPaged[~connected_kubernetes_client.models.OperationList] :raises: ~azure.core.exceptions.HttpResponseError """ cls = kwargs.pop('cls', None) # type: ClsType["_models.OperationList"] @@ -62,7 +62,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2020-01-01-preview" + api_version = "2021-03-01" accept = "application/json" def prepare_request(next_link=None): @@ -98,7 +98,7 @@ def get_next(next_link=None): response = pipeline_response.http_response if response.status_code not in [200]: - error = self._deserialize(_models.ErrorResponse, response) + error = self._deserialize.failsafe_deserialize(_models.ErrorResponse, response) map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)