From 2fece93a71c43e714adf556089123463e07c516c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 19 Apr 2019 20:49:00 +0000 Subject: [PATCH 1/2] Generated from f87a1c29f22babb87d8ffab03c220b882522317c Fix readmes for SDK --- .../devspaces/dev_spaces_management_client.py | 2 +- .../azure/mgmt/devspaces/models/__init__.py | 3 ++ .../models/controller_connection_details.py | 11 ------ .../controller_connection_details_py3.py | 11 ------ .../list_connection_details_parameters.py | 36 +++++++++++++++++++ .../list_connection_details_parameters_py3.py | 36 +++++++++++++++++++ .../container_host_mappings_operations.py | 21 ++++++----- .../operations/controllers_operations.py | 17 ++++++--- .../mgmt/devspaces/operations/operations.py | 4 +-- 9 files changed, 101 insertions(+), 40 deletions(-) create mode 100644 azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters.py create mode 100644 azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters_py3.py diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py index 1bcdf2000675..8fab3db5da41 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/dev_spaces_management_client.py @@ -79,7 +79,7 @@ def __init__( super(DevSpacesManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-01-01-preview' + self.api_version = '2019-04-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py index 29ebb50efec5..6d70e1eb0cb1 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/__init__.py @@ -17,6 +17,7 @@ from .sku_py3 import Sku from .controller_py3 import Controller from .controller_update_parameters_py3 import ControllerUpdateParameters + from .list_connection_details_parameters_py3 import ListConnectionDetailsParameters from .orchestrator_specific_connection_details_py3 import OrchestratorSpecificConnectionDetails from .controller_connection_details_py3 import ControllerConnectionDetails from .controller_connection_details_list_py3 import ControllerConnectionDetailsList @@ -32,6 +33,7 @@ from .sku import Sku from .controller import Controller from .controller_update_parameters import ControllerUpdateParameters + from .list_connection_details_parameters import ListConnectionDetailsParameters from .orchestrator_specific_connection_details import OrchestratorSpecificConnectionDetails from .controller_connection_details import ControllerConnectionDetails from .controller_connection_details_list import ControllerConnectionDetailsList @@ -54,6 +56,7 @@ 'Sku', 'Controller', 'ControllerUpdateParameters', + 'ListConnectionDetailsParameters', 'OrchestratorSpecificConnectionDetails', 'ControllerConnectionDetails', 'ControllerConnectionDetailsList', diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py index f4b047bdb8c1..9cede3fd6c76 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details.py @@ -15,26 +15,15 @@ class ControllerConnectionDetails(Model): """ControllerConnectionDetails. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar auth_key: Authentication key for communicating with services. - :vartype auth_key: str :param orchestrator_specific_connection_details: :type orchestrator_specific_connection_details: ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails """ - _validation = { - 'auth_key': {'readonly': True}, - } - _attribute_map = { - 'auth_key': {'key': 'authKey', 'type': 'str'}, 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, } def __init__(self, **kwargs): super(ControllerConnectionDetails, self).__init__(**kwargs) - self.auth_key = None self.orchestrator_specific_connection_details = kwargs.get('orchestrator_specific_connection_details', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py index 0142e5ca18a2..c63644e8d743 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/controller_connection_details_py3.py @@ -15,26 +15,15 @@ class ControllerConnectionDetails(Model): """ControllerConnectionDetails. - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar auth_key: Authentication key for communicating with services. - :vartype auth_key: str :param orchestrator_specific_connection_details: :type orchestrator_specific_connection_details: ~azure.mgmt.devspaces.models.OrchestratorSpecificConnectionDetails """ - _validation = { - 'auth_key': {'readonly': True}, - } - _attribute_map = { - 'auth_key': {'key': 'authKey', 'type': 'str'}, 'orchestrator_specific_connection_details': {'key': 'orchestratorSpecificConnectionDetails', 'type': 'OrchestratorSpecificConnectionDetails'}, } def __init__(self, *, orchestrator_specific_connection_details=None, **kwargs) -> None: super(ControllerConnectionDetails, self).__init__(**kwargs) - self.auth_key = None self.orchestrator_specific_connection_details = orchestrator_specific_connection_details diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters.py new file mode 100644 index 000000000000..8aa1a6556b5a --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListConnectionDetailsParameters(Model): + """Parameters for listing connection details of an Azure Dev Spaces + Controller. + + All required parameters must be populated in order to send to Azure. + + :param target_container_host_resource_id: Required. Resource ID of the + target container host mapped to the Azure Dev Spaces Controller. + :type target_container_host_resource_id: str + """ + + _validation = { + 'target_container_host_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_container_host_resource_id': {'key': 'targetContainerHostResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ListConnectionDetailsParameters, self).__init__(**kwargs) + self.target_container_host_resource_id = kwargs.get('target_container_host_resource_id', None) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters_py3.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters_py3.py new file mode 100644 index 000000000000..1ec148d8c07f --- /dev/null +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/models/list_connection_details_parameters_py3.py @@ -0,0 +1,36 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class ListConnectionDetailsParameters(Model): + """Parameters for listing connection details of an Azure Dev Spaces + Controller. + + All required parameters must be populated in order to send to Azure. + + :param target_container_host_resource_id: Required. Resource ID of the + target container host mapped to the Azure Dev Spaces Controller. + :type target_container_host_resource_id: str + """ + + _validation = { + 'target_container_host_resource_id': {'required': True}, + } + + _attribute_map = { + 'target_container_host_resource_id': {'key': 'targetContainerHostResourceId', 'type': 'str'}, + } + + def __init__(self, *, target_container_host_resource_id: str, **kwargs) -> None: + super(ListConnectionDetailsParameters, self).__init__(**kwargs) + self.target_container_host_resource_id = target_container_host_resource_id diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py index 9b028219786f..376194681f07 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/container_host_mappings_operations.py @@ -11,7 +11,6 @@ import uuid from msrest.pipeline import ClientRawResponse -from msrestazure.azure_exceptions import CloudError from .. import models @@ -23,7 +22,7 @@ class ContainerHostMappingsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-01-01-preview". + :ivar api_version: Client API version. Constant value: "2019-04-01". """ models = models @@ -33,7 +32,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01-preview" + self.api_version = "2019-04-01" self.config = config @@ -55,9 +54,11 @@ def get_container_host_mapping( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: object or ClientRawResponse if raw=true - :rtype: object or ~msrest.pipeline.ClientRawResponse - :raises: :class:`CloudError` + :return: ContainerHostMapping or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.devspaces.models.ContainerHostMapping or + ~msrest.pipeline.ClientRawResponse + :raises: + :class:`ErrorResponseException` """ container_host_mapping = models.ContainerHostMapping(container_host_resource_id=container_host_resource_id) @@ -92,15 +93,13 @@ def get_container_host_mapping( 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]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp + if response.status_code not in [200, 204]: + raise models.ErrorResponseException(self._deserialize, response) deserialized = None if response.status_code == 200: - deserialized = self._deserialize('object', response) + deserialized = self._deserialize('ContainerHostMapping', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py index 69932a6afc72..7c8f39c220c2 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/controllers_operations.py @@ -24,7 +24,7 @@ class ControllersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-01-01-preview". + :ivar api_version: Client API version. Constant value: "2019-04-01". """ models = models @@ -34,7 +34,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01-preview" + self.api_version = "2019-04-01" self.config = config @@ -498,7 +498,7 @@ def internal_paging(next_link=None, raw=False): list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DevSpaces/controllers'} def list_connection_details( - self, resource_group_name, name, custom_headers=None, raw=False, **operation_config): + self, resource_group_name, name, target_container_host_resource_id, custom_headers=None, raw=False, **operation_config): """Lists connection details for an Azure Dev Spaces Controller. Lists connection details for the underlying container resources of an @@ -509,6 +509,9 @@ def list_connection_details( :type resource_group_name: str :param name: Name of the resource. :type name: str + :param target_container_host_resource_id: Resource ID of the target + container host mapped to the Azure Dev Spaces Controller. + :type target_container_host_resource_id: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -521,6 +524,8 @@ def list_connection_details( :raises: :class:`ErrorResponseException` """ + list_connection_details_parameters = models.ListConnectionDetailsParameters(target_container_host_resource_id=target_container_host_resource_id) + # Construct URL url = self.list_connection_details.metadata['url'] path_format_arguments = { @@ -537,6 +542,7 @@ def list_connection_details( # 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: @@ -544,8 +550,11 @@ def list_connection_details( 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 + body_content = self._serialize.body(list_connection_details_parameters, 'ListConnectionDetailsParameters') + # 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]: diff --git a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py index 58f75ea20ce0..5e3a4646b0f3 100644 --- a/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py +++ b/azure-mgmt-devspaces/azure/mgmt/devspaces/operations/operations.py @@ -23,7 +23,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: Client API version. Constant value: "2019-01-01-preview". + :ivar api_version: Client API version. Constant value: "2019-04-01". """ models = models @@ -33,7 +33,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-01-01-preview" + self.api_version = "2019-04-01" self.config = config From d2abd7873e4cfc1e7598979a960df9cbc7f3346d Mon Sep 17 00:00:00 2001 From: azuresdkci Date: Fri, 19 Apr 2019 20:52:13 +0000 Subject: [PATCH 2/2] Packaging update of azure-mgmt-devspaces --- azure-mgmt-devspaces/MANIFEST.in | 1 + azure-mgmt-devspaces/README.rst | 22 +++------------------- azure-mgmt-devspaces/setup.py | 1 + 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/azure-mgmt-devspaces/MANIFEST.in b/azure-mgmt-devspaces/MANIFEST.in index 6ceb27f7a96e..e4884efef41b 100644 --- a/azure-mgmt-devspaces/MANIFEST.in +++ b/azure-mgmt-devspaces/MANIFEST.in @@ -1,3 +1,4 @@ +recursive-include tests *.py *.yaml include *.rst include azure/__init__.py include azure/mgmt/__init__.py diff --git a/azure-mgmt-devspaces/README.rst b/azure-mgmt-devspaces/README.rst index 35519a6e0ce0..0aa99b07538f 100644 --- a/azure-mgmt-devspaces/README.rst +++ b/azure-mgmt-devspaces/README.rst @@ -14,25 +14,6 @@ For the older Azure Service Management (ASM) libraries, see For a more complete set of Azure libraries, see the `azure `__ bundle package. -Compatibility -============= - -**IMPORTANT**: If you have an earlier version of the azure package -(version < 1.0), you should uninstall it before installing this package. - -You can check the version using pip: - -.. code:: shell - - pip freeze - -If you see azure==0.11.0 (or any version below 1.0), uninstall it first: - -.. code:: shell - - pip uninstall azure - - Usage ===== @@ -47,3 +28,6 @@ Provide Feedback If you encounter any bugs or have suggestions, please file an issue in the `Issues `__ section of the project. + + +.. image:: https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-devspaces%2FREADME.png diff --git a/azure-mgmt-devspaces/setup.py b/azure-mgmt-devspaces/setup.py index e14033a3af4b..c8d968227ee5 100644 --- a/azure-mgmt-devspaces/setup.py +++ b/azure-mgmt-devspaces/setup.py @@ -53,6 +53,7 @@ version=version, description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME), long_description=readme + '\n\n' + history, + long_description_content_type='text/x-rst', license='MIT License', author='Microsoft Corporation', author_email='azpysdkhelp@microsoft.com',