diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.java index dd1cf305782a..b81bc3a9aba9 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.java @@ -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 { } diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Criteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Criteria.java new file mode 100644 index 000000000000..25caf7322837 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Criteria.java @@ -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 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 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 dimensions) { + this.dimensions = dimensions; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Dimension.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Dimension.java new file mode 100644 index 000000000000..45326adf3cfa --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Dimension.java @@ -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 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 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 values) { + this.values = values; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/LogToMetricAction.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/LogToMetricAction.java new file mode 100644 index 000000000000..e16a521d158a --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/LogToMetricAction.java @@ -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; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Source.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Source.java index 3aaadf7e79a3..951bfaec1238 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Source.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Source.java @@ -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; /** @@ -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 */ @@ -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. diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/LogSearchRuleResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/LogSearchRuleResourceInner.java index ef56c46d8545..64b237e2fbb5 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/LogSearchRuleResourceInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/LogSearchRuleResourceInner.java @@ -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; /** @@ -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 */ @@ -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.