From 0cd525b14826d207b84bf7ac6c63decbb406c26a Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Mon, 11 Jun 2018 21:28:15 +0000 Subject: [PATCH 1/2] Generated from 8f325f540f597ae184379bed0676e8cdfd42039f Add C# settings --- .../mgmt/advisor/advisor_management_client.py | 6 +- .../azure/mgmt/advisor/models/__init__.py | 29 +++++-- .../models/advisor_management_client_enums.py | 6 +- .../advisor/models/arm_error_response_body.py | 8 +- .../models/arm_error_response_body_py3.py | 34 ++++++++ .../azure/mgmt/advisor/models/config_data.py | 12 +-- .../advisor/models/config_data_properties.py | 10 +-- .../models/config_data_properties_py3.py | 40 +++++++++ .../mgmt/advisor/models/config_data_py3.py | 40 +++++++++ .../advisor/models/operation_display_info.py | 12 +-- .../models/operation_display_info_py3.py | 41 +++++++++ .../mgmt/advisor/models/operation_entity.py | 8 +- .../advisor/models/operation_entity_py3.py | 32 +++++++ .../azure/mgmt/advisor/models/resource.py | 4 +- .../azure/mgmt/advisor/models/resource_py3.py | 45 ++++++++++ .../models/resource_recommendation_base.py | 24 ++--- .../resource_recommendation_base_py3.py | 87 +++++++++++++++++++ .../mgmt/advisor/models/short_description.py | 8 +- .../advisor/models/short_description_py3.py | 32 +++++++ .../advisor/models/suppression_contract.py | 8 +- .../models/suppression_contract_py3.py | 51 +++++++++++ .../operations/configurations_operations.py | 14 +-- .../mgmt/advisor/operations/operations.py | 5 +- .../operations/recommendations_operations.py | 63 +++++--------- .../operations/suppressions_operations.py | 14 +-- 25 files changed, 520 insertions(+), 113 deletions(-) create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py create mode 100644 azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/advisor_management_client.py b/azure-mgmt-advisor/azure/mgmt/advisor/advisor_management_client.py index 0b48d2c719d5..0b162d69bd1b 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/advisor_management_client.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/advisor_management_client.py @@ -9,7 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- -from msrest.service_client import ServiceClient +from msrest.service_client import SDKClient from msrest import Serializer, Deserializer from msrestazure import AzureConfiguration from .version import VERSION @@ -52,7 +52,7 @@ def __init__( self.subscription_id = subscription_id -class AdvisorManagementClient(object): +class AdvisorManagementClient(SDKClient): """REST APIs for Azure Advisor :ivar config: Configuration for client. @@ -79,7 +79,7 @@ def __init__( self, credentials, subscription_id, base_url=None): self.config = AdvisorManagementClientConfiguration(credentials, subscription_id, base_url) - self._client = ServiceClient(self.config.credentials, self.config) + super(AdvisorManagementClient, 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 = '2017-04-19' diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py index 63972056a984..45155f314ad3 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/__init__.py @@ -9,15 +9,26 @@ # regenerated. # -------------------------------------------------------------------------- -from .config_data_properties import ConfigDataProperties -from .config_data import ConfigData -from .arm_error_response_body import ARMErrorResponseBody -from .short_description import ShortDescription -from .resource_recommendation_base import ResourceRecommendationBase -from .resource import Resource -from .operation_display_info import OperationDisplayInfo -from .operation_entity import OperationEntity -from .suppression_contract import SuppressionContract +try: + from .config_data_properties_py3 import ConfigDataProperties + from .config_data_py3 import ConfigData + from .arm_error_response_body_py3 import ARMErrorResponseBody + from .short_description_py3 import ShortDescription + from .resource_recommendation_base_py3 import ResourceRecommendationBase + from .resource_py3 import Resource + from .operation_display_info_py3 import OperationDisplayInfo + from .operation_entity_py3 import OperationEntity + from .suppression_contract_py3 import SuppressionContract +except (SyntaxError, ImportError): + from .config_data_properties import ConfigDataProperties + from .config_data import ConfigData + from .arm_error_response_body import ARMErrorResponseBody + from .short_description import ShortDescription + from .resource_recommendation_base import ResourceRecommendationBase + from .resource import Resource + from .operation_display_info import OperationDisplayInfo + from .operation_entity import OperationEntity + from .suppression_contract import SuppressionContract from .config_data_paged import ConfigDataPaged from .resource_recommendation_base_paged import ResourceRecommendationBasePaged from .operation_entity_paged import OperationEntityPaged diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py index 835a92ce544d..477dbe954da5 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/advisor_management_client_enums.py @@ -12,7 +12,7 @@ from enum import Enum -class Category(Enum): +class Category(str, Enum): high_availability = "HighAvailability" security = "Security" @@ -20,14 +20,14 @@ class Category(Enum): cost = "Cost" -class Impact(Enum): +class Impact(str, Enum): high = "High" medium = "Medium" low = "Low" -class Risk(Enum): +class Risk(str, Enum): error = "Error" warning = "Warning" diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py index 5bf889bbbd27..ae0fff677a8f 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body.py @@ -28,7 +28,7 @@ class ARMErrorResponseBody(Model): 'code': {'key': 'code', 'type': 'str'}, } - def __init__(self, message=None, code=None): - super(ARMErrorResponseBody, self).__init__() - self.message = message - self.code = code + def __init__(self, **kwargs): + super(ARMErrorResponseBody, self).__init__(**kwargs) + self.message = kwargs.get('message', None) + self.code = kwargs.get('code', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py new file mode 100644 index 000000000000..1a79f9387110 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/arm_error_response_body_py3.py @@ -0,0 +1,34 @@ +# 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 ARMErrorResponseBody(Model): + """ARM error response body. + + :param message: Gets or sets the string that describes the error in detail + and provides debugging information. + :type message: str + :param code: Gets or sets the string that can be used to programmatically + identify the error. + :type code: str + """ + + _attribute_map = { + 'message': {'key': 'message', 'type': 'str'}, + 'code': {'key': 'code', 'type': 'str'}, + } + + def __init__(self, *, message: str=None, code: str=None, **kwargs) -> None: + super(ARMErrorResponseBody, self).__init__(**kwargs) + self.message = message + self.code = code diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py index 3d4039cf76d6..534a0e11eb79 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data.py @@ -32,9 +32,9 @@ class ConfigData(Model): 'properties': {'key': 'properties', 'type': 'ConfigDataProperties'}, } - def __init__(self, id=None, type=None, name=None, properties=None): - super(ConfigData, self).__init__() - self.id = id - self.type = type - self.name = name - self.properties = properties + def __init__(self, **kwargs): + super(ConfigData, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.type = kwargs.get('type', None) + self.name = kwargs.get('name', None) + self.properties = kwargs.get('properties', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py index 9e5d1e0217f8..cc0303d1c606 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties.py @@ -33,8 +33,8 @@ class ConfigDataProperties(Model): 'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'}, } - def __init__(self, additional_properties=None, exclude=None, low_cpu_threshold=None): - super(ConfigDataProperties, self).__init__() - self.additional_properties = additional_properties - self.exclude = exclude - self.low_cpu_threshold = low_cpu_threshold + def __init__(self, **kwargs): + super(ConfigDataProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.exclude = kwargs.get('exclude', None) + self.low_cpu_threshold = kwargs.get('low_cpu_threshold', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py new file mode 100644 index 000000000000..f52c01d6dafe --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_properties_py3.py @@ -0,0 +1,40 @@ +# 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 ConfigDataProperties(Model): + """The list of property name/value pairs. + + :param additional_properties: Unmatched properties from the message are + deserialized this collection + :type additional_properties: dict[str, object] + :param exclude: Exclude the resource from Advisor evaluations. Valid + values: False (default) or True. + :type exclude: bool + :param low_cpu_threshold: Minimum percentage threshold for Advisor low CPU + utilization evaluation. Valid only for subscriptions. Valid values: 5 + (default), 10, 15 or 20. + :type low_cpu_threshold: str + """ + + _attribute_map = { + 'additional_properties': {'key': '', 'type': '{object}'}, + 'exclude': {'key': 'exclude', 'type': 'bool'}, + 'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'}, + } + + def __init__(self, *, additional_properties=None, exclude: bool=None, low_cpu_threshold: str=None, **kwargs) -> None: + super(ConfigDataProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.exclude = exclude + self.low_cpu_threshold = low_cpu_threshold diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py new file mode 100644 index 000000000000..c8e7c45215c4 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/config_data_py3.py @@ -0,0 +1,40 @@ +# 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 ConfigData(Model): + """The Advisor configuration data structure. + + :param id: The resource Id of the configuration resource. + :type id: str + :param type: The type of the configuration resource. + :type type: str + :param name: The name of the configuration resource. + :type name: str + :param properties: The list of property name/value pairs. + :type properties: ~azure.mgmt.advisor.models.ConfigDataProperties + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'ConfigDataProperties'}, + } + + def __init__(self, *, id: str=None, type: str=None, name: str=None, properties=None, **kwargs) -> None: + super(ConfigData, self).__init__(**kwargs) + self.id = id + self.type = type + self.name = name + self.properties = properties diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py index b338bd668c8e..d4f103558727 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info.py @@ -33,9 +33,9 @@ class OperationDisplayInfo(Model): 'resource': {'key': 'resource', 'type': 'str'}, } - def __init__(self, description=None, operation=None, provider=None, resource=None): - super(OperationDisplayInfo, self).__init__() - self.description = description - self.operation = operation - self.provider = provider - self.resource = resource + def __init__(self, **kwargs): + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.operation = kwargs.get('operation', None) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py new file mode 100644 index 000000000000..24ca7bb48ec2 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_display_info_py3.py @@ -0,0 +1,41 @@ +# 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 OperationDisplayInfo(Model): + """The operation supported by Advisor. + + :param description: The description of the operation. + :type description: str + :param operation: The action that users can perform, based on their + permission level. + :type operation: str + :param provider: Service provider: Microsoft Advisor. + :type provider: str + :param resource: Resource on which the operation is performed. + :type resource: str + """ + + _attribute_map = { + 'description': {'key': 'description', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + } + + def __init__(self, *, description: str=None, operation: str=None, provider: str=None, resource: str=None, **kwargs) -> None: + super(OperationDisplayInfo, self).__init__(**kwargs) + self.description = description + self.operation = operation + self.provider = provider + self.resource = resource diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py index 974966de9aa6..9872949cbe52 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity.py @@ -26,7 +26,7 @@ class OperationEntity(Model): 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, } - def __init__(self, name=None, display=None): - super(OperationEntity, self).__init__() - self.name = name - self.display = display + def __init__(self, **kwargs): + super(OperationEntity, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py new file mode 100644 index 000000000000..24c1b1b6eb82 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/operation_entity_py3.py @@ -0,0 +1,32 @@ +# 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 OperationEntity(Model): + """The operation supported by Advisor. + + :param name: Operation name: {provider}/{resource}/{operation}. + :type name: str + :param display: The operation supported by Advisor. + :type display: ~azure.mgmt.advisor.models.OperationDisplayInfo + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'OperationDisplayInfo'}, + } + + def __init__(self, *, name: str=None, display=None, **kwargs) -> None: + super(OperationEntity, self).__init__(**kwargs) + self.name = name + self.display = display diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py index 92c78390e734..f43f76f15a74 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource.py @@ -38,8 +38,8 @@ class Resource(Model): 'type': {'key': 'type', 'type': 'str'}, } - def __init__(self): - super(Resource, self).__init__() + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) self.id = None self.name = None self.type = None diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py new file mode 100644 index 000000000000..33023c8d186f --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_py3.py @@ -0,0 +1,45 @@ +# 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 Resource(Model): + """An Azure resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py index d00353cb69c6..b10979180171 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base.py @@ -73,15 +73,15 @@ class ResourceRecommendationBase(Resource): 'suppression_ids': {'key': 'properties.suppressionIds', 'type': '[str]'}, } - def __init__(self, category=None, impact=None, impacted_field=None, impacted_value=None, last_updated=None, metadata=None, recommendation_type_id=None, risk=None, short_description=None, suppression_ids=None): - super(ResourceRecommendationBase, self).__init__() - self.category = category - self.impact = impact - self.impacted_field = impacted_field - self.impacted_value = impacted_value - self.last_updated = last_updated - self.metadata = metadata - self.recommendation_type_id = recommendation_type_id - self.risk = risk - self.short_description = short_description - self.suppression_ids = suppression_ids + def __init__(self, **kwargs): + super(ResourceRecommendationBase, self).__init__(**kwargs) + self.category = kwargs.get('category', None) + self.impact = kwargs.get('impact', None) + self.impacted_field = kwargs.get('impacted_field', None) + self.impacted_value = kwargs.get('impacted_value', None) + self.last_updated = kwargs.get('last_updated', None) + self.metadata = kwargs.get('metadata', None) + self.recommendation_type_id = kwargs.get('recommendation_type_id', None) + self.risk = kwargs.get('risk', None) + self.short_description = kwargs.get('short_description', None) + self.suppression_ids = kwargs.get('suppression_ids', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py new file mode 100644 index 000000000000..bb42375553e8 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/resource_recommendation_base_py3.py @@ -0,0 +1,87 @@ +# 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 .resource_py3 import Resource + + +class ResourceRecommendationBase(Resource): + """Advisor Recommendation. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param category: The category of the recommendation. Possible values + include: 'HighAvailability', 'Security', 'Performance', 'Cost' + :type category: str or ~azure.mgmt.advisor.models.Category + :param impact: The business impact of the recommendation. Possible values + include: 'High', 'Medium', 'Low' + :type impact: str or ~azure.mgmt.advisor.models.Impact + :param impacted_field: The resource type identified by Advisor. + :type impacted_field: str + :param impacted_value: The resource identified by Advisor. + :type impacted_value: str + :param last_updated: The most recent time that Advisor checked the + validity of the recommendation. + :type last_updated: datetime + :param metadata: The recommendation metadata. + :type metadata: dict[str, object] + :param recommendation_type_id: The recommendation-type GUID. + :type recommendation_type_id: str + :param risk: The potential risk of not implementing the recommendation. + Possible values include: 'Error', 'Warning', 'None' + :type risk: str or ~azure.mgmt.advisor.models.Risk + :param short_description: A summary of the recommendation. + :type short_description: ~azure.mgmt.advisor.models.ShortDescription + :param suppression_ids: The list of snoozed and dismissed rules for the + recommendation. + :type suppression_ids: list[str] + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'category': {'key': 'properties.category', 'type': 'str'}, + 'impact': {'key': 'properties.impact', 'type': 'str'}, + 'impacted_field': {'key': 'properties.impactedField', 'type': 'str'}, + 'impacted_value': {'key': 'properties.impactedValue', 'type': 'str'}, + 'last_updated': {'key': 'properties.lastUpdated', 'type': 'iso-8601'}, + 'metadata': {'key': 'properties.metadata', 'type': '{object}'}, + 'recommendation_type_id': {'key': 'properties.recommendationTypeId', 'type': 'str'}, + 'risk': {'key': 'properties.risk', 'type': 'str'}, + 'short_description': {'key': 'properties.shortDescription', 'type': 'ShortDescription'}, + 'suppression_ids': {'key': 'properties.suppressionIds', 'type': '[str]'}, + } + + def __init__(self, *, category=None, impact=None, impacted_field: str=None, impacted_value: str=None, last_updated=None, metadata=None, recommendation_type_id: str=None, risk=None, short_description=None, suppression_ids=None, **kwargs) -> None: + super(ResourceRecommendationBase, self).__init__(**kwargs) + self.category = category + self.impact = impact + self.impacted_field = impacted_field + self.impacted_value = impacted_value + self.last_updated = last_updated + self.metadata = metadata + self.recommendation_type_id = recommendation_type_id + self.risk = risk + self.short_description = short_description + self.suppression_ids = suppression_ids diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py index ba93541a0671..f2c722033a30 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description.py @@ -26,7 +26,7 @@ class ShortDescription(Model): 'solution': {'key': 'solution', 'type': 'str'}, } - def __init__(self, problem=None, solution=None): - super(ShortDescription, self).__init__() - self.problem = problem - self.solution = solution + def __init__(self, **kwargs): + super(ShortDescription, self).__init__(**kwargs) + self.problem = kwargs.get('problem', None) + self.solution = kwargs.get('solution', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py new file mode 100644 index 000000000000..ed3b7bd29aa2 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/short_description_py3.py @@ -0,0 +1,32 @@ +# 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 ShortDescription(Model): + """A summary of the recommendation. + + :param problem: The issue or opportunity identified by the recommendation. + :type problem: str + :param solution: The remediation action suggested by the recommendation. + :type solution: str + """ + + _attribute_map = { + 'problem': {'key': 'problem', 'type': 'str'}, + 'solution': {'key': 'solution', 'type': 'str'}, + } + + def __init__(self, *, problem: str=None, solution: str=None, **kwargs) -> None: + super(ShortDescription, self).__init__(**kwargs) + self.problem = problem + self.solution = solution diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py index 358d6c239e36..ff9cc1012dbd 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract.py @@ -45,7 +45,7 @@ class SuppressionContract(Resource): 'ttl': {'key': 'properties.ttl', 'type': 'str'}, } - def __init__(self, suppression_id=None, ttl=None): - super(SuppressionContract, self).__init__() - self.suppression_id = suppression_id - self.ttl = ttl + def __init__(self, **kwargs): + super(SuppressionContract, self).__init__(**kwargs) + self.suppression_id = kwargs.get('suppression_id', None) + self.ttl = kwargs.get('ttl', None) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py new file mode 100644 index 000000000000..de2985eea108 --- /dev/null +++ b/azure-mgmt-advisor/azure/mgmt/advisor/models/suppression_contract_py3.py @@ -0,0 +1,51 @@ +# 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 .resource_py3 import Resource + + +class SuppressionContract(Resource): + """The details of the snoozed or dismissed rule; for example, the duration, + name, and GUID associated with the rule. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The resource ID. + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param suppression_id: The GUID of the suppression. + :type suppression_id: str + :param ttl: The duration for which the suppression is valid. + :type ttl: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'suppression_id': {'key': 'properties.suppressionId', 'type': 'str'}, + 'ttl': {'key': 'properties.ttl', 'type': 'str'}, + } + + 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 diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py index 9a03137ea165..04586c6d5864 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/configurations_operations.py @@ -22,7 +22,7 @@ class ConfigurationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -58,7 +58,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations' + url = self.list_by_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -103,6 +103,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'} def create_in_subscription( self, config_contract, custom_headers=None, raw=False, **operation_config): @@ -125,7 +126,7 @@ def create_in_subscription( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations' + url = self.create_in_subscription.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -168,6 +169,7 @@ def create_in_subscription( return client_raw_response return deserialized + create_in_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/configurations'} def list_by_resource_group( self, resource_group, custom_headers=None, raw=False, **operation_config): @@ -189,7 +191,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations' + url = self.list_by_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') @@ -235,6 +237,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'} def create_in_resource_group( self, config_contract, resource_group, custom_headers=None, raw=False, **operation_config): @@ -256,7 +259,7 @@ def create_in_resource_group( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations' + url = self.create_in_resource_group.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'resourceGroup': self._serialize.url("resource_group", resource_group, 'str') @@ -300,3 +303,4 @@ def create_in_resource_group( return client_raw_response return deserialized + create_in_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Advisor/configurations'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py index b1c46006013e..d21c47368ac2 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/operations.py @@ -22,7 +22,7 @@ class Operations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -55,7 +55,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/providers/Microsoft.Advisor/operations' + url = self.list.metadata['url'] # Construct parameters query_parameters = {} @@ -96,3 +96,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/providers/Microsoft.Advisor/operations'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py index fc25a7a6ef45..18965d1a213e 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py @@ -12,8 +12,8 @@ import uuid from msrest.pipeline import ClientRawResponse from msrestazure.azure_exceptions import CloudError -from msrest.exceptions import DeserializationError -from msrestazure.azure_operation import AzureOperationPoller +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling from .. import models @@ -24,7 +24,7 @@ class RecommendationsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -55,7 +55,7 @@ def generate( :raises: :class:`CloudError` """ # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations' + url = self.generate.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -91,12 +91,13 @@ def generate( 'Retry-After': 'str', }) return client_raw_response + generate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations'} def _get_generate_status_initial( self, operation_id, custom_headers=None, raw=False, **operation_config): # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}' + url = self.get_generate_status.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), 'operationId': self._serialize.url("operation_id", operation_id, 'str') @@ -131,7 +132,7 @@ def _get_generate_status_initial( return client_raw_response def get_generate_status( - self, operation_id, custom_headers=None, raw=False, **operation_config): + self, operation_id, custom_headers=None, raw=False, polling=True, **operation_config): """Retrieves the status of the recommendation computation or generation process. Invoke this API after calling the generation recommendation. The URI of this API is returned in the Location field of the response @@ -141,12 +142,14 @@ def get_generate_status( Location field in the generate recommendation response header. :type operation_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 - :return: An instance of AzureOperationPoller that returns None or - ClientRawResponse if raw=true + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrest.pipeline.ClientRawResponse + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] :raises: :class:`CloudError` """ raw_result = self._get_generate_status_initial( @@ -155,40 +158,20 @@ def get_generate_status( raw=True, **operation_config ) - if raw: - return raw_result - - # Construct and send request - def long_running_send(): - return raw_result.response - - def get_long_running_status(status_link, headers=None): - - request = self._client.get(status_link) - if headers: - request.headers.update(headers) - header_parameters = {} - header_parameters['x-ms-client-request-id'] = raw_result.response.request.headers['x-ms-client-request-id'] - return self._client.send( - request, header_parameters, stream=False, **operation_config) def get_long_running_output(response): - - if response.status_code not in [202, 204]: - exp = CloudError(response) - exp.request_id = response.headers.get('x-ms-request-id') - raise exp - if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - long_running_operation_timeout = operation_config.get( + lro_delay = operation_config.get( 'long_running_operation_timeout', self.config.long_running_operation_timeout) - return AzureOperationPoller( - long_running_send, get_long_running_output, - get_long_running_status, long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + get_generate_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}'} def list( self, filter=None, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): @@ -217,7 +200,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -268,6 +251,7 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/recommendations'} def get( self, resource_uri, recommendation_id, custom_headers=None, raw=False, **operation_config): @@ -289,7 +273,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str') @@ -329,3 +313,4 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}'} diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py index 6c7806bc57e9..d3a9e85d47c8 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/suppressions_operations.py @@ -22,7 +22,7 @@ class SuppressionsOperations(object): :param client: Client for service requests. :param config: Configuration of service client. :param serializer: An object model serializer. - :param deserializer: An objec model deserializer. + :param deserializer: An object model deserializer. :ivar api_version: The version of the API to be used with the client request. Constant value: "2017-04-19". """ @@ -59,7 +59,7 @@ def get( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.get.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -100,6 +100,7 @@ def get( return client_raw_response return deserialized + get.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def create( self, resource_uri, recommendation_id, name, suppression_id=None, ttl=None, custom_headers=None, raw=False, **operation_config): @@ -132,7 +133,7 @@ def create( suppression_contract = models.SuppressionContract(suppression_id=suppression_id, ttl=ttl) # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.create.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -177,6 +178,7 @@ def create( return client_raw_response return deserialized + create.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def delete( self, resource_uri, recommendation_id, name, custom_headers=None, raw=False, **operation_config): @@ -201,7 +203,7 @@ def delete( :raises: :class:`CloudError` """ # Construct URL - url = '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}' + url = self.delete.metadata['url'] path_format_arguments = { 'resourceUri': self._serialize.url("resource_uri", resource_uri, 'str'), 'recommendationId': self._serialize.url("recommendation_id", recommendation_id, 'str'), @@ -235,6 +237,7 @@ def delete( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response + delete.metadata = {'url': '/{resourceUri}/providers/Microsoft.Advisor/recommendations/{recommendationId}/suppressions/{name}'} def list( self, top=None, skip_token=None, custom_headers=None, raw=False, **operation_config): @@ -262,7 +265,7 @@ def internal_paging(next_link=None, raw=False): if not next_link: # Construct URL - url = '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions' + url = self.list.metadata['url'] path_format_arguments = { 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') } @@ -311,3 +314,4 @@ def internal_paging(next_link=None, raw=False): return client_raw_response return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/suppressions'} From dfd32deb9981785e549b4d551c8fb119722af4b1 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Sat, 16 Jun 2018 00:09:13 +0000 Subject: [PATCH 2/2] Generated from a3db9ba57ede1858830cee525cf8f2bb9124e143 Remove wrong tag --- .../operations/recommendations_operations.py | 63 ++++++------------- 1 file changed, 18 insertions(+), 45 deletions(-) diff --git a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py index 18965d1a213e..a518234151a2 100644 --- a/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py +++ b/azure-mgmt-advisor/azure/mgmt/advisor/operations/recommendations_operations.py @@ -12,8 +12,6 @@ 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 from .. import models @@ -93,9 +91,25 @@ def generate( return client_raw_response generate.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations'} - - def _get_generate_status_initial( + def get_generate_status( self, operation_id, custom_headers=None, raw=False, **operation_config): + """Retrieves the status of the recommendation computation or generation + process. Invoke this API after calling the generation recommendation. + The URI of this API is returned in the Location field of the response + header. + + :param operation_id: The operation ID, which can be found from the + Location field in the generate recommendation response header. + :type operation_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 + :param operation_config: :ref:`Operation configuration + overrides`. + :return: None or ClientRawResponse if raw=true + :rtype: None or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ # Construct URL url = self.get_generate_status.metadata['url'] path_format_arguments = { @@ -130,47 +144,6 @@ def _get_generate_status_initial( if raw: client_raw_response = ClientRawResponse(None, response) return client_raw_response - - def get_generate_status( - self, operation_id, custom_headers=None, raw=False, polling=True, **operation_config): - """Retrieves the status of the recommendation computation or generation - process. Invoke this API after calling the generation recommendation. - The URI of this API is returned in the Location field of the response - header. - - :param operation_id: The operation ID, which can be found from the - Location field in the generate recommendation response header. - :type operation_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: :class:`CloudError` - """ - raw_result = self._get_generate_status_initial( - operation_id=operation_id, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) get_generate_status.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Advisor/generateRecommendations/{operationId}'} def list(