Skip to content
Closed
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
23 changes: 23 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
from .metric_dimension_py3 import MetricDimension
from .metric_criteria_py3 import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria_py3 import MetricAlertSingleResourceMultipleMetricCriteria
from .multi_metric_criteria_py3 import MultiMetricCriteria
from .metric_alert_multiple_resource_multiple_metric_criteria_py3 import MetricAlertMultipleResourceMultipleMetricCriteria
from .source_py3 import Source
from .schedule_py3 import Schedule
from .action_py3 import Action
Expand All @@ -106,6 +108,11 @@
from .trigger_condition_py3 import TriggerCondition
from .az_ns_action_group_py3 import AzNsActionGroup
from .alerting_action_py3 import AlertingAction
from .dimension_py3 import Dimension
from .criteria_py3 import Criteria
from .log_to_metric_action_py3 import LogToMetricAction
from .metric_namespace_name_py3 import MetricNamespaceName
from .metric_namespace_py3 import MetricNamespace
except (SyntaxError, ImportError):
from .resource import Resource
from .scale_capacity import ScaleCapacity
Expand Down Expand Up @@ -194,6 +201,8 @@
from .metric_dimension import MetricDimension
from .metric_criteria import MetricCriteria
from .metric_alert_single_resource_multiple_metric_criteria import MetricAlertSingleResourceMultipleMetricCriteria
from .multi_metric_criteria import MultiMetricCriteria
from .metric_alert_multiple_resource_multiple_metric_criteria import MetricAlertMultipleResourceMultipleMetricCriteria
from .source import Source
from .schedule import Schedule
from .action import Action
Expand All @@ -203,6 +212,11 @@
from .trigger_condition import TriggerCondition
from .az_ns_action_group import AzNsActionGroup
from .alerting_action import AlertingAction
from .dimension import Dimension
from .criteria import Criteria
from .log_to_metric_action import LogToMetricAction
from .metric_namespace_name import MetricNamespaceName
from .metric_namespace import MetricNamespace
from .autoscale_setting_resource_paged import AutoscaleSettingResourcePaged
from .incident_paged import IncidentPaged
from .alert_rule_resource_paged import AlertRuleResourcePaged
Expand All @@ -214,6 +228,7 @@
from .metric_definition_paged import MetricDefinitionPaged
from .metric_alert_resource_paged import MetricAlertResourcePaged
from .log_search_rule_resource_paged import LogSearchRuleResourcePaged
from .metric_namespace_paged import MetricNamespacePaged
from .monitor_management_client_enums import (
MetricStatisticType,
TimeAggregationType,
Expand Down Expand Up @@ -326,6 +341,8 @@
'MetricDimension',
'MetricCriteria',
'MetricAlertSingleResourceMultipleMetricCriteria',
'MultiMetricCriteria',
'MetricAlertMultipleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'Action',
Expand All @@ -335,6 +352,11 @@
'TriggerCondition',
'AzNsActionGroup',
'AlertingAction',
'Dimension',
'Criteria',
'LogToMetricAction',
'MetricNamespaceName',
'MetricNamespace',
'AutoscaleSettingResourcePaged',
'IncidentPaged',
'AlertRuleResourcePaged',
Expand All @@ -346,6 +368,7 @@
'MetricDefinitionPaged',
'MetricAlertResourcePaged',
'LogSearchRuleResourcePaged',
'MetricNamespacePaged',
'MetricStatisticType',
'TimeAggregationType',
'ComparisonOperationType',
Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@


class Action(Model):
"""Action.
"""Action descriptor.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction
sub-classes are: AlertingAction, LogToMetricAction

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

Expand All @@ -33,7 +33,7 @@ class Action(Model):
}

_subtype_map = {
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction'}
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction', 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction': 'LogToMetricAction'}
}

def __init__(self, **kwargs):
Expand Down
6 changes: 3 additions & 3 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@


class Action(Model):
"""Action.
"""Action descriptor.

You probably want to use the sub-classes and not this class directly. Known
sub-classes are: AlertingAction
sub-classes are: AlertingAction, LogToMetricAction

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

Expand All @@ -33,7 +33,7 @@ class Action(Model):
}

_subtype_map = {
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction'}
'odatatype': {'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction': 'AlertingAction', 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction': 'LogToMetricAction'}
}

def __init__(self, **kwargs) -> None:
Expand Down
38 changes: 38 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/criteria.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 Criteria(Model):
"""Specifies the criteria for converting log to metric.

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

:param metric_name: Required. Name of the metric
:type metric_name: str
:param dimensions: List of Dimensions for creating metric
:type dimensions: list[~azure.mgmt.monitor.models.Dimension]
"""

_validation = {
'metric_name': {'required': True},
}

_attribute_map = {
'metric_name': {'key': 'metricName', 'type': 'str'},
'dimensions': {'key': 'dimensions', 'type': '[Dimension]'},
}

def __init__(self, **kwargs):
super(Criteria, self).__init__(**kwargs)
self.metric_name = kwargs.get('metric_name', None)
self.dimensions = kwargs.get('dimensions', None)
38 changes: 38 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/criteria_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 Criteria(Model):
"""Specifies the criteria for converting log to metric.

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

:param metric_name: Required. Name of the metric
:type metric_name: str
:param dimensions: List of Dimensions for creating metric
:type dimensions: list[~azure.mgmt.monitor.models.Dimension]
"""

_validation = {
'metric_name': {'required': True},
}

_attribute_map = {
'metric_name': {'key': 'metricName', 'type': 'str'},
'dimensions': {'key': 'dimensions', 'type': '[Dimension]'},
}

def __init__(self, *, metric_name: str, dimensions=None, **kwargs) -> None:
super(Criteria, self).__init__(**kwargs)
self.metric_name = metric_name
self.dimensions = dimensions
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
:param storage_account_id: The resource ID of the storage account to which
you would like to send Diagnostic Logs.
:type storage_account_id: str
:param service_bus_rule_id: The service bus rule Id of the diagnostic
setting. This is here to maintain backwards compatibility.
:type service_bus_rule_id: str
:param event_hub_authorization_rule_id: The resource Id for the event hub
authorization rule.
:type event_hub_authorization_rule_id: str
Expand Down Expand Up @@ -55,6 +58,7 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'},
'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'},
'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'},
'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'},
'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'},
Expand All @@ -65,6 +69,7 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
def __init__(self, **kwargs):
super(DiagnosticSettingsResource, self).__init__(**kwargs)
self.storage_account_id = kwargs.get('storage_account_id', None)
self.service_bus_rule_id = kwargs.get('service_bus_rule_id', None)
self.event_hub_authorization_rule_id = kwargs.get('event_hub_authorization_rule_id', None)
self.event_hub_name = kwargs.get('event_hub_name', None)
self.metrics = kwargs.get('metrics', None)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
:param storage_account_id: The resource ID of the storage account to which
you would like to send Diagnostic Logs.
:type storage_account_id: str
:param service_bus_rule_id: The service bus rule Id of the diagnostic
setting. This is here to maintain backwards compatibility.
:type service_bus_rule_id: str
:param event_hub_authorization_rule_id: The resource Id for the event hub
authorization rule.
:type event_hub_authorization_rule_id: str
Expand Down Expand Up @@ -55,16 +58,18 @@ class DiagnosticSettingsResource(ProxyOnlyResource):
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'storage_account_id': {'key': 'properties.storageAccountId', 'type': 'str'},
'service_bus_rule_id': {'key': 'properties.serviceBusRuleId', 'type': 'str'},
'event_hub_authorization_rule_id': {'key': 'properties.eventHubAuthorizationRuleId', 'type': 'str'},
'event_hub_name': {'key': 'properties.eventHubName', 'type': 'str'},
'metrics': {'key': 'properties.metrics', 'type': '[MetricSettings]'},
'logs': {'key': 'properties.logs', 'type': '[LogSettings]'},
'workspace_id': {'key': 'properties.workspaceId', 'type': 'str'},
}

def __init__(self, *, storage_account_id: str=None, event_hub_authorization_rule_id: str=None, event_hub_name: str=None, metrics=None, logs=None, workspace_id: str=None, **kwargs) -> None:
def __init__(self, *, storage_account_id: str=None, service_bus_rule_id: str=None, event_hub_authorization_rule_id: str=None, event_hub_name: str=None, metrics=None, logs=None, workspace_id: str=None, **kwargs) -> None:
super(DiagnosticSettingsResource, self).__init__(**kwargs)
self.storage_account_id = storage_account_id
self.service_bus_rule_id = service_bus_rule_id
self.event_hub_authorization_rule_id = event_hub_authorization_rule_id
self.event_hub_name = event_hub_name
self.metrics = metrics
Expand Down
49 changes: 49 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/dimension.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 Dimension(Model):
"""Specifies the criteria for converting log to metric.

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

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

:param name: Required. Name of the dimension
:type name: str
:ivar operator: Required. Operator for dimension values. Default value:
"Include" .
:vartype operator: str
:param values: Required. List of dimension values
:type values: list[str]
"""

_validation = {
'name': {'required': True},
'operator': {'required': True, 'constant': True},
'values': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
}

operator = "Include"

def __init__(self, **kwargs):
super(Dimension, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
self.values = kwargs.get('values', None)
49 changes: 49 additions & 0 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/dimension_py3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# 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 Dimension(Model):
"""Specifies the criteria for converting log to metric.

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

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

:param name: Required. Name of the dimension
:type name: str
:ivar operator: Required. Operator for dimension values. Default value:
"Include" .
:vartype operator: str
:param values: Required. List of dimension values
:type values: list[str]
"""

_validation = {
'name': {'required': True},
'operator': {'required': True, 'constant': True},
'values': {'required': True},
}

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'values': {'key': 'values', 'type': '[str]'},
}

operator = "Include"

def __init__(self, *, name: str, values, **kwargs) -> None:
super(Dimension, self).__init__(**kwargs)
self.name = name
self.values = values
2 changes: 1 addition & 1 deletion azure-mgmt-monitor/azure/mgmt/monitor/models/event_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EventData(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar authorization:
:ivar authorization: The sender authorization information.
:vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization
:ivar claims: key value pairs to identify ARM permissions.
:vartype claims: dict[str, str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EventData(Model):
Variables are only populated by the server, and will be ignored when
sending a request.

:ivar authorization:
:ivar authorization: The sender authorization information.
:vartype authorization: ~azure.mgmt.monitor.models.SenderAuthorization
:ivar claims: key value pairs to identify ARM permissions.
:vartype claims: dict[str, str]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@


class LogMetricTrigger(Model):
"""LogMetricTrigger.
"""A log metrics trigger descriptor.

:param threshold_operator: Evaluation operation for Metric -'GreaterThan'
or 'LessThan' or 'Equal'. Possible values include: 'GreaterThan',
'LessThan', 'Equal'
:type threshold_operator: str or
~azure.mgmt.monitor.models.ConditionalOperator
:param threshold:
:param threshold: The threshold of the metric trigger.
:type threshold: float
:param metric_trigger_type: Metric Trigger Type - 'Consecutive' or
'Total'. Possible values include: 'Consecutive', 'Total'
Expand Down
Loading