Skip to content

Commit

Permalink
[AutoPR monitor/resource-manager] Add Multi Resource Alert changes fo…
Browse files Browse the repository at this point in the history
…r Metric Alert API (#2432)

* Generated from 09c5415be341f2a6816dafb7a504818a3c536b7e

Multi Resource Alert changes

* Generated from a88d7f44fc48e9ea0c1203b6bf10bac1b65111e4

Merge remote-tracking branch 'upstream/master'
  • Loading branch information
AutorestCI authored Oct 4, 2018
1 parent dd2ef30 commit 7866629
Show file tree
Hide file tree
Showing 7 changed files with 219 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("MetricAlertCriteria")
@JsonSubTypes({
@JsonSubTypes.Type(name = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", value = MetricAlertSingleResourceMultipleMetricCriteria.class)
@JsonSubTypes.Type(name = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", value = MetricAlertSingleResourceMultipleMetricCriteria.class),
@JsonSubTypes.Type(name = "Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria", value = MetricAlertMultipleResourceMultipleMetricCriteria.class)
})
public class MetricAlertCriteria {
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/**
* 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.
*/

package com.microsoft.azure.management.monitor;

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* Speficies the metric alert criteria for multiple resource that has multiple
* metric criteria.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("Microsoft.Azure.Monitor.MultipleResourceMultipleMetricCriteria")
public class MetricAlertMultipleResourceMultipleMetricCriteria extends MetricAlertCriteria {
/**
* the list of multiple metric criteria for this 'all of' operation.
*/
@JsonProperty(value = "allOf")
private List<MultiMetricCriteria> allOf;

/**
* Get the list of multiple metric criteria for this 'all of' operation.
*
* @return the allOf value
*/
public List<MultiMetricCriteria> allOf() {
return this.allOf;
}

/**
* Set the list of multiple metric criteria for this 'all of' operation.
*
* @param allOf the allOf value to set
* @return the MetricAlertMultipleResourceMultipleMetricCriteria object itself.
*/
public MetricAlertMultipleResourceMultipleMetricCriteria withAllOf(List<MultiMetricCriteria> allOf) {
this.allOf = allOf;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,20 @@ public class MetricAlertResourcePatch {
@JsonProperty(value = "properties.windowSize", required = true)
private Period windowSize;

/**
* the resource type of the target resource(s) on which the alert is
* created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*/
@JsonProperty(value = "properties.targetResourceType")
private String targetResourceType;

/**
* the region of the target resource(s) on which the alert is
* created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*/
@JsonProperty(value = "properties.targetResourceRegion")
private String targetResourceRegion;

/**
* defines the specific alert criteria information.
*/
Expand Down Expand Up @@ -231,6 +245,46 @@ public MetricAlertResourcePatch withWindowSize(Period windowSize) {
return this;
}

/**
* Get the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @return the targetResourceType value
*/
public String targetResourceType() {
return this.targetResourceType;
}

/**
* Set the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @param targetResourceType the targetResourceType value to set
* @return the MetricAlertResourcePatch object itself.
*/
public MetricAlertResourcePatch withTargetResourceType(String targetResourceType) {
this.targetResourceType = targetResourceType;
return this;
}

/**
* Get the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @return the targetResourceRegion value
*/
public String targetResourceRegion() {
return this.targetResourceRegion;
}

/**
* Set the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @param targetResourceRegion the targetResourceRegion value to set
* @return the MetricAlertResourcePatch object itself.
*/
public MetricAlertResourcePatch withTargetResourceRegion(String targetResourceRegion) {
this.targetResourceRegion = targetResourceRegion;
return this;
}

/**
* Get defines the specific alert criteria information.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@

import java.util.List;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* Criterion to filter metrics.
*/
public class MetricCriteria {
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType")
@JsonTypeName("StaticThresholdCriterion")
public class MetricCriteria extends MultiMetricCriteria {
/**
* Name of the criteria.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class MetricDimension {
private String name;

/**
* the dimension operator.
* the dimension operator. Only 'Include' and 'Exclude' are supported.
*/
@JsonProperty(value = "operator", required = true)
private String operator;
Expand Down Expand Up @@ -54,7 +54,7 @@ public MetricDimension withName(String name) {
}

/**
* Get the dimension operator.
* Get the dimension operator. Only 'Include' and 'Exclude' are supported.
*
* @return the operator value
*/
Expand All @@ -63,7 +63,7 @@ public String operator() {
}

/**
* Set the dimension operator.
* Set the dimension operator. Only 'Include' and 'Exclude' are supported.
*
* @param operator the operator value to set
* @return the MetricDimension object itself.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/**
* 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.
*/

package com.microsoft.azure.management.monitor;

import java.util.Map;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonSubTypes;

/**
* The types of conditions for a multi resource alert.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "criterionType")
@JsonTypeName("MultiMetricCriteria")
@JsonSubTypes({
@JsonSubTypes.Type(name = "StaticThresholdCriterion", value = MetricCriteria.class)
})
public class MultiMetricCriteria {
/**
* Unmatched properties from the message are deserialized this collection.
*/
@JsonProperty(value = "")
private Map<String, Object> additionalProperties;

/**
* Get unmatched properties from the message are deserialized this collection.
*
* @return the additionalProperties value
*/
public Map<String, Object> additionalProperties() {
return this.additionalProperties;
}

/**
* Set unmatched properties from the message are deserialized this collection.
*
* @param additionalProperties the additionalProperties value to set
* @return the MultiMetricCriteria object itself.
*/
public MultiMetricCriteria withAdditionalProperties(Map<String, Object> additionalProperties) {
this.additionalProperties = additionalProperties;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ public class MetricAlertResourceInner extends Resource {
@JsonProperty(value = "properties.windowSize", required = true)
private Period windowSize;

/**
* the resource type of the target resource(s) on which the alert is
* created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*/
@JsonProperty(value = "properties.targetResourceType")
private String targetResourceType;

/**
* the region of the target resource(s) on which the alert is
* created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*/
@JsonProperty(value = "properties.targetResourceRegion")
private String targetResourceRegion;

/**
* defines the specific alert criteria information.
*/
Expand Down Expand Up @@ -207,6 +221,46 @@ public MetricAlertResourceInner withWindowSize(Period windowSize) {
return this;
}

/**
* Get the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @return the targetResourceType value
*/
public String targetResourceType() {
return this.targetResourceType;
}

/**
* Set the resource type of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @param targetResourceType the targetResourceType value to set
* @return the MetricAlertResourceInner object itself.
*/
public MetricAlertResourceInner withTargetResourceType(String targetResourceType) {
this.targetResourceType = targetResourceType;
return this;
}

/**
* Get the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @return the targetResourceRegion value
*/
public String targetResourceRegion() {
return this.targetResourceRegion;
}

/**
* Set the region of the target resource(s) on which the alert is created/updated. Mandatory for MultipleResourceMultipleMetricCriteria.
*
* @param targetResourceRegion the targetResourceRegion value to set
* @return the MetricAlertResourceInner object itself.
*/
public MetricAlertResourceInner withTargetResourceRegion(String targetResourceRegion) {
this.targetResourceRegion = targetResourceRegion;
return this;
}

/**
* Get defines the specific alert criteria information.
*
Expand Down

0 comments on commit 7866629

Please sign in to comment.