diff --git a/.travis.yml b/.travis.yml index 4024c9308a2..beafe7170cf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ if: branch = master +dist: trusty language: java sudo: required jdk: diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlert.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlert.java index eb8b9473ba7..8bf06bbd78a 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlert.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlert.java @@ -137,14 +137,13 @@ interface Definition extends */ interface DefinitionMultipleResource extends DefinitionStages.Blank, - DefinitionStages.WithCreate, + DefinitionStages.WithCreateDynamicCondition, DefinitionStages.WithScopes, DefinitionStages.WithWindowSizeMultipleResource, DefinitionStages.WithEvaluationFrequencyMultipleResource, DefinitionStages.WithSeverityMultipleResource, DefinitionStages.WithActionGroupMultipleResource, - DefinitionStages.WithCriteriaDefinitionMultipleResource, - DefinitionStages.WithCreateDynamicCondition { + DefinitionStages.WithCriteriaDefinitionMultipleResource { } /** diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDynamicAlertCondition.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDynamicAlertCondition.java index 1d93940f929..7a15214cf7f 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDynamicAlertCondition.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDynamicAlertCondition.java @@ -322,6 +322,29 @@ interface UpdateStages { */ UpdateStages withoutDimension(String dimensionName); + /** + * Sets the failing periods for triggering the alert. + * + * @param failingPeriods the failing periods for triggering the alert. + * @return the next stage of metric alert condition definition. + */ + UpdateStages withFailingPeriods(DynamicThresholdFailingPeriods failingPeriods); + + /** + * Sets the date from which to start learning the metric historical data and calculate the dynamic thresholds. + * + * @param date the date from which to start learning the metric historical data and calculate the dynamic thresholds. + * @return the next stage of metric alert condition definition. + */ + UpdateStages withIgnoreDataBefore(DateTime date); + + /** + * Removes the date from which to start learning the metric historical data and calculate the dynamic thresholds. + * + * @return the next stage of the metric alert condition update. + */ + UpdateStages withoutIgnoreDataBefore(); + /** * Returns back to the metric alert update flow. * diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertImpl.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertImpl.java index 6ac51077d84..f14fee8853d 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertImpl.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertImpl.java @@ -295,15 +295,15 @@ public MetricAlertImpl withMultipleTargetResources(Collection resourceIds = new ArrayList<>(); String type = resources.iterator().next().type(); - String region = resources.iterator().next().regionName(); + String regionName = resources.iterator().next().regionName(); for (Resource resource : resources) { - if (!type.equalsIgnoreCase(resource.type()) || !region.equalsIgnoreCase(resource.regionName())) { - throw new IllegalArgumentException("Target resource must be of same resource type and in same region"); + if (!type.equalsIgnoreCase(resource.type()) || !regionName.equalsIgnoreCase(resource.regionName())) { + throw new IllegalArgumentException("Target resource must be of the same resource type and in the same region"); } resourceIds.add(resource.id()); } - return this.withMultipleTargetResources(resourceIds, type, region); + return this.withMultipleTargetResources(resourceIds, type, regionName); } @Override diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricDynamicAlertConditionImpl.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricDynamicAlertConditionImpl.java index ea8df0184b7..f371aee3622 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricDynamicAlertConditionImpl.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricDynamicAlertConditionImpl.java @@ -91,4 +91,10 @@ public MetricDynamicAlertConditionImpl withIgnoreDataBefore(DateTime date) { this.inner().withIgnoreDataBefore(date); return this; } + + @Override + public MetricDynamicAlertConditionImpl withoutIgnoreDataBefore() { + this.inner().withIgnoreDataBefore(null); + return this; + } }