Skip to content

Commit

Permalink
Generated from 497f37d011e45d90e7a5f190b1326ec89e2719c8
Browse files Browse the repository at this point in the history
Merge pull request #6 from Khushboo-Baheti/master

merge
  • Loading branch information
SDK Automation committed Feb 24, 2020
1 parent a25a803 commit 182c77d
Show file tree
Hide file tree
Showing 10 changed files with 310 additions and 170 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(
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'
self.api_version = '2020-01-01'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@
# --------------------------------------------------------------------------

try:
from ._models_py3 import ArmErrorResponse, ArmErrorResponseException
from ._models_py3 import ARMErrorResponseBody
from ._models_py3 import ConfigData
from ._models_py3 import ConfigDataProperties
from ._models_py3 import DigestConfig
from ._models_py3 import MetadataEntity
from ._models_py3 import MetadataSupportedValueDetail
from ._models_py3 import OperationDisplayInfo
Expand All @@ -22,9 +23,10 @@
from ._models_py3 import ShortDescription
from ._models_py3 import SuppressionContract
except (SyntaxError, ImportError):
from ._models import ArmErrorResponse, ArmErrorResponseException
from ._models import ARMErrorResponseBody
from ._models import ConfigData
from ._models import ConfigDataProperties
from ._models import DigestConfig
from ._models import MetadataEntity
from ._models import MetadataSupportedValueDetail
from ._models import OperationDisplayInfo
Expand All @@ -40,15 +42,18 @@
from ._paged_models import SuppressionContractPaged
from ._advisor_management_client_enums import (
Scenario,
CpuThreshold,
Category,
DigestConfigState,
Impact,
Risk,
)

__all__ = [
'ArmErrorResponse', 'ArmErrorResponseException',
'ARMErrorResponseBody',
'ConfigData',
'ConfigDataProperties',
'DigestConfig',
'MetadataEntity',
'MetadataSupportedValueDetail',
'OperationDisplayInfo',
Expand All @@ -63,7 +68,9 @@
'OperationEntityPaged',
'SuppressionContractPaged',
'Scenario',
'CpuThreshold',
'Category',
'DigestConfigState',
'Impact',
'Risk',
]
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ class Scenario(str, Enum):
alerts = "Alerts"


class CpuThreshold(str, Enum):

five = "5"
one_zero = "10"
one_five = "15"
two_zero = "20"


class Category(str, Enum):

high_availability = "HighAvailability"
Expand All @@ -26,6 +34,12 @@ class Category(str, Enum):
operational_excellence = "OperationalExcellence"


class DigestConfigState(str, Enum):

active = "Active"
disabled = "Disabled"


class Impact(str, Enum):

high = "High"
Expand Down
184 changes: 122 additions & 62 deletions sdk/advisor/azure-mgmt-advisor/azure/mgmt/advisor/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class ArmErrorResponse(Model):
"""ArmErrorResponse.
:param error:
:type error: ~azure.mgmt.advisor.models.ARMErrorResponseBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ARMErrorResponseBody'},
}

def __init__(self, **kwargs):
super(ArmErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


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)


class ARMErrorResponseBody(Model):
Expand Down Expand Up @@ -42,60 +71,124 @@ class CloudError(Model):
}


class ConfigData(Model):
"""The Advisor configuration data structure.
class Resource(Model):
"""An Azure resource.
: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
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'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'properties': {'key': 'properties', 'type': 'ConfigDataProperties'},
'type': {'key': 'type', 'type': 'str'},
}

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)
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None


class ConfigDataProperties(Model):
"""The list of property name/value pairs.
class ConfigData(Resource):
"""The Advisor configuration data structure.
Variables are only populated by the server, and will be ignored when
sending a request.
:param additional_properties: Unmatched properties from the message are
deserialized this collection
:type additional_properties: dict[str, object]
: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.
:type low_cpu_threshold: str
(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 = {
'additional_properties': {'key': '', 'type': '{object}'},
'exclude': {'key': 'exclude', 'type': 'bool'},
'low_cpu_threshold': {'key': 'low_cpu_threshold', 'type': 'str'},
'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, **kwargs):
super(ConfigDataProperties, self).__init__(**kwargs)
self.additional_properties = kwargs.get('additional_properties', None)
super(ConfigData, self).__init__(**kwargs)
self.exclude = kwargs.get('exclude', None)
self.low_cpu_threshold = kwargs.get('low_cpu_threshold', None)
self.digests = kwargs.get('digests', None)


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, **kwargs):
super(DigestConfig, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.action_group_resource_id = kwargs.get('action_group_resource_id', None)
self.frequency = kwargs.get('frequency', None)
self.categories = kwargs.get('categories', None)
self.language = kwargs.get('language', None)
self.state = kwargs.get('state', None)


class MetadataEntity(Model):
Expand Down Expand Up @@ -210,39 +303,6 @@ def __init__(self, **kwargs):
self.display = kwargs.get('display', None)


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):
super(Resource, self).__init__(**kwargs)
self.id = None
self.name = None
self.type = None


class ResourceRecommendationBase(Resource):
"""Advisor Recommendation.
Expand Down
Loading

0 comments on commit 182c77d

Please sign in to comment.