Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: AzureSDKAutomation/azure-sdk-for-python
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 14378e8d7a9d9103f8e6f2f4b1aac536e282b5b3
Choose a base ref
..
head repository: AzureSDKAutomation/azure-sdk-for-python
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3c9e756225cc5656d99ab6a56464c5f6345aa642
Choose a head ref
Showing with 1,004 additions and 4 deletions.
  1. +12 −0 eng/common/pipelines/templates/steps/daily-dev-build-variable.yml
  2. +1 −1 eng/pipelines/templates/steps/set-dev-build.yml
  3. +5 −1 sdk/core/azure-core/azure/core/polling/_poller.py
  4. +8 −0 sdk/monitor/azure-mgmt-monitor/CHANGELOG.md
  5. +17 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/_monitor_management_client.py
  6. +5 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/__init__.py
  7. +48 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models.py
  8. +49 −1 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_models_py3.py
  9. +6 −0 ...itor/azure-mgmt-monitor/azure/mgmt/monitor/v2015_04_01/models/_monitor_management_client_enums.py
  10. +19 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/__init__.py
  11. +43 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_configuration.py
  12. +47 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/_monitor_management_client.py
  13. +30 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/__init__.py
  14. +183 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models.py
  15. +183 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_models_py3.py
  16. +27 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/models/_paged_models.py
  17. +16 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/operations/__init__.py
  18. +291 −0 ...e/mgmt/monitor/v2020_01_01_preview/operations/_management_group_diagnostic_settings_operations.py
  19. +13 −0 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2020_01_01_preview/version.py
  20. +1 −1 sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/version.py
12 changes: 12 additions & 0 deletions eng/common/pipelines/templates/steps/daily-dev-build-variable.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# This script fragment is used across our repos to set a variable "SetDevVersion" which
# is used when this pipeline is going to be generating and publishing daily dev builds.

steps:
- pwsh: |
$setDailyDevBuild = "false"
if (('$(Build.Reason)' -eq 'Schedule') -and ('$(System.TeamProject)' -eq 'internal')) {
$setDailyDevBuild = "true"
}
echo "##vso[task.setvariable variable=SetDevVersion]$setDailyDevBuild"
displayName: "Setup Versioning Properties"
condition: eq(variables['SetDevVersion'], '')
2 changes: 1 addition & 1 deletion eng/pipelines/templates/steps/set-dev-build.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ parameters:
ServiceDirectory: ''

steps:
- template: tools/daily-dev-build-variable/daily-dev-build-variable.yml@azure-sdk-tools
- template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml

- task: PythonScript@0
condition: eq(variables['SetDevVersion'],'true')
6 changes: 5 additions & 1 deletion sdk/core/azure-core/azure/core/polling/_poller.py
Original file line number Diff line number Diff line change
@@ -31,11 +31,15 @@
except ImportError:
from urllib.parse import urlparse

from typing import Any, Callable, Union, List, Optional, Tuple, TypeVar, Generic
from typing import TYPE_CHECKING, TypeVar, Generic
from azure.core.pipeline.transport._base import HttpResponse
from azure.core.tracing.decorator import distributed_trace
from azure.core.tracing.common import with_current_context

if TYPE_CHECKING:
from typing import Any, Callable, Union, List, Optional, Tuple


PollingReturnType = TypeVar("PollingReturnType")


8 changes: 8 additions & 0 deletions sdk/monitor/azure-mgmt-monitor/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Release History

## 0.11.0 (2020-07-15)

**Features**

- Model MetricTrigger has a new parameter metric_namespace
- Model MetricTrigger has a new parameter dimensions
- Added operation group ManagementGroupDiagnosticSettingsOperations

## 0.10.0 (2020-06-08)

**Features**
Original file line number Diff line number Diff line change
@@ -116,6 +116,7 @@ def models(cls, api_version=DEFAULT_API_VERSION):
* 2019-03-01: :mod:`v2019_03_01.models<azure.mgmt.monitor.v2019_03_01.models>`
* 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>`
"""
if api_version == '2015-04-01':
from .v2015_04_01 import models
@@ -171,6 +172,9 @@ def models(cls, api_version=DEFAULT_API_VERSION):
elif api_version == '2019-10-17-preview':
from .v2019_10_17 import models
return models
elif api_version == '2020-01-01-preview':
from .v2020_01_01_preview import models
return models
raise NotImplementedError("APIVersion {} is not available".format(api_version))

@property
@@ -370,6 +374,19 @@ def log_profiles(self):
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)))

@property
def management_group_diagnostic_settings(self):
"""Instance depends on the API version:
* 2020-01-01-preview: :class:`ManagementGroupDiagnosticSettingsOperations<azure.mgmt.monitor.v2020_01_01_preview.operations.ManagementGroupDiagnosticSettingsOperations>`
"""
api_version = self._get_api_version('management_group_diagnostic_settings')
if api_version == '2020-01-01-preview':
from .v2020_01_01_preview.operations import ManagementGroupDiagnosticSettingsOperations 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)))

@property
def metric_alerts(self):
"""Instance depends on the API version:
Original file line number Diff line number Diff line change
@@ -29,6 +29,7 @@
from ._models_py3 import ScaleAction
from ._models_py3 import ScaleCapacity
from ._models_py3 import ScaleRule
from ._models_py3 import ScaleRuleMetricDimension
from ._models_py3 import SenderAuthorization
from ._models_py3 import TimeWindow
from ._models_py3 import WebhookNotification
@@ -52,6 +53,7 @@
from ._models import ScaleAction
from ._models import ScaleCapacity
from ._models import ScaleRule
from ._models import ScaleRuleMetricDimension
from ._models import SenderAuthorization
from ._models import TimeWindow
from ._models import WebhookNotification
@@ -63,6 +65,7 @@
MetricStatisticType,
TimeAggregationType,
ComparisonOperationType,
ScaleRuleMetricDimensionOperationType,
ScaleDirection,
ScaleType,
RecurrenceFrequency,
@@ -88,6 +91,7 @@
'ScaleAction',
'ScaleCapacity',
'ScaleRule',
'ScaleRuleMetricDimension',
'SenderAuthorization',
'TimeWindow',
'WebhookNotification',
@@ -98,6 +102,7 @@
'MetricStatisticType',
'TimeAggregationType',
'ComparisonOperationType',
'ScaleRuleMetricDimensionOperationType',
'ScaleDirection',
'ScaleType',
'RecurrenceFrequency',
Original file line number Diff line number Diff line change
@@ -559,6 +559,9 @@ class MetricTrigger(Model):
:param metric_name: Required. the name of the metric that defines what the
rule monitors.
:type metric_name: str
:param metric_namespace: the namespace of the metric that defines what the
rule monitors.
:type metric_namespace: str
:param metric_resource_uri: Required. the resource identifier of the
resource the rule monitors.
:type metric_resource_uri: str
@@ -590,6 +593,10 @@ class MetricTrigger(Model):
:param threshold: Required. the threshold of the metric that triggers the
scale action.
:type threshold: float
:param dimensions: List of dimension conditions. For example:
[{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
:type dimensions:
list[~azure.mgmt.monitor.v2015_04_01.models.ScaleRuleMetricDimension]
"""

_validation = {
@@ -605,25 +612,29 @@ class MetricTrigger(Model):

_attribute_map = {
'metric_name': {'key': 'metricName', 'type': 'str'},
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'},
'time_grain': {'key': 'timeGrain', 'type': 'duration'},
'statistic': {'key': 'statistic', 'type': 'MetricStatisticType'},
'time_window': {'key': 'timeWindow', 'type': 'duration'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationType'},
'operator': {'key': 'operator', 'type': 'ComparisonOperationType'},
'threshold': {'key': 'threshold', 'type': 'float'},
'dimensions': {'key': 'dimensions', 'type': '[ScaleRuleMetricDimension]'},
}

def __init__(self, **kwargs):
super(MetricTrigger, self).__init__(**kwargs)
self.metric_name = kwargs.get('metric_name', None)
self.metric_namespace = kwargs.get('metric_namespace', None)
self.metric_resource_uri = kwargs.get('metric_resource_uri', None)
self.time_grain = kwargs.get('time_grain', None)
self.statistic = kwargs.get('statistic', None)
self.time_window = kwargs.get('time_window', None)
self.time_aggregation = kwargs.get('time_aggregation', None)
self.operator = kwargs.get('operator', None)
self.threshold = kwargs.get('threshold', None)
self.dimensions = kwargs.get('dimensions', None)


class Operation(Model):
@@ -918,6 +929,43 @@ def __init__(self, **kwargs):
self.scale_action = kwargs.get('scale_action', None)


class ScaleRuleMetricDimension(Model):
"""Specifies an auto scale rule metric dimension.
All required parameters must be populated in order to send to Azure.
:param dimension_name: Required. Name of the dimension.
:type dimension_name: str
:param operator: Required. the dimension operator. Only 'Equals' and
'NotEquals' are supported. 'Equals' being equal to any of the values.
'NotEquals' being not equal to all of the values. Possible values include:
'Equals', 'NotEquals'
:type operator: str or
~azure.mgmt.monitor.v2015_04_01.models.ScaleRuleMetricDimensionOperationType
:param values: Required. list of dimension values. For example:
["App1","App2"].
:type values: list[str]
"""

_validation = {
'dimension_name': {'required': True},
'operator': {'required': True},
'values': {'required': True},
}

_attribute_map = {
'dimension_name': {'key': 'DimensionName', 'type': 'str'},
'operator': {'key': 'Operator', 'type': 'str'},
'values': {'key': 'Values', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(ScaleRuleMetricDimension, self).__init__(**kwargs)
self.dimension_name = kwargs.get('dimension_name', None)
self.operator = kwargs.get('operator', None)
self.values = kwargs.get('values', None)


class SenderAuthorization(Model):
"""the authorization used by the user who has performed the operation that led
to this event. This captures the RBAC properties of the event. These
Original file line number Diff line number Diff line change
@@ -559,6 +559,9 @@ class MetricTrigger(Model):
:param metric_name: Required. the name of the metric that defines what the
rule monitors.
:type metric_name: str
:param metric_namespace: the namespace of the metric that defines what the
rule monitors.
:type metric_namespace: str
:param metric_resource_uri: Required. the resource identifier of the
resource the rule monitors.
:type metric_resource_uri: str
@@ -590,6 +593,10 @@ class MetricTrigger(Model):
:param threshold: Required. the threshold of the metric that triggers the
scale action.
:type threshold: float
:param dimensions: List of dimension conditions. For example:
[{"DimensionName":"AppName","Operator":"Equals","Values":["App1"]},{"DimensionName":"Deployment","Operator":"Equals","Values":["default"]}].
:type dimensions:
list[~azure.mgmt.monitor.v2015_04_01.models.ScaleRuleMetricDimension]
"""

_validation = {
@@ -605,25 +612,29 @@ class MetricTrigger(Model):

_attribute_map = {
'metric_name': {'key': 'metricName', 'type': 'str'},
'metric_namespace': {'key': 'metricNamespace', 'type': 'str'},
'metric_resource_uri': {'key': 'metricResourceUri', 'type': 'str'},
'time_grain': {'key': 'timeGrain', 'type': 'duration'},
'statistic': {'key': 'statistic', 'type': 'MetricStatisticType'},
'time_window': {'key': 'timeWindow', 'type': 'duration'},
'time_aggregation': {'key': 'timeAggregation', 'type': 'TimeAggregationType'},
'operator': {'key': 'operator', 'type': 'ComparisonOperationType'},
'threshold': {'key': 'threshold', 'type': 'float'},
'dimensions': {'key': 'dimensions', 'type': '[ScaleRuleMetricDimension]'},
}

def __init__(self, *, metric_name: str, metric_resource_uri: str, time_grain, statistic, time_window, time_aggregation, operator, threshold: float, **kwargs) -> None:
def __init__(self, *, metric_name: str, metric_resource_uri: str, time_grain, statistic, time_window, time_aggregation, operator, threshold: float, metric_namespace: str=None, dimensions=None, **kwargs) -> None:
super(MetricTrigger, self).__init__(**kwargs)
self.metric_name = metric_name
self.metric_namespace = metric_namespace
self.metric_resource_uri = metric_resource_uri
self.time_grain = time_grain
self.statistic = statistic
self.time_window = time_window
self.time_aggregation = time_aggregation
self.operator = operator
self.threshold = threshold
self.dimensions = dimensions


class Operation(Model):
@@ -918,6 +929,43 @@ def __init__(self, *, metric_trigger, scale_action, **kwargs) -> None:
self.scale_action = scale_action


class ScaleRuleMetricDimension(Model):
"""Specifies an auto scale rule metric dimension.
All required parameters must be populated in order to send to Azure.
:param dimension_name: Required. Name of the dimension.
:type dimension_name: str
:param operator: Required. the dimension operator. Only 'Equals' and
'NotEquals' are supported. 'Equals' being equal to any of the values.
'NotEquals' being not equal to all of the values. Possible values include:
'Equals', 'NotEquals'
:type operator: str or
~azure.mgmt.monitor.v2015_04_01.models.ScaleRuleMetricDimensionOperationType
:param values: Required. list of dimension values. For example:
["App1","App2"].
:type values: list[str]
"""

_validation = {
'dimension_name': {'required': True},
'operator': {'required': True},
'values': {'required': True},
}

_attribute_map = {
'dimension_name': {'key': 'DimensionName', 'type': 'str'},
'operator': {'key': 'Operator', 'type': 'str'},
'values': {'key': 'Values', 'type': '[str]'},
}

def __init__(self, *, dimension_name: str, operator, values, **kwargs) -> None:
super(ScaleRuleMetricDimension, self).__init__(**kwargs)
self.dimension_name = dimension_name
self.operator = operator
self.values = values


class SenderAuthorization(Model):
"""the authorization used by the user who has performed the operation that led
to this event. This captures the RBAC properties of the event. These
Original file line number Diff line number Diff line change
@@ -49,6 +49,12 @@ class ComparisonOperationType(str, Enum):
less_than_or_equal = "LessThanOrEqual"


class ScaleRuleMetricDimensionOperationType(str, Enum):

equals = "Equals"
not_equals = "NotEquals"


class ScaleDirection(str, Enum):

none = "None"
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 MonitorManagementClientConfiguration
from ._monitor_management_client import MonitorManagementClient
__all__ = ['MonitorManagementClient', 'MonitorManagementClientConfiguration']

from .version import VERSION

__version__ = VERSION

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 msrestazure import AzureConfiguration

from .version import VERSION


class MonitorManagementClientConfiguration(AzureConfiguration):
"""Configuration for MonitorManagementClient
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 str base_url: Service URL
"""

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

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

super(MonitorManagementClientConfiguration, 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
Loading