# 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
from msrest.exceptions import HttpOperationError
[docs]class ArmErrorResponse(Model):
"""ArmErrorResponse.
:param error:
:type error: ~azure.mgmt.advisor.models.ARMErrorResponseBody
"""
_attribute_map = {
'error': {'key': 'error', 'type': 'ARMErrorResponseBody'},
}
def __init__(self, *, error=None, **kwargs) -> None:
super(ArmErrorResponse, self).__init__(**kwargs)
self.error = error
[docs]class ArmErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ArmErrorResponse'.
:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""
def __init__(self, deserialize, response, *args):
super(ArmErrorResponseException, self).__init__(deserialize, response, 'ArmErrorResponse', *args)
[docs]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
class CloudError(Model):
"""CloudError.
"""
_attribute_map = {
}
[docs]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
[docs]class ConfigData(Resource):
"""The Advisor configuration data structure.
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 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. Possible values include: '5', '10', '15', '20'
:type low_cpu_threshold: str or ~azure.mgmt.advisor.models.CpuThreshold
:param digests: Advisor digest configuration. Valid only for subscriptions
:type digests: list[~azure.mgmt.advisor.models.DigestConfig]
"""
_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'},
'exclude': {'key': 'properties.exclude', 'type': 'bool'},
'low_cpu_threshold': {'key': 'properties.lowCpuThreshold', 'type': 'str'},
'digests': {'key': 'properties.digests', 'type': '[DigestConfig]'},
}
def __init__(self, *, exclude: bool=None, low_cpu_threshold=None, digests=None, **kwargs) -> None:
super(ConfigData, self).__init__(**kwargs)
self.exclude = exclude
self.low_cpu_threshold = low_cpu_threshold
self.digests = digests
[docs]class DigestConfig(Model):
"""Advisor Digest configuration entity.
:param name: Name of digest configuration. Value is case-insensitive and
must be unique within a subscription.
:type name: str
:param action_group_resource_id: Action group resource id used by digest.
:type action_group_resource_id: str
:param frequency: Frequency that digest will be triggered, in days. Value
must be between 7 and 30 days inclusive.
:type frequency: int
:param categories: Categories to send digest for. If categories are not
provided, then digest will be sent for all categories.
:type categories: list[str or ~azure.mgmt.advisor.models.Category]
:param language: Language for digest content body. Value must be ISO 639-1
code for one of Azure portal supported languages. Otherwise, it will be
converted into one. Default value is English (en).
:type language: str
:param state: State of digest configuration. Possible values include:
'Active', 'Disabled'
:type state: str or ~azure.mgmt.advisor.models.DigestConfigState
"""
_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'action_group_resource_id': {'key': 'actionGroupResourceId', 'type': 'str'},
'frequency': {'key': 'frequency', 'type': 'int'},
'categories': {'key': 'categories', 'type': '[str]'},
'language': {'key': 'language', 'type': 'str'},
'state': {'key': 'state', 'type': 'str'},
}
def __init__(self, *, name: str=None, action_group_resource_id: str=None, frequency: int=None, categories=None, language: str=None, state=None, **kwargs) -> None:
super(DigestConfig, self).__init__(**kwargs)
self.name = name
self.action_group_resource_id = action_group_resource_id
self.frequency = frequency
self.categories = categories
self.language = language
self.state = state
[docs]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
[docs]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
[docs]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',
'OperationalExcellence'
: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]
:param extended_properties: Extended properties
:type extended_properties: dict[str, str]
:param resource_metadata: Metadata of resource that was assessed
:type resource_metadata: ~azure.mgmt.advisor.models.ResourceMetadata
"""
_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]'},
'extended_properties': {'key': 'properties.extendedProperties', 'type': '{str}'},
'resource_metadata': {'key': 'properties.resourceMetadata', 'type': 'ResourceMetadata'},
}
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, extended_properties=None, resource_metadata=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
self.extended_properties = extended_properties
self.resource_metadata = resource_metadata
[docs]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
[docs]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