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

[Monitor] Add Public Preview APIs of Metric Baseline #1710

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@
from .time_series_element import TimeSeriesElement
from .metric import Metric
from .response import Response
from .baseline_metadata_value import BaselineMetadataValue
from .baseline import Baseline
from .baseline_response import BaselineResponse
from .time_series_information import TimeSeriesInformation
from .calculate_baseline_response import CalculateBaselineResponse
from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged
from .incident_paged import IncidentPaged
from .alert_rule_resource_paged import AlertRuleResourcePaged
Expand All @@ -97,6 +102,7 @@
EventLevel,
Unit,
AggregationType,
Sensitivity,
ResultType,
)

Expand Down Expand Up @@ -166,6 +172,11 @@
'TimeSeriesElement',
'Metric',
'Response',
'BaselineMetadataValue',
'Baseline',
'BaselineResponse',
'TimeSeriesInformation',
'CalculateBaselineResponse',
'AutoscaleSettingResourcePaged',
'IncidentPaged',
'AlertRuleResourcePaged',
Expand All @@ -188,5 +199,6 @@
'EventLevel',
'Unit',
'AggregationType',
'Sensitivity',
'ResultType',
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,6 @@ class ActivityLogAlertActionGroup(Model):
}

def __init__(self, action_group_id, webhook_properties=None):
super(ActivityLogAlertActionGroup, self).__init__()
self.action_group_id = action_group_id
self.webhook_properties = webhook_properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class ActivityLogAlertActionList(Model):
}

def __init__(self, action_groups=None):
super(ActivityLogAlertActionList, self).__init__()
self.action_groups = action_groups
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,5 @@ class ActivityLogAlertAllOfCondition(Model):
}

def __init__(self, all_of):
super(ActivityLogAlertAllOfCondition, self).__init__()
self.all_of = all_of
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ class ActivityLogAlertLeafCondition(Model):
}

def __init__(self, field, equals):
super(ActivityLogAlertLeafCondition, self).__init__()
self.field = field
self.equals = equals
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,6 @@ class ActivityLogAlertPatchBody(Model):
}

def __init__(self, tags=None, enabled=True):
super(ActivityLogAlertPatchBody, self).__init__()
self.tags = tags
self.enabled = enabled
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ class AlertRuleResourcePatch(Model):
}

def __init__(self, name, is_enabled, condition, tags=None, description=None, actions=None):
super(AlertRuleResourcePatch, self).__init__()
self.tags = tags
self.name = name
self.description = description
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ class AutoscaleNotification(Model):
operation = "Scale"

def __init__(self, email=None, webhooks=None):
super(AutoscaleNotification, self).__init__()
self.email = email
self.webhooks = webhooks
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class AutoscaleProfile(Model):
}

def __init__(self, name, capacity, rules, fixed_date=None, recurrence=None):
super(AutoscaleProfile, self).__init__()
self.name = name
self.capacity = capacity
self.rules = rules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class AutoscaleSettingResourcePatch(Model):
}

def __init__(self, profiles, tags=None, notifications=None, enabled=True, name=None, target_resource_uri=None):
super(AutoscaleSettingResourcePatch, self).__init__()
self.tags = tags
self.profiles = profiles
self.notifications = notifications
Expand Down
43 changes: 43 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/baseline.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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 Baseline(Model):
"""The baseline values for a single sensitivity value.

:param sensitivity: the sensitivity of the baseline. Possible values
include: 'Low', 'Medium', 'High'
:type sensitivity: str or ~azure.mgmt.monitor.models.Sensitivity
:param low_thresholds: The low thresholds of the baseline.
:type low_thresholds: list[float]
:param high_thresholds: 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': 'Sensitivity'},
'low_thresholds': {'key': 'lowThresholds', 'type': '[float]'},
'high_thresholds': {'key': 'highThresholds', 'type': '[float]'},
}

def __init__(self, sensitivity, low_thresholds, high_thresholds):
super(Baseline, self).__init__()
self.sensitivity = sensitivity
self.low_thresholds = low_thresholds
self.high_thresholds = high_thresholds
Original file line number Diff line number Diff line change
@@ -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 BaselineMetadataValue(Model):
"""Represents a baseline metadata value.

:param name: the name of the metadata.
:type name: ~azure.mgmt.monitor.models.LocalizableString
:param value: the value of the metadata.
:type value: str
"""

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

def __init__(self, name=None, value=None):
super(BaselineMetadataValue, self).__init__()
self.name = name
self.value = value
76 changes: 76 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/baseline_response.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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 BaselineResponse(Model):
"""The response to a baseline query.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: the metric baseline Id.
:vartype id: str
:ivar type: the resource type of the baseline resource.
:vartype type: str
:ivar name: the name and the display name of the metric, i.e. it is
localizable string.
:vartype name: ~azure.mgmt.monitor.models.LocalizableString
:param timespan: The timespan for which the data was retrieved. Its value
consists of two datatimes concatenated, separated by '/'. This may be
adjusted in the future and returned back from what was originally
requested.
:type timespan: str
:param interval: The interval (window size) for which the metric data was
returned in. This may be adjusted in the future and returned back from
what was originally requested. This is not present if a metadata request
was made.
:type interval: timedelta
:param aggregation: The aggregation type of the metric.
:type aggregation: str
:param timestamps: the array of timestamps of the baselines.
:type timestamps: list[datetime]
:param baseline: the baseline values for each sensitivity.
:type baseline: list[~azure.mgmt.monitor.models.Baseline]
:param metadata: the baseline metadata values.
:type metadata: list[~azure.mgmt.monitor.models.BaselineMetadataValue]
"""

_validation = {
'id': {'readonly': True},
'type': {'readonly': True},
'name': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'name': {'key': 'name', 'type': 'LocalizableString'},
'timespan': {'key': 'properties.timespan', 'type': 'str'},
'interval': {'key': 'properties.interval', 'type': 'duration'},
'aggregation': {'key': 'properties.aggregation', 'type': 'str'},
'timestamps': {'key': 'properties.timestamps', 'type': '[iso-8601]'},
'baseline': {'key': 'properties.baseline', 'type': '[Baseline]'},
'metadata': {'key': 'properties.metadata', 'type': '[BaselineMetadataValue]'},
}

def __init__(self, timespan=None, interval=None, aggregation=None, timestamps=None, baseline=None, metadata=None):
super(BaselineResponse, self).__init__()
self.id = None
self.type = None
self.name = None
self.timespan = timespan
self.interval = interval
self.aggregation = aggregation
self.timestamps = timestamps
self.baseline = baseline
self.metadata = metadata
Original file line number Diff line number Diff line change
@@ -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 CalculateBaselineResponse(Model):
"""The response to a calcualte baseline call.

:param type: the resource type of the baseline resource.
:type type: str
:param timestamps: the array of timestamps of the baselines.
:type timestamps: list[datetime]
:param baseline: the baseline values for each sensitivity.
:type baseline: list[~azure.mgmt.monitor.models.Baseline]
"""

_validation = {
'type': {'required': True},
'baseline': {'required': True},
}

_attribute_map = {
'type': {'key': 'type', 'type': 'str'},
'timestamps': {'key': 'timestamps', 'type': '[iso-8601]'},
'baseline': {'key': 'baseline', 'type': '[Baseline]'},
}

def __init__(self, type, baseline, timestamps=None):
super(CalculateBaselineResponse, self).__init__()
self.type = type
self.timestamps = timestamps
self.baseline = baseline
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ class DiagnosticSettingsCategoryResourceCollection(Model):
}

def __init__(self, value=None):
super(DiagnosticSettingsCategoryResourceCollection, self).__init__()
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ class DiagnosticSettingsResourceCollection(Model):
}

def __init__(self, value=None):
super(DiagnosticSettingsResourceCollection, self).__init__()
self.value = value
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class EmailNotification(Model):
}

def __init__(self, send_to_subscription_administrator=None, send_to_subscription_co_administrators=None, custom_emails=None):
super(EmailNotification, self).__init__()
self.send_to_subscription_administrator = send_to_subscription_administrator
self.send_to_subscription_co_administrators = send_to_subscription_co_administrators
self.custom_emails = custom_emails
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class EmailReceiver(Model):
}

def __init__(self, name, email_address):
super(EmailReceiver, self).__init__()
self.name = name
self.email_address = email_address
self.status = None
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ class EnableRequest(Model):
}

def __init__(self, receiver_name):
super(EnableRequest, self).__init__()
self.receiver_name = receiver_name
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class ErrorResponse(Model):
}

def __init__(self, code=None, message=None):
super(ErrorResponse, self).__init__()
self.code = code
self.message = message

Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ class EventData(Model):
}

def __init__(self, level, event_timestamp, submission_timestamp, authorization=None, claims=None, caller=None, description=None, id=None, event_data_id=None, correlation_id=None, event_name=None, category=None, http_request=None, resource_group_name=None, resource_provider_name=None, resource_id=None, resource_type=None, operation_id=None, operation_name=None, properties=None, status=None, sub_status=None, subscription_id=None, tenant_id=None):
super(EventData, self).__init__()
self.authorization = authorization
self.claims = claims
self.caller = caller
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class HttpRequestInfo(Model):
}

def __init__(self, client_request_id=None, client_ip_address=None, method=None, uri=None):
super(HttpRequestInfo, self).__init__()
self.client_request_id = client_request_id
self.client_ip_address = client_ip_address
self.method = method
Expand Down
1 change: 1 addition & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/incident.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class Incident(Model):
}

def __init__(self):
super(Incident, self).__init__()
self.name = None
self.rule_name = None
self.is_active = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ class LocalizableString(Model):
}

def __init__(self, value, localized_value=None):
super(LocalizableString, self).__init__()
self.value = value
self.localized_value = localized_value
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class LogProfileResourcePatch(Model):
}

def __init__(self, locations, categories, retention_policy, tags=None, storage_account_id=None, service_bus_rule_id=None):
super(LogProfileResourcePatch, self).__init__()
self.tags = tags
self.storage_account_id = storage_account_id
self.service_bus_rule_id = service_bus_rule_id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ class LogSettings(Model):
}

def __init__(self, enabled, category=None, retention_policy=None):
super(LogSettings, self).__init__()
self.category = category
self.enabled = enabled
self.retention_policy = retention_policy
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ManagementEventAggregationCondition(Model):
}

def __init__(self, operator=None, threshold=None, window_size=None):
super(ManagementEventAggregationCondition, self).__init__()
self.operator = operator
self.threshold = threshold
self.window_size = window_size
Loading