Skip to content
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
1 change: 0 additions & 1 deletion azure-mgmt-monitor/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include *.rst
include azure_bdist_wheel.py
2 changes: 1 addition & 1 deletion azure-mgmt-monitor/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion azure-mgmt-monitor/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
15 changes: 15 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,9 @@
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):
Expand Down Expand Up @@ -196,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 @@ -205,6 +212,9 @@
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
Expand Down Expand Up @@ -331,6 +341,8 @@
'MetricDimension',
'MetricCriteria',
'MetricAlertSingleResourceMultipleMetricCriteria',
'MultiMetricCriteria',
'MetricAlertMultipleResourceMultipleMetricCriteria',
'Source',
'Schedule',
'Action',
Expand All @@ -340,6 +352,9 @@
'TriggerCondition',
'AzNsActionGroup',
'AlertingAction',
'Dimension',
'Criteria',
'LogToMetricAction',
'MetricNamespaceName',
'MetricNamespace',
'AutoscaleSettingResourcePaged',
Expand Down
4 changes: 2 additions & 2 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Action(Model):
"""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
4 changes: 2 additions & 2 deletions azure-mgmt-monitor/azure/mgmt/monitor/models/action_py3.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Action(Model):
"""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
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
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class LogSearchRuleResource(Resource):
~azure.mgmt.monitor.models.ProvisioningState
:param source: Required. Data Source against which rule will Query Data
:type source: ~azure.mgmt.monitor.models.Source
:param schedule: Required. Schedule (Frequnecy, Time Window) for rule.
:param schedule: Schedule (Frequnecy, Time Window) for rule. Required for
action type - AlertingAction
:type schedule: ~azure.mgmt.monitor.models.Schedule
:param action: Required. Action needs to be taken on rule execution.
:type action: ~azure.mgmt.monitor.models.Action
Expand All @@ -58,7 +59,6 @@ class LogSearchRuleResource(Resource):
'last_updated_time': {'readonly': True},
'provisioning_state': {'readonly': True},
'source': {'required': True},
'schedule': {'required': True},
'action': {'required': True},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ class LogSearchRuleResource(Resource):
~azure.mgmt.monitor.models.ProvisioningState
:param source: Required. Data Source against which rule will Query Data
:type source: ~azure.mgmt.monitor.models.Source
:param schedule: Required. Schedule (Frequnecy, Time Window) for rule.
:param schedule: Schedule (Frequnecy, Time Window) for rule. Required for
action type - AlertingAction
:type schedule: ~azure.mgmt.monitor.models.Schedule
:param action: Required. Action needs to be taken on rule execution.
:type action: ~azure.mgmt.monitor.models.Action
Expand All @@ -58,7 +59,6 @@ class LogSearchRuleResource(Resource):
'last_updated_time': {'readonly': True},
'provisioning_state': {'readonly': True},
'source': {'required': True},
'schedule': {'required': True},
'action': {'required': True},
}

Expand All @@ -77,7 +77,7 @@ class LogSearchRuleResource(Resource):
'action': {'key': 'properties.action', 'type': 'Action'},
}

def __init__(self, *, location: str, source, schedule, action, tags=None, description: str=None, enabled=None, **kwargs) -> None:
def __init__(self, *, location: str, source, action, tags=None, description: str=None, enabled=None, schedule=None, **kwargs) -> None:
super(LogSearchRuleResource, self).__init__(location=location, tags=tags, **kwargs)
self.description = description
self.enabled = enabled
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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 .action import Action


class LogToMetricAction(Action):
"""Specifiy action need to be taken when rule type is converting log to
metric.

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

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

_validation = {
'odatatype': {'required': True},
'criteria': {'required': True},
}

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

def __init__(self, **kwargs):
super(LogToMetricAction, self).__init__(**kwargs)
self.criteria = kwargs.get('criteria', None)
self.odatatype = 'Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction'
Loading