From ce64afd073a910380b140cc89c9670a0c920fc6d Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 29 Oct 2020 06:26:03 +0000 Subject: [PATCH] Generated from 00867e23eb2ef11b82341b5c0894acb104583e9c --- .../azure/mgmt/advisor/models/_models.py | 5 +++++ .../azure/mgmt/advisor/models/_models_py3.py | 5 +++++ .../advisor/operations/_recommendations_operations.py | 6 +++++- .../mgmt/advisor/operations/_suppressions_operations.py | 9 +++++---- sdk/advisor/azure-mgmt-advisor/setup.py | 4 +++- 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py index f9a772563e1f..a9f2d6865224 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py @@ -444,12 +444,15 @@ class SuppressionContract(Resource): :type suppression_id: str :param ttl: The duration for which the suppression is valid. :type ttl: str + :ivar expiration_time_stamp: Gets or sets the expiration time stamp. + :vartype expiration_time_stamp: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'expiration_time_stamp': {'readonly': True}, } _attribute_map = { @@ -458,9 +461,11 @@ class SuppressionContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + 'expiration_time_stamp': {'key': 'properties.expirationTimeStamp', 'type': 'iso-8601'}, } def __init__(self, **kwargs): super(SuppressionContract, self).__init__(**kwargs) self.suppression_id = kwargs.get('suppression_id', None) self.ttl = kwargs.get('ttl', None) + self.expiration_time_stamp = None diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py index f9115380f584..d137dbb9263e 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models_py3.py @@ -444,12 +444,15 @@ class SuppressionContract(Resource): :type suppression_id: str :param ttl: The duration for which the suppression is valid. :type ttl: str + :ivar expiration_time_stamp: Gets or sets the expiration time stamp. + :vartype expiration_time_stamp: datetime """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'expiration_time_stamp': {'readonly': True}, } _attribute_map = { @@ -458,9 +461,11 @@ class SuppressionContract(Resource): 'type': {'key': 'type', 'type': 'str'}, 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + 'expiration_time_stamp': {'key': 'properties.expirationTimeStamp', 'type': 'iso-8601'}, } def __init__(self, *, suppression_id: str=None, ttl: str=None, **kwargs) -> None: super(SuppressionContract, self).__init__(**kwargs) self.suppression_id = suppression_id self.ttl = ttl + self.expiration_time_stamp = None diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py index 600cd2c43ff7..b618296ec639 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_recommendations_operations.py @@ -151,7 +151,11 @@ def list( """Obtains cached recommendations for a subscription. The recommendations are generated or computed by invoking generateRecommendations. - :param filter: The filter to apply to the recommendations. + :param filter: The filter to apply to the recommendations.
Filter + can be applied to properties ['ResourceId', 'ResourceGroup', + 'RecommendationTypeGuid', '[Category](#category)'] with operators + ['eq', 'and', 'or'].
Example:
- $filter=Category eq 'Cost' and + ResourceGroup eq 'MyResourceGroup' :type filter: str :param top: The number of recommendations per page if a paged version of this API is being used. diff --git a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py index e8ee6264d4d6..cb8fa2991e67 100644 --- a/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py +++ b/sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/operations/_suppressions_operations.py @@ -55,9 +55,8 @@ def get( deserialized response :param operation_config: :ref:`Operation configuration overrides`. - :return: SuppressionContract or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.advisor.models.SuppressionContract or - ~msrest.pipeline.ClientRawResponse + :return: object or ClientRawResponse if raw=true + :rtype: object or ~msrest.pipeline.ClientRawResponse :raises: :class:`CloudError` """ # Construct URL @@ -87,7 +86,7 @@ def get( request = self._client.get(url, query_parameters, header_parameters) response = self._client.send(request, stream=False, **operation_config) - if response.status_code not in [200]: + if response.status_code not in [200, 404]: exp = CloudError(response) exp.request_id = response.headers.get('x-ms-request-id') raise exp @@ -95,6 +94,8 @@ def get( deserialized = None if response.status_code == 200: deserialized = self._deserialize('SuppressionContract', response) + if response.status_code == 404: + deserialized = self._deserialize('ARMErrorResponseBody', response) if raw: client_raw_response = ClientRawResponse(deserialized, response) diff --git a/sdk/advisor/azure-mgmt-advisor/setup.py b/sdk/advisor/azure-mgmt-advisor/setup.py index d89cc9aaa971..ca5157a92a9b 100644 --- a/sdk/advisor/azure-mgmt-advisor/setup.py +++ b/sdk/advisor/azure-mgmt-advisor/setup.py @@ -36,7 +36,9 @@ pass # Version extraction inspired from 'requests' -with open(os.path.join(package_folder_path, 'version.py'), 'r') as fd: +with open(os.path.join(package_folder_path, 'version.py') + if os.path.exists(os.path.join(package_folder_path, 'version.py')) + else os.path.join(package_folder_path, '_version.py'), 'r') as fd: version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]', fd.read(), re.MULTILINE).group(1)