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
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("Action")
@JsonSubTypes({
@JsonSubTypes.Type(name = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", value = AlertingAction.class)
@JsonSubTypes.Type(name = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.AlertingAction", value = AlertingAction.class),
@JsonSubTypes.Type(name = "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction", value = LogToMetricAction.class)
})
public class Action {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/**
* 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;

/**
* Specifies the criteria for converting log to metric.
*/
public class Criteria {
/**
* Name of the metric.
*/
@JsonProperty(value = "metricName", required = true)
private String metricName;

/**
* List of Dimensions for creating metric.
*/
@JsonProperty(value = "dimensions")
private List<Dimension> dimensions;

/**
* Get name of the metric.
*
* @return the metricName value
*/
public String metricName() {
return this.metricName;
}

/**
* Set name of the metric.
*
* @param metricName the metricName value to set
* @return the Criteria object itself.
*/
public Criteria withMetricName(String metricName) {
this.metricName = metricName;
return this;
}

/**
* Get list of Dimensions for creating metric.
*
* @return the dimensions value
*/
public List<Dimension> dimensions() {
return this.dimensions;
}

/**
* Set list of Dimensions for creating metric.
*
* @param dimensions the dimensions value to set
* @return the Criteria object itself.
*/
public Criteria withDimensions(List<Dimension> dimensions) {
this.dimensions = dimensions;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
/**
* 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;

/**
* Specifies the criteria for converting log to metric.
*/
public class Dimension {
/**
* Name of the dimension.
*/
@JsonProperty(value = "name", required = true)
private String name;

/**
* Operator for dimension values.
*/
@JsonProperty(value = "operator", required = true)
private String operator;

/**
* List of dimension values.
*/
@JsonProperty(value = "values", required = true)
private List<String> values;

/**
* Creates an instance of Dimension class.
* @param name name of the dimension.
* @param values list of dimension values.
*/
public Dimension() {
operator = "Include";
}

/**
* Get name of the dimension.
*
* @return the name value
*/
public String name() {
return this.name;
}

/**
* Set name of the dimension.
*
* @param name the name value to set
* @return the Dimension object itself.
*/
public Dimension withName(String name) {
this.name = name;
return this;
}

/**
* Get operator for dimension values.
*
* @return the operator value
*/
public String operator() {
return this.operator;
}

/**
* Set operator for dimension values.
*
* @param operator the operator value to set
* @return the Dimension object itself.
*/
public Dimension withOperator(String operator) {
this.operator = operator;
return this;
}

/**
* Get list of dimension values.
*
* @return the values value
*/
public List<String> values() {
return this.values;
}

/**
* Set list of dimension values.
*
* @param values the values value to set
* @return the Dimension object itself.
*/
public Dimension withValues(List<String> values) {
this.values = values;
return this;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/**
* 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 com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
* Specifiy action need to be taken when rule type is converting log to metric.
*/
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type")
@JsonTypeName("Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction")
public class LogToMetricAction extends Action {
/**
* Severity of the alert.
*/
@JsonProperty(value = "criteria", required = true)
private Criteria criteria;

/**
* Get severity of the alert.
*
* @return the criteria value
*/
public Criteria criteria() {
return this.criteria;
}

/**
* Set severity of the alert.
*
* @param criteria the criteria value to set
* @return the LogToMetricAction object itself.
*/
public LogToMetricAction withCriteria(Criteria criteria) {
this.criteria = criteria;
return this;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
*/
public class Source {
/**
* Log search query.
* Log search query. Required for action type - AlertingAction.
*/
@JsonProperty(value = "query", required = true)
@JsonProperty(value = "query")
private String query;

/**
Expand All @@ -40,7 +40,7 @@ public class Source {
private QueryType queryType;

/**
* Get log search query.
* Get log search query. Required for action type - AlertingAction.
*
* @return the query value
*/
Expand All @@ -49,7 +49,7 @@ public String query() {
}

/**
* Set log search query.
* Set log search query. Required for action type - AlertingAction.
*
* @param query the query value to set
* @return the Source object itself.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public class LogSearchRuleResourceInner extends Resource {
private Source source;

/**
* Schedule (Frequnecy, Time Window) for rule.
* Schedule (Frequnecy, Time Window) for rule. Required for action type -
* AlertingAction.
*/
@JsonProperty(value = "properties.schedule", required = true)
@JsonProperty(value = "properties.schedule")
private Schedule schedule;

/**
Expand Down Expand Up @@ -146,7 +147,7 @@ public LogSearchRuleResourceInner withSource(Source source) {
}

/**
* Get schedule (Frequnecy, Time Window) for rule.
* Get schedule (Frequnecy, Time Window) for rule. Required for action type - AlertingAction.
*
* @return the schedule value
*/
Expand All @@ -155,7 +156,7 @@ public Schedule schedule() {
}

/**
* Set schedule (Frequnecy, Time Window) for rule.
* Set schedule (Frequnecy, Time Window) for rule. Required for action type - AlertingAction.
*
* @param schedule the schedule value to set
* @return the LogSearchRuleResourceInner object itself.
Expand Down