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

[ReleasePR azure-mgmt-monitor] Update readme files with Hybrid2020 Profile #14883

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
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-06-01: :mod:`v2019_06_01.models<azure.mgmt.monitor.v2019_06_01.models>`
* 2019-10-17-preview: :mod:`v2019_10_17.models<azure.mgmt.monitor.v2019_10_17.models>`
* 2020-01-01-preview: :mod:`v2020_01_01_preview.models<azure.mgmt.monitor.v2020_01_01_preview.models>`
* 2020-05-01-preview: :mod:`v2020_05_01_preview.models<azure.mgmt.monitor.v2020_05_01_preview.models>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
Expand Down Expand Up @@ -175,6 +176,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2020-01-01-preview':
from .v2020_01_01_preview import models
return models
elif api_version == '2020-05-01-preview':
from .v2020_05_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
Expand Down Expand Up @@ -563,10 +567,13 @@ def scheduled_query_rules(self):
"""Instance depends on the API version:

* 2018-04-16: :class:`ScheduledQueryRulesOperations<azure.mgmt.monitor.v2018_04_16.operations.ScheduledQueryRulesOperations>`
* 2020-05-01-preview: :class:`ScheduledQueryRulesOperations<azure.mgmt.monitor.v2020_05_01_preview.operations.ScheduledQueryRulesOperations>`
"""
api_version = self._get_api_version('scheduled_query_rules')
if api_version == '2018-04-16':
from .v2018_04_16.operations import ScheduledQueryRulesOperations as OperationClass
elif api_version == '2020-05-01-preview':
from .v2020_05_01_preview.operations import ScheduledQueryRulesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ class MultiMetricCriteria(Model):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
"""
Expand All @@ -350,6 +354,7 @@ class MultiMetricCriteria(Model):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
}

Expand All @@ -365,6 +370,7 @@ def __init__(self, **kwargs):
self.metric_namespace = kwargs.get('metric_namespace', None)
self.time_aggregation = kwargs.get('time_aggregation', None)
self.dimensions = kwargs.get('dimensions', None)
self.skip_metric_validation = kwargs.get('skip_metric_validation', None)
self.criterion_type = None


Expand All @@ -387,6 +393,10 @@ class DynamicMetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. The operator used to compare the metric value
Expand Down Expand Up @@ -427,6 +437,7 @@ class DynamicMetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'},
Expand Down Expand Up @@ -1057,6 +1068,10 @@ class MetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. the criteria operator. Possible values include:
Expand Down Expand Up @@ -1084,6 +1099,7 @@ class MetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'threshold': {'key': 'threshold', 'type': 'float'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,10 @@ class MultiMetricCriteria(Model):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
"""
Expand All @@ -350,21 +354,23 @@ class MultiMetricCriteria(Model):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
}

_subtype_map = {
'criterion_type': {'StaticThresholdCriterion': 'MetricCriteria', 'DynamicThresholdCriterion': 'DynamicMetricCriteria'}
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None:
def __init__(self, *, name: str, metric_name: str, time_aggregation, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, **kwargs) -> None:
super(MultiMetricCriteria, self).__init__(**kwargs)
self.additional_properties = additional_properties
self.name = name
self.metric_name = metric_name
self.metric_namespace = metric_namespace
self.time_aggregation = time_aggregation
self.dimensions = dimensions
self.skip_metric_validation = skip_metric_validation
self.criterion_type = None


Expand All @@ -387,6 +393,10 @@ class DynamicMetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. The operator used to compare the metric value
Expand Down Expand Up @@ -427,15 +437,16 @@ class DynamicMetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'alert_sensitivity': {'key': 'alertSensitivity', 'type': 'str'},
'failing_periods': {'key': 'failingPeriods', 'type': 'DynamicThresholdFailingPeriods'},
'ignore_data_before': {'key': 'ignoreDataBefore', 'type': 'iso-8601'},
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, alert_sensitivity, failing_periods, additional_properties=None, metric_namespace: str=None, dimensions=None, ignore_data_before=None, **kwargs) -> None:
super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs)
def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, alert_sensitivity, failing_periods, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, ignore_data_before=None, **kwargs) -> None:
super(DynamicMetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs)
self.operator = operator
self.alert_sensitivity = alert_sensitivity
self.failing_periods = failing_periods
Expand Down Expand Up @@ -1057,6 +1068,10 @@ class MetricCriteria(MultiMetricCriteria):
:param dimensions: List of dimension conditions.
:type dimensions:
list[~azure.mgmt.monitor.v2018_03_01.models.MetricDimension]
:param skip_metric_validation: Allows creating an alert rule on a custom
metric that isn't yet emitted, by causing the metric validation to be
skipped.
:type skip_metric_validation: bool
:param criterion_type: Required. Constant filled by server.
:type criterion_type: str
:param operator: Required. the criteria operator. Possible values include:
Expand Down Expand Up @@ -1084,13 +1099,14 @@ class MetricCriteria(MultiMetricCriteria):
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'object'},
'dimensions': {'key': 'dimensions', 'type': '[MetricDimension]'},
'skip_metric_validation': {'key': 'skipMetricValidation', 'type': 'bool'},
'criterion_type': {'key': 'criterionType', 'type': 'str'},
'operator': {'key': 'operator', 'type': 'str'},
'threshold': {'key': 'threshold', 'type': 'float'},
}

def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, threshold: float, additional_properties=None, metric_namespace: str=None, dimensions=None, **kwargs) -> None:
super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, **kwargs)
def __init__(self, *, name: str, metric_name: str, time_aggregation, operator, threshold: float, additional_properties=None, metric_namespace: str=None, dimensions=None, skip_metric_validation: bool=None, **kwargs) -> None:
super(MetricCriteria, self).__init__(additional_properties=additional_properties, name=name, metric_name=metric_name, metric_namespace=metric_namespace, time_aggregation=time_aggregation, dimensions=dimensions, skip_metric_validation=skip_metric_validation, **kwargs)
self.operator = operator
self.threshold = threshold
self.criterion_type = 'StaticThresholdCriterion'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ._configuration import MonitorClientConfiguration
from ._monitor_client import MonitorClient
__all__ = ['MonitorClient', 'MonitorClientConfiguration']

from .version import VERSION

__version__ = VERSION

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# 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 msrestazure import AzureConfiguration

from .version import VERSION


class MonitorClientConfiguration(AzureConfiguration):
"""Configuration for MonitorClient
Note that all parameters used to create this instance are saved as instance
attributes.

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

if credentials is None:
raise ValueError("Parameter 'credentials' must not be None.")
if subscription_id is None:
raise ValueError("Parameter 'subscription_id' must not be None.")
if not base_url:
base_url = 'https://management.azure.com'

super(MonitorClientConfiguration, self).__init__(base_url)

# Starting Autorest.Python 4.0.64, make connection pool activated by default
self.keep_alive = True

self.add_user_agent('azure-mgmt-monitor/{}'.format(VERSION))
self.add_user_agent('Azure-SDK-For-Python')

self.credentials = credentials
self.subscription_id = subscription_id
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.service_client import SDKClient
from msrest import Serializer, Deserializer

from ._configuration import MonitorClientConfiguration
from .operations import ScheduledQueryRulesOperations
from . import models


class MonitorClient(SDKClient):
"""Monitor Management Client

:ivar config: Configuration for client.
:vartype config: MonitorClientConfiguration

:ivar scheduled_query_rules: ScheduledQueryRules operations
:vartype scheduled_query_rules: azure.mgmt.monitor.v2020_05_01_preview.operations.ScheduledQueryRulesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
object<msrestazure.azure_active_directory>`
:param subscription_id: The Azure subscription Id.
:type subscription_id: str
:param str base_url: Service URL
"""

def __init__(
self, credentials, subscription_id, base_url=None):

self.config = MonitorClientConfiguration(credentials, subscription_id, base_url)
super(MonitorClient, 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 = '2020-05-01-preview'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

self.scheduled_query_rules = ScheduledQueryRulesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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.
# --------------------------------------------------------------------------

try:
from ._models_py3 import Action
from ._models_py3 import AzureEntityResource
from ._models_py3 import Condition
from ._models_py3 import ConditionFailingPeriods
from ._models_py3 import Dimension
from ._models_py3 import ErrorAdditionalInfo
from ._models_py3 import ErrorContract, ErrorContractException
from ._models_py3 import ErrorResponse
from ._models_py3 import ProxyResource
from ._models_py3 import Resource
from ._models_py3 import ScheduledQueryRuleCriteria
from ._models_py3 import ScheduledQueryRuleResource
from ._models_py3 import ScheduledQueryRuleResourcePatch
from ._models_py3 import TrackedResource
except (SyntaxError, ImportError):
from ._models import Action
from ._models import AzureEntityResource
from ._models import Condition
from ._models import ConditionFailingPeriods
from ._models import Dimension
from ._models import ErrorAdditionalInfo
from ._models import ErrorContract, ErrorContractException
from ._models import ErrorResponse
from ._models import ProxyResource
from ._models import Resource
from ._models import ScheduledQueryRuleCriteria
from ._models import ScheduledQueryRuleResource
from ._models import ScheduledQueryRuleResourcePatch
from ._models import TrackedResource
from ._paged_models import ScheduledQueryRuleResourcePaged
from ._monitor_client_enums import (
TimeAggregation,
DimensionOperator,
ConditionOperator,
)

__all__ = [
'Action',
'AzureEntityResource',
'Condition',
'ConditionFailingPeriods',
'Dimension',
'ErrorAdditionalInfo',
'ErrorContract', 'ErrorContractException',
'ErrorResponse',
'ProxyResource',
'Resource',
'ScheduledQueryRuleCriteria',
'ScheduledQueryRuleResource',
'ScheduledQueryRuleResourcePatch',
'TrackedResource',
'ScheduledQueryRuleResourcePaged',
'TimeAggregation',
'DimensionOperator',
'ConditionOperator',
]
Loading