Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR monitor/resource-manager] Added metrics baseline API #4714

Merged
merged 8 commits into from
Apr 11, 2019
19 changes: 19 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@
from .baseline_response_py3 import BaselineResponse
from .time_series_information_py3 import TimeSeriesInformation
from .calculate_baseline_response_py3 import CalculateBaselineResponse
from .metric_single_dimension_py3 import MetricSingleDimension
from .single_baseline_py3 import SingleBaseline
from .baseline_metadata_py3 import BaselineMetadata
from .time_series_baseline_py3 import TimeSeriesBaseline
from .single_metric_baseline_py3 import SingleMetricBaseline
from .metric_alert_action_py3 import MetricAlertAction
from .metric_alert_criteria_py3 import MetricAlertCriteria
from .metric_alert_resource_py3 import MetricAlertResource
Expand Down Expand Up @@ -199,6 +204,11 @@
from .baseline_response import BaselineResponse
from .time_series_information import TimeSeriesInformation
from .calculate_baseline_response import CalculateBaselineResponse
from .metric_single_dimension import MetricSingleDimension
from .single_baseline import SingleBaseline
from .baseline_metadata import BaselineMetadata
from .time_series_baseline import TimeSeriesBaseline
from .single_metric_baseline import SingleMetricBaseline
from .metric_alert_action import MetricAlertAction
from .metric_alert_criteria import MetricAlertCriteria
from .metric_alert_resource import MetricAlertResource
Expand Down Expand Up @@ -240,6 +250,7 @@
from .event_data_paged import EventDataPaged
from .localizable_string_paged import LocalizableStringPaged
from .metric_definition_paged import MetricDefinitionPaged
from .single_metric_baseline_paged import SingleMetricBaselinePaged
from .metric_alert_resource_paged import MetricAlertResourcePaged
from .log_search_rule_resource_paged import LogSearchRuleResourcePaged
from .metric_namespace_paged import MetricNamespacePaged
Expand All @@ -258,6 +269,7 @@
Unit,
AggregationType,
Sensitivity,
BaselineSensitivity,
Enabled,
ProvisioningState,
QueryType,
Expand Down Expand Up @@ -348,6 +360,11 @@
'BaselineResponse',
'TimeSeriesInformation',
'CalculateBaselineResponse',
'MetricSingleDimension',
'SingleBaseline',
'BaselineMetadata',
'TimeSeriesBaseline',
'SingleMetricBaseline',
'MetricAlertAction',
'MetricAlertCriteria',
'MetricAlertResource',
Expand Down Expand Up @@ -389,6 +406,7 @@
'EventDataPaged',
'LocalizableStringPaged',
'MetricDefinitionPaged',
'SingleMetricBaselinePaged',
'MetricAlertResourcePaged',
'LogSearchRuleResourcePaged',
'MetricNamespacePaged',
Expand All @@ -406,6 +424,7 @@
'Unit',
'AggregationType',
'Sensitivity',
'BaselineSensitivity',
'Enabled',
'ProvisioningState',
'QueryType',
Expand Down
39 changes: 39 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_metadata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 BaselineMetadata(Model):
"""Represents a baseline metadata value.

All required parameters must be populated in order to send to Azure.

:param name: Required. Name of the baseline metadata.
:type name: str
:param value: Required. Value of the baseline metadata.
:type value: str
"""

_validation = {
'name': {'required': True},
'value': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(BaselineMetadata, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.value = kwargs.get('value', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 BaselineMetadata(Model):
"""Represents a baseline metadata value.

All required parameters must be populated in order to send to Azure.

:param name: Required. Name of the baseline metadata.
:type name: str
:param value: Required. Value of the baseline metadata.
:type value: str
"""

_validation = {
'name': {'required': True},
'value': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, *, name: str, value: str, **kwargs) -> None:
super(BaselineMetadata, self).__init__(**kwargs)
self.name = name
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class LogToMetricAction(Action):

:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param criteria: Required. Severity of the alert
:type criteria: ~azure.mgmt.monitor.models.Criteria
:param criteria: Required. Criteria of Metric
:type criteria: list[~azure.mgmt.monitor.models.Criteria]
"""

_validation = {
Expand All @@ -30,7 +30,7 @@ class LogToMetricAction(Action):

_attribute_map = {
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'criteria': {'key': 'criteria', 'type': 'Criteria'},
'criteria': {'key': 'criteria', 'type': '[Criteria]'},
}

def __init__(self, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class LogToMetricAction(Action):

:param odatatype: Required. Constant filled by server.
:type odatatype: str
:param criteria: Required. Severity of the alert
:type criteria: ~azure.mgmt.monitor.models.Criteria
:param criteria: Required. Criteria of Metric
:type criteria: list[~azure.mgmt.monitor.models.Criteria]
"""

_validation = {
Expand All @@ -30,7 +30,7 @@ class LogToMetricAction(Action):

_attribute_map = {
'odatatype': {'key': 'odata\\.type', 'type': 'str'},
'criteria': {'key': 'criteria', 'type': 'Criteria'},
'criteria': {'key': 'criteria', 'type': '[Criteria]'},
}

def __init__(self, *, criteria, **kwargs) -> None:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 MetricSingleDimension(Model):
"""The metric dimension name and value.

All required parameters must be populated in order to send to Azure.

:param name: Required. Name of the dimension.
:type name: str
:param value: Required. Value of the dimension.
:type value: str
"""

_validation = {
'name': {'required': True},
'value': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, **kwargs):
super(MetricSingleDimension, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.value = kwargs.get('value', None)
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# 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 MetricSingleDimension(Model):
"""The metric dimension name and value.

All required parameters must be populated in order to send to Azure.

:param name: Required. Name of the dimension.
:type name: str
:param value: Required. Value of the dimension.
:type value: str
"""

_validation = {
'name': {'required': True},
'value': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'value': {'key': 'value', 'type': 'str'},
}

def __init__(self, *, name: str, value: str, **kwargs) -> None:
super(MetricSingleDimension, self).__init__(**kwargs)
self.name = name
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,13 @@ class Sensitivity(str, Enum):
high = "High"


class BaselineSensitivity(str, Enum):

low = "Low"
medium = "Medium"
high = "High"


class Enabled(str, Enum):

true = "true"
Expand Down
45 changes: 45 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/single_baseline.py
Original file line number Diff line number Diff line change
@@ -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 SingleBaseline(Model):
"""The baseline values for a single sensitivity value.

All required parameters must be populated in order to send to Azure.

:param sensitivity: Required. the sensitivity of the baseline. Possible
values include: 'Low', 'Medium', 'High'
:type sensitivity: str or ~azure.mgmt.monitor.models.BaselineSensitivity
:param low_thresholds: Required. The low thresholds of the baseline.
:type low_thresholds: list[float]
:param high_thresholds: Required. The high thresholds of the baseline.
:type high_thresholds: list[float]
"""

_validation = {
'sensitivity': {'required': True},
'low_thresholds': {'required': True},
'high_thresholds': {'required': True},
}

_attribute_map = {
'sensitivity': {'key': 'sensitivity', 'type': 'str'},
'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'},
'high_thresholds': {'key': 'highThresholds', 'type': '[float]'},
}

def __init__(self, **kwargs):
super(SingleBaseline, self).__init__(**kwargs)
self.sensitivity = kwargs.get('sensitivity', None)
self.low_thresholds = kwargs.get('low_thresholds', None)
self.high_thresholds = kwargs.get('high_thresholds', None)
Original file line number Diff line number Diff line change
@@ -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 SingleBaseline(Model):
"""The baseline values for a single sensitivity value.

All required parameters must be populated in order to send to Azure.

:param sensitivity: Required. the sensitivity of the baseline. Possible
values include: 'Low', 'Medium', 'High'
:type sensitivity: str or ~azure.mgmt.monitor.models.BaselineSensitivity
:param low_thresholds: Required. The low thresholds of the baseline.
:type low_thresholds: list[float]
:param high_thresholds: Required. The high thresholds of the baseline.
:type high_thresholds: list[float]
"""

_validation = {
'sensitivity': {'required': True},
'low_thresholds': {'required': True},
'high_thresholds': {'required': True},
}

_attribute_map = {
'sensitivity': {'key': 'sensitivity', 'type': 'str'},
'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'},
'high_thresholds': {'key': 'highThresholds', 'type': '[float]'},
}

def __init__(self, *, sensitivity, low_thresholds, high_thresholds, **kwargs) -> None:
super(SingleBaseline, self).__init__(**kwargs)
self.sensitivity = sensitivity
self.low_thresholds = low_thresholds
self.high_thresholds = high_thresholds
Loading