diff --git a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md index b8b533f4ba3c..c4de97ec00cc 100644 --- a/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md +++ b/sdk/hybridkubernetes/azure-mgmt-hybridkubernetes/README.md @@ -4,6 +4,13 @@ This is the Microsoft Azure HybridKubernetes Management Client Library. This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8. For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all). + +# Usage + +For code examples, see [HybridKubernetes Management](https://docs.microsoft.com/python/api/overview/azure/hybrid-kubernetes) +on docs.microsoft.com. + + # Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the 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 b6b8458a7602..d9615504d3fa 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 @@ -10,6 +10,8 @@ # -------------------------------------------------------------------------- try: + from ._models_py3 import AuthenticationDetails + from ._models_py3 import AuthenticationDetailsValue from ._models_py3 import AzureEntityResource from ._models_py3 import ConnectedCluster from ._models_py3 import ConnectedClusterAADProfile @@ -17,14 +19,17 @@ from ._models_py3 import ConnectedClusterPatch from ._models_py3 import CredentialResult from ._models_py3 import CredentialResults - from ._models_py3 import ErrorDetails + from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorResponse, ErrorResponseException + from ._models_py3 import ErrorResponseError from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import ProxyResource from ._models_py3 import Resource from ._models_py3 import TrackedResource except (SyntaxError, ImportError): + from ._models import AuthenticationDetails + from ._models import AuthenticationDetailsValue from ._models import AzureEntityResource from ._models import ConnectedCluster from ._models import ConnectedClusterAADProfile @@ -32,8 +37,9 @@ from ._models import ConnectedClusterPatch from ._models import CredentialResult from ._models import CredentialResults - from ._models import ErrorDetails + from ._models import ErrorAdditionalInfo from ._models import ErrorResponse, ErrorResponseException + from ._models import ErrorResponseError from ._models import Operation from ._models import OperationDisplay from ._models import ProxyResource @@ -47,6 +53,8 @@ ) __all__ = [ + 'AuthenticationDetails', + 'AuthenticationDetailsValue', 'AzureEntityResource', 'ConnectedCluster', 'ConnectedClusterAADProfile', @@ -54,8 +62,9 @@ 'ConnectedClusterPatch', 'CredentialResult', 'CredentialResults', - 'ErrorDetails', + 'ErrorAdditionalInfo', 'ErrorResponse', 'ErrorResponseException', + 'ErrorResponseError', 'Operation', 'OperationDisplay', 'ProxyResource', 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 492f353d8bcc..69dec28e24ab 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 @@ -13,8 +13,57 @@ from msrest.exceptions import HttpOperationError +class AuthenticationDetails(Model): + """Authentication details of the user. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar authentication_method: Required. The mode of client authentication. + Default value: "Token" . + :vartype authentication_method: str + :param value: Required. Authentication token value. + :type value: + ~azure.mgmt.hybridkubernetes.models.AuthenticationDetailsValue + """ + + _validation = { + 'authentication_method': {'required': True, 'constant': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'AuthenticationDetailsValue'}, + } + + authentication_method = "Token" + + def __init__(self, **kwargs): + super(AuthenticationDetails, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class AuthenticationDetailsValue(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(Model): - """Resource. + """The resource model definition for a ARM tracked top level resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -164,7 +213,7 @@ class ConnectedCluster(TrackedResource): 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. + :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 @@ -176,8 +225,9 @@ class ConnectedCluster(TrackedResource): :ivar agent_version: Version of the agent running on the connected cluster resource :vartype agent_version: str - :param provisioning_state: Possible values include: 'Succeeded', 'Failed', - 'Canceled', 'Provisioning', 'Updating', 'Deleting', 'Accepted' + :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 """ @@ -222,7 +272,7 @@ def __init__(self, **kwargs): class ConnectedClusterAADProfile(Model): - """ConnectedClusterAADProfile. + """AAD profile of the connected cluster. All required parameters must be populated in order to send to Azure. @@ -370,43 +420,43 @@ def __init__(self, **kwargs): self.kubeconfigs = None -class ErrorDetails(Model): - """The error response details containing error code and error message. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'type': {'readonly': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__(self, **kwargs): - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.message = None + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None class ErrorResponse(Model): - """The error response that indicates why an operation has failed. + """The resource management error response. - :param error: - :type error: ~azure.mgmt.hybridkubernetes.models.ErrorDetails + :param error: The error object. + :type error: ~azure.mgmt.hybridkubernetes.models.ErrorResponseError """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, } def __init__(self, **kwargs): @@ -426,6 +476,50 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.hybridkubernetes.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Operation(Model): """The Connected cluster API operation. 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 e31f6f78bae0..ba7eb9df1410 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 @@ -13,8 +13,57 @@ from msrest.exceptions import HttpOperationError +class AuthenticationDetails(Model): + """Authentication details of the user. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar authentication_method: Required. The mode of client authentication. + Default value: "Token" . + :vartype authentication_method: str + :param value: Required. Authentication token value. + :type value: + ~azure.mgmt.hybridkubernetes.models.AuthenticationDetailsValue + """ + + _validation = { + 'authentication_method': {'required': True, 'constant': True}, + 'value': {'required': True}, + } + + _attribute_map = { + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'value': {'key': 'value', 'type': 'AuthenticationDetailsValue'}, + } + + authentication_method = "Token" + + def __init__(self, *, value, **kwargs) -> None: + super(AuthenticationDetails, self).__init__(**kwargs) + self.value = value + + +class AuthenticationDetailsValue(Model): + """Authentication token value. + + :param token: Authentication token. + :type token: str + """ + + _attribute_map = { + 'token': {'key': 'token', 'type': 'str'}, + } + + def __init__(self, *, token: str=None, **kwargs) -> None: + super(AuthenticationDetailsValue, self).__init__(**kwargs) + self.token = token + + class Resource(Model): - """Resource. + """The resource model definition for a ARM tracked top level resource. Variables are only populated by the server, and will be ignored when sending a request. @@ -164,7 +213,7 @@ class ConnectedCluster(TrackedResource): 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. + :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 @@ -176,8 +225,9 @@ class ConnectedCluster(TrackedResource): :ivar agent_version: Version of the agent running on the connected cluster resource :vartype agent_version: str - :param provisioning_state: Possible values include: 'Succeeded', 'Failed', - 'Canceled', 'Provisioning', 'Updating', 'Deleting', 'Accepted' + :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 """ @@ -222,7 +272,7 @@ def __init__(self, *, location: str, identity, agent_public_key_certificate: str class ConnectedClusterAADProfile(Model): - """ConnectedClusterAADProfile. + """AAD profile of the connected cluster. All required parameters must be populated in order to send to Azure. @@ -370,43 +420,43 @@ def __init__(self, **kwargs) -> None: self.kubeconfigs = None -class ErrorDetails(Model): - """The error response details containing error code and error message. +class ErrorAdditionalInfo(Model): + """The resource management error additional info. Variables are only populated by the server, and will be ignored when sending a request. - :ivar code: The error code. - :vartype code: str - :ivar message: The error message. - :vartype message: str + :ivar type: The additional info type. + :vartype type: str + :ivar info: The additional info. + :vartype info: object """ _validation = { - 'code': {'readonly': True}, - 'message': {'readonly': True}, + 'type': {'readonly': True}, + 'info': {'readonly': True}, } _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'object'}, } def __init__(self, **kwargs) -> None: - super(ErrorDetails, self).__init__(**kwargs) - self.code = None - self.message = None + super(ErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None class ErrorResponse(Model): - """The error response that indicates why an operation has failed. + """The resource management error response. - :param error: - :type error: ~azure.mgmt.hybridkubernetes.models.ErrorDetails + :param error: The error object. + :type error: ~azure.mgmt.hybridkubernetes.models.ErrorResponseError """ _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorDetails'}, + 'error': {'key': 'error', 'type': 'ErrorResponseError'}, } def __init__(self, *, error=None, **kwargs) -> None: @@ -426,6 +476,50 @@ def __init__(self, deserialize, response, *args): super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args) +class ErrorResponseError(Model): + """The error object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar target: The error target. + :vartype target: str + :ivar details: The error details. + :vartype details: list[~azure.mgmt.hybridkubernetes.models.ErrorResponse] + :ivar additional_info: The error additional info. + :vartype additional_info: + list[~azure.mgmt.hybridkubernetes.models.ErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[ErrorResponse]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[ErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(ErrorResponseError, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + self.additional_info = None + + class Operation(Model): """The Connected cluster API operation. 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 5629cc7b43ea..796dc7da51e6 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 @@ -373,7 +373,7 @@ def get_long_running_output(response): delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Kubernetes/connectedClusters/{clusterName}'} def list_cluster_user_credentials( - self, resource_group_name, cluster_name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, cluster_name, value, custom_headers=None, raw=False, **operation_config): """Gets cluster user credentials of a connected cluster. Gets cluster user credentials of the connected cluster with a specified @@ -385,6 +385,9 @@ def list_cluster_user_credentials( :param cluster_name: The name of the Kubernetes cluster on which get is called. :type cluster_name: str + :param value: Authentication token value. + :type value: + ~azure.mgmt.hybridkubernetes.models.AuthenticationDetailsValue :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -396,6 +399,10 @@ def list_cluster_user_credentials( :raises: :class:`ErrorResponseException` """ + client_authentication_details = None + if value is not None: + client_authentication_details = models.AuthenticationDetails(value=value) + # Construct URL url = self.list_cluster_user_credentials.metadata['url'] path_format_arguments = { @@ -412,6 +419,7 @@ def list_cluster_user_credentials( # Construct headers header_parameters = {} header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' if self.config.generate_client_request_id: header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) if custom_headers: @@ -419,8 +427,14 @@ def list_cluster_user_credentials( if self.config.accept_language is not None: header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + # Construct body + if client_authentication_details is not None: + body_content = self._serialize.body(client_authentication_details, 'AuthenticationDetails') + else: + body_content = None + # Construct and send request - request = self._client.post(url, query_parameters, header_parameters) + request = self._client.post(url, query_parameters, header_parameters, body_content) response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: