diff --git a/sdk/iothub/azure-mgmt-iotcentral/CHANGELOG.md b/sdk/iothub/azure-mgmt-iotcentral/CHANGELOG.md index 483f9a23ef99..9cd268f3fbb4 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/CHANGELOG.md +++ b/sdk/iothub/azure-mgmt-iotcentral/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 3.0.0 (2020-03-09) + +**Breaking changes** + +- Removed operation AppsOperations.list_templates + ## 2.0.0 (2019-12-25) **Features** diff --git a/sdk/iothub/azure-mgmt-iotcentral/README.md b/sdk/iothub/azure-mgmt-iotcentral/README.md index 57711b63d701..4a2c0b7292bf 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/README.md +++ b/sdk/iothub/azure-mgmt-iotcentral/README.md @@ -1,29 +1,21 @@ -## Microsoft Azure SDK for Python +# Microsoft Azure SDK for Python This is the Microsoft Azure IoTCentral Management Client Library. - -Azure Resource Manager (ARM) is the next generation of management APIs -that replace the old Azure Service Management (ASM). - 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 [Github repo](https://github.com/Azure/azure-sdk-for-python/sdk) -For the older Azure Service Management (ASM) libraries, see -[azure-servicemanagement-legacy](https://pypi.python.org/pypi/azure-servicemanagement-legacy) -library. -For a more complete set of Azure libraries, see the -[azure](https://pypi.python.org/pypi/azure) bundle package. +# Usage -## Usage +For code examples, see [IoTCentral Management](https://docs.microsoft.com/python/api/overview/azure/) +on docs.microsoft.com. -For code examples, see [IoTCentral -Management](https://docs.microsoft.com/python/api/overview/azure/) on -docs.microsoft.com. -## Provide Feedback +# Provide Feedback -If you encounter any bugs or have suggestions, please file an issue in -the [Issues](https://github.com/Azure/azure-sdk-for-python/issues) +If you encounter any bugs or have suggestions, please file an issue in the +[Issues](https://github.com/Azure/azure-sdk-for-python/issues) section of the project. -![image](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iotcentral%2FREADME.png) + +![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-iotcentral%2FREADME.png) diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py index ee902bf65a30..f352527b5348 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/__init__.py @@ -15,8 +15,7 @@ from ._models_py3 import AppPatch from ._models_py3 import AppSkuInfo from ._models_py3 import AppTemplate - from ._models_py3 import ErrorDetails, ErrorDetailsException - from ._models_py3 import ErrorResponseBody + from ._models_py3 import CloudErrorBody from ._models_py3 import Operation from ._models_py3 import OperationDisplay from ._models_py3 import OperationInputs @@ -27,8 +26,7 @@ from ._models import AppPatch from ._models import AppSkuInfo from ._models import AppTemplate - from ._models import ErrorDetails, ErrorDetailsException - from ._models import ErrorResponseBody + from ._models import CloudErrorBody from ._models import Operation from ._models import OperationDisplay from ._models import OperationInputs @@ -46,8 +44,7 @@ 'AppPatch', 'AppSkuInfo', 'AppTemplate', - 'ErrorDetails', 'ErrorDetailsException', - 'ErrorResponseBody', + 'CloudErrorBody', 'Operation', 'OperationDisplay', 'OperationInputs', diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models.py index 00700f06a6ee..0ab6e3d4113e 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models.py @@ -96,8 +96,6 @@ class App(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'application_id': {'readonly': True}, - 'display_name': {'pattern': r'^.{1,200}$'}, - 'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'}, 'sku': {'required': True}, } @@ -181,8 +179,6 @@ class AppPatch(Model): _validation = { 'application_id': {'readonly': True}, - 'display_name': {'pattern': r'^.{1,200}$'}, - 'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'}, } _attribute_map = { @@ -274,14 +270,6 @@ def __init__(self, **kwargs): class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ErrorDetails(Model): """Error details. Variables are only populated by the server, and will be ignored when @@ -294,7 +282,7 @@ class ErrorDetails(Model): :ivar target: The target of the particular error. :vartype target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody] + :type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody] """ _validation = { @@ -307,19 +295,19 @@ class ErrorDetails(Model): 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, 'target': {'key': 'error.target', 'type': 'str'}, - 'details': {'key': 'error.details', 'type': '[ErrorResponseBody]'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, } def __init__(self, **kwargs): - super(ErrorDetails, self).__init__(**kwargs) + super(CloudError, self).__init__(**kwargs) self.code = None self.message = None self.target = None self.details = kwargs.get('details', None) -class ErrorDetailsException(HttpOperationError): - """Server responsed with exception of type: 'ErrorDetails'. +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -327,10 +315,10 @@ class ErrorDetailsException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class ErrorResponseBody(Model): +class CloudErrorBody(Model): """Details of error response. Variables are only populated by the server, and will be ignored when @@ -343,7 +331,7 @@ class ErrorResponseBody(Model): :ivar target: The target of the particular error. :vartype target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody] + :type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody] """ _validation = { @@ -356,11 +344,11 @@ class ErrorResponseBody(Model): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } def __init__(self, **kwargs): - super(ErrorResponseBody, self).__init__(**kwargs) + super(CloudErrorBody, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -447,7 +435,7 @@ class OperationInputs(Model): """ _validation = { - 'name': {'required': True, 'pattern': r'^[a-z0-9-]{1,63}$'}, + 'name': {'required': True}, } _attribute_map = { diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models_py3.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models_py3.py index f7bd00d8b6bb..603a076e9104 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models_py3.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/models/_models_py3.py @@ -96,8 +96,6 @@ class App(Resource): 'type': {'readonly': True}, 'location': {'required': True}, 'application_id': {'readonly': True}, - 'display_name': {'pattern': r'^.{1,200}$'}, - 'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'}, 'sku': {'required': True}, } @@ -181,8 +179,6 @@ class AppPatch(Model): _validation = { 'application_id': {'readonly': True}, - 'display_name': {'pattern': r'^.{1,200}$'}, - 'subdomain': {'pattern': r'^[a-z0-9-]{1,63}$'}, } _attribute_map = { @@ -274,14 +270,6 @@ def __init__(self, **kwargs) -> None: class CloudError(Model): - """CloudError. - """ - - _attribute_map = { - } - - -class ErrorDetails(Model): """Error details. Variables are only populated by the server, and will be ignored when @@ -294,7 +282,7 @@ class ErrorDetails(Model): :ivar target: The target of the particular error. :vartype target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody] + :type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody] """ _validation = { @@ -307,19 +295,19 @@ class ErrorDetails(Model): 'code': {'key': 'error.code', 'type': 'str'}, 'message': {'key': 'error.message', 'type': 'str'}, 'target': {'key': 'error.target', 'type': 'str'}, - 'details': {'key': 'error.details', 'type': '[ErrorResponseBody]'}, + 'details': {'key': 'error.details', 'type': '[CloudErrorBody]'}, } def __init__(self, *, details=None, **kwargs) -> None: - super(ErrorDetails, self).__init__(**kwargs) + super(CloudError, self).__init__(**kwargs) self.code = None self.message = None self.target = None self.details = details -class ErrorDetailsException(HttpOperationError): - """Server responsed with exception of type: 'ErrorDetails'. +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. :param deserialize: A deserializer :param response: Server response to be deserialized. @@ -327,10 +315,10 @@ class ErrorDetailsException(HttpOperationError): def __init__(self, deserialize, response, *args): - super(ErrorDetailsException, self).__init__(deserialize, response, 'ErrorDetails', *args) + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) -class ErrorResponseBody(Model): +class CloudErrorBody(Model): """Details of error response. Variables are only populated by the server, and will be ignored when @@ -343,7 +331,7 @@ class ErrorResponseBody(Model): :ivar target: The target of the particular error. :vartype target: str :param details: A list of additional details about the error. - :type details: list[~azure.mgmt.iotcentral.models.ErrorResponseBody] + :type details: list[~azure.mgmt.iotcentral.models.CloudErrorBody] """ _validation = { @@ -356,11 +344,11 @@ class ErrorResponseBody(Model): 'code': {'key': 'code', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, - 'details': {'key': 'details', 'type': '[ErrorResponseBody]'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, } def __init__(self, *, details=None, **kwargs) -> None: - super(ErrorResponseBody, self).__init__(**kwargs) + super(CloudErrorBody, self).__init__(**kwargs) self.code = None self.message = None self.target = None @@ -447,7 +435,7 @@ class OperationInputs(Model): """ _validation = { - 'name': {'required': True, 'pattern': r'^[a-z0-9-]{1,63}$'}, + 'name': {'required': True}, } _attribute_map = { diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_apps_operations.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_apps_operations.py index 086d87e57451..2a7579673e9b 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_apps_operations.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_apps_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling @@ -58,8 +59,7 @@ def get( :return: App or ClientRawResponse if raw=true :rtype: ~azure.mgmt.iotcentral.models.App or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ # Construct URL url = self.get.metadata['url'] @@ -89,7 +89,9 @@ def get( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -137,7 +139,9 @@ def _create_or_update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 201, 202]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -179,8 +183,7 @@ def create_or_update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iotcentral.models.App] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iotcentral.models.App]] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ raw_result = self._create_or_update_initial( resource_group_name=resource_group_name, @@ -244,7 +247,9 @@ def _update_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None @@ -281,8 +286,7 @@ def update( ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.iotcentral.models.App] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.iotcentral.models.App]] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ raw_result = self._update_initial( resource_group_name=resource_group_name, @@ -341,7 +345,9 @@ def _delete_initial( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200, 202, 204]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp if raw: client_raw_response = ClientRawResponse(None, response) @@ -366,8 +372,7 @@ def delete( ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ raw_result = self._delete_initial( resource_group_name=resource_group_name, @@ -403,8 +408,7 @@ def list_by_subscription( :return: An iterator like instance of App :rtype: ~azure.mgmt.iotcentral.models.AppPaged[~azure.mgmt.iotcentral.models.App] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -443,7 +447,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -471,8 +477,7 @@ def list_by_resource_group( :return: An iterator like instance of App :rtype: ~azure.mgmt.iotcentral.models.AppPaged[~azure.mgmt.iotcentral.models.App] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -512,7 +517,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response @@ -542,8 +549,7 @@ def check_name_availability( :return: AppAvailabilityInfo or ClientRawResponse if raw=true :rtype: ~azure.mgmt.iotcentral.models.AppAvailabilityInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ operation_inputs = models.OperationInputs(name=name, type=type) @@ -577,7 +583,9 @@ def check_name_availability( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -607,8 +615,7 @@ def check_subdomain_availability( :return: AppAvailabilityInfo or ClientRawResponse if raw=true :rtype: ~azure.mgmt.iotcentral.models.AppAvailabilityInfo or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ operation_inputs = models.OperationInputs(name=name, type=type) @@ -642,7 +649,9 @@ def check_subdomain_availability( response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp deserialized = None if response.status_code == 200: @@ -667,8 +676,7 @@ def list_templates( :return: An iterator like instance of AppTemplate :rtype: ~azure.mgmt.iotcentral.models.AppTemplatePaged[~azure.mgmt.iotcentral.models.AppTemplate] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -707,7 +715,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_operations.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_operations.py index c8c90e368a44..764115f4f92d 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_operations.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/operations/_operations.py @@ -11,6 +11,7 @@ import uuid from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError from .. import models @@ -50,8 +51,7 @@ def list( :return: An iterator like instance of Operation :rtype: ~azure.mgmt.iotcentral.models.OperationPaged[~azure.mgmt.iotcentral.models.Operation] - :raises: - :class:`ErrorDetailsException` + :raises: :class:`CloudError` """ def prepare_request(next_link=None): if not next_link: @@ -86,7 +86,9 @@ def internal_paging(next_link=None): response = self._client.send(request, stream=False, **operation_config) if response.status_code not in [200]: - raise models.ErrorDetailsException(self._deserialize, response) + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp return response diff --git a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py index 53c4c7ea05e8..7f225c6aab41 100644 --- a/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py +++ b/sdk/iothub/azure-mgmt-iotcentral/azure/mgmt/iotcentral/version.py @@ -9,5 +9,5 @@ # regenerated. # -------------------------------------------------------------------------- -VERSION = "2.0.0" +VERSION = "3.0.0"