From ab495f5b99210addfd6f166ba6d63edaf54c0aaf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 13 Mar 2018 21:39:20 +0000 Subject: [PATCH 01/10] Generated from 2e30b3b8dc4f256be2e18cbbbfdfe90ab3c63959 fix operation id --- .../azure/management/monitor/Action.java | 70 ++ .../azure/management/monitor/AlertStatus.java | 69 ++ .../monitor/MetricAlertCriteria.java | 24 + ...tSingleResourceMultipleMetricCriteria.java | 49 ++ .../management/monitor/MetricAlertStatus.java | 121 ++++ .../monitor/MetricAlertStatusProperties.java | 96 +++ .../management/monitor/MetricCriteria.java | 200 ++++++ .../management/monitor/MetricDimension.java | 96 +++ .../MetricAlertResourceInner.java | 293 +++++++++ .../MetricAlertResourcePatchInner.java | 319 ++++++++++ .../MetricAlertStatusCollectionInner.java | 45 ++ .../implementation/MetricAlertsInner.java | 601 ++++++++++++++++++ .../MetricAlertsStatusInner.java | 239 +++++++ .../MonitorManagementClientImpl.java | 28 + .../management/monitor/package-info.java | 2 +- 15 files changed, 2251 insertions(+), 1 deletion(-) create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/AlertStatus.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertSingleResourceMultipleMetricCriteria.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDimension.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertStatusCollectionInner.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsInner.java create mode 100644 azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsStatusInner.java 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 new file mode 100644 index 00000000000..e174b47cd5e --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/Action.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.Map; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * An alert action. + */ +public class Action { + /** + * the id of the action group to use. + */ + @JsonProperty(value = "actionGroupId") + private String actionGroupId; + + /** + * The webhookProperties property. + */ + @JsonProperty(value = "webhookProperties") + private Map webhookProperties; + + /** + * Get the actionGroupId value. + * + * @return the actionGroupId value + */ + public String actionGroupId() { + return this.actionGroupId; + } + + /** + * Set the actionGroupId value. + * + * @param actionGroupId the actionGroupId value to set + * @return the Action object itself. + */ + public Action withActionGroupId(String actionGroupId) { + this.actionGroupId = actionGroupId; + return this; + } + + /** + * Get the webhookProperties value. + * + * @return the webhookProperties value + */ + public Map webhookProperties() { + return this.webhookProperties; + } + + /** + * Set the webhookProperties value. + * + * @param webhookProperties the webhookProperties value to set + * @return the Action object itself. + */ + public Action withWebhookProperties(Map webhookProperties) { + this.webhookProperties = webhookProperties; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/AlertStatus.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/AlertStatus.java new file mode 100644 index 00000000000..14de61e2de6 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/AlertStatus.java @@ -0,0 +1,69 @@ +/** + * 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; + +/** + * An alert status. + */ +public class AlertStatus { + /** + * status value. + */ + @JsonProperty(value = "value") + private String value; + + /** + * UTC time when the status was checked. + */ + @JsonProperty(value = "timestamp") + private String timestamp; + + /** + * Get the value value. + * + * @return the value value + */ + public String value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the AlertStatus object itself. + */ + public AlertStatus withValue(String value) { + this.value = value; + return this; + } + + /** + * Get the timestamp value. + * + * @return the timestamp value + */ + public String timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp value. + * + * @param timestamp the timestamp value to set + * @return the AlertStatus object itself. + */ + public AlertStatus withTimestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java new file mode 100644 index 00000000000..3b9aa4cd944 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java @@ -0,0 +1,24 @@ +/** + * 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.JsonTypeInfo; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonSubTypes; + +/** + * The rule criteria that defines the conditions of the alert rule. + */ +@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) +}) +public class MetricAlertCriteria { +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertSingleResourceMultipleMetricCriteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertSingleResourceMultipleMetricCriteria.java new file mode 100644 index 00000000000..20d754b040f --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertSingleResourceMultipleMetricCriteria.java @@ -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; + +/** + * Specifies the metric alert criteria for a single resource that has multiple + * metric criteria. + */ +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "odata.type") +@JsonTypeName("Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria") +public class MetricAlertSingleResourceMultipleMetricCriteria extends MetricAlertCriteria { + /** + * The list of metric criteria for this 'all of' operation. + */ + @JsonProperty(value = "allOf") + private List allOf; + + /** + * Get the allOf value. + * + * @return the allOf value + */ + public List allOf() { + return this.allOf; + } + + /** + * Set the allOf value. + * + * @param allOf the allOf value to set + * @return the MetricAlertSingleResourceMultipleMetricCriteria object itself. + */ + public MetricAlertSingleResourceMultipleMetricCriteria withAllOf(List allOf) { + this.allOf = allOf; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java new file mode 100644 index 00000000000..4119c85cc31 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java @@ -0,0 +1,121 @@ +/** + * 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; + +/** + * An alert status. + */ +public class MetricAlertStatus { + /** + * The status name. + */ + @JsonProperty(value = "name") + private String name; + + /** + * The alert rule arm id. + */ + @JsonProperty(value = "id") + private String id; + + /** + * Possible values include: 'microsoft.insights/metricalerts/status'. + */ + @JsonProperty(value = "type") + private String type; + + /** + * The alert status properties of the metric alert status. + */ + @JsonProperty(value = "properties") + private MetricAlertStatus properties; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withName(String name) { + this.name = name; + return this; + } + + /** + * Get the id value. + * + * @return the id value + */ + public String id() { + return this.id; + } + + /** + * Set the id value. + * + * @param id the id value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withId(String id) { + this.id = id; + return this; + } + + /** + * Get the type value. + * + * @return the type value + */ + public String type() { + return this.type; + } + + /** + * Set the type value. + * + * @param type the type value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withType(String type) { + this.type = type; + return this; + } + + /** + * Get the properties value. + * + * @return the properties value + */ + public MetricAlertStatus properties() { + return this.properties; + } + + /** + * Set the properties value. + * + * @param properties the properties value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withProperties(MetricAlertStatus properties) { + this.properties = properties; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java new file mode 100644 index 00000000000..b94f3d02fc2 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java @@ -0,0 +1,96 @@ +/** + * 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; + +/** + * An alert status properties. + */ +public class MetricAlertStatusProperties { + /** + * The dimensions property. + */ + @JsonProperty(value = "dimensions") + private Map dimensions; + + /** + * status value. + */ + @JsonProperty(value = "status") + private String status; + + /** + * UTC time when the status was checked. + */ + @JsonProperty(value = "timestamp") + private String timestamp; + + /** + * Get the dimensions value. + * + * @return the dimensions value + */ + public Map dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions value. + * + * @param dimensions the dimensions value to set + * @return the MetricAlertStatusProperties object itself. + */ + public MetricAlertStatusProperties withDimensions(Map dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the MetricAlertStatusProperties object itself. + */ + public MetricAlertStatusProperties withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the timestamp value. + * + * @return the timestamp value + */ + public String timestamp() { + return this.timestamp; + } + + /** + * Set the timestamp value. + * + * @param timestamp the timestamp value to set + * @return the MetricAlertStatusProperties object itself. + */ + public MetricAlertStatusProperties withTimestamp(String timestamp) { + this.timestamp = timestamp; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java new file mode 100644 index 00000000000..eb5729169fc --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java @@ -0,0 +1,200 @@ +/** + * 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; + +/** + * The MetricCriteria model. + */ +public class MetricCriteria { + /** + * Name of the criteria. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * Name of the metric. + */ + @JsonProperty(value = "metricName", required = true) + private String metricName; + + /** + * Namespace of the metric. + */ + @JsonProperty(value = "metricNamespace") + private String metricNamespace; + + /** + * the criteria operator. + */ + @JsonProperty(value = "operator", required = true) + private String operator; + + /** + * the criteria time aggregation value. + */ + @JsonProperty(value = "timeAggregation", required = true) + private String timeAggregation; + + /** + * the criteria threshold value that activates the alert. + */ + @JsonProperty(value = "threshold", required = true) + private double threshold; + + /** + * List of dimension conditions. + */ + @JsonProperty(value = "dimensions") + private List dimensions; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withName(String name) { + this.name = name; + return this; + } + + /** + * Get the metricName value. + * + * @return the metricName value + */ + public String metricName() { + return this.metricName; + } + + /** + * Set the metricName value. + * + * @param metricName the metricName value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withMetricName(String metricName) { + this.metricName = metricName; + return this; + } + + /** + * Get the metricNamespace value. + * + * @return the metricNamespace value + */ + public String metricNamespace() { + return this.metricNamespace; + } + + /** + * Set the metricNamespace value. + * + * @param metricNamespace the metricNamespace value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withMetricNamespace(String metricNamespace) { + this.metricNamespace = metricNamespace; + return this; + } + + /** + * Get the operator value. + * + * @return the operator value + */ + public String operator() { + return this.operator; + } + + /** + * Set the operator value. + * + * @param operator the operator value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withOperator(String operator) { + this.operator = operator; + return this; + } + + /** + * Get the timeAggregation value. + * + * @return the timeAggregation value + */ + public String timeAggregation() { + return this.timeAggregation; + } + + /** + * Set the timeAggregation value. + * + * @param timeAggregation the timeAggregation value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withTimeAggregation(String timeAggregation) { + this.timeAggregation = timeAggregation; + return this; + } + + /** + * Get the threshold value. + * + * @return the threshold value + */ + public double threshold() { + return this.threshold; + } + + /** + * Set the threshold value. + * + * @param threshold the threshold value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withThreshold(double threshold) { + this.threshold = threshold; + return this; + } + + /** + * Get the dimensions value. + * + * @return the dimensions value + */ + public List dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions value. + * + * @param dimensions the dimensions value to set + * @return the MetricCriteria object itself. + */ + public MetricCriteria withDimensions(List dimensions) { + this.dimensions = dimensions; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDimension.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDimension.java new file mode 100644 index 00000000000..3309c284328 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricDimension.java @@ -0,0 +1,96 @@ +/** + * 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; + +/** + * The MetricDimension model. + */ +public class MetricDimension { + /** + * Name of the dimension. + */ + @JsonProperty(value = "name", required = true) + private String name; + + /** + * the dimension operator. + */ + @JsonProperty(value = "operator", required = true) + private String operator; + + /** + * list of dimension values. + */ + @JsonProperty(value = "values", required = true) + private List values; + + /** + * Get the name value. + * + * @return the name value + */ + public String name() { + return this.name; + } + + /** + * Set the name value. + * + * @param name the name value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withName(String name) { + this.name = name; + return this; + } + + /** + * Get the operator value. + * + * @return the operator value + */ + public String operator() { + return this.operator; + } + + /** + * Set the operator value. + * + * @param operator the operator value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withOperator(String operator) { + this.operator = operator; + return this; + } + + /** + * Get the values value. + * + * @return the values value + */ + public List values() { + return this.values; + } + + /** + * Set the values value. + * + * @param values the values value to set + * @return the MetricDimension object itself. + */ + public MetricDimension withValues(List values) { + this.values = values; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java new file mode 100644 index 00000000000..20722844a74 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java @@ -0,0 +1,293 @@ +/** + * 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.implementation; + +import java.util.List; +import org.joda.time.Period; +import com.microsoft.azure.management.monitor.Action; +import com.microsoft.azure.management.monitor.AlertStatus; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; +import com.microsoft.azure.Resource; + +/** + * The metric alert resource. + */ +@JsonFlatten +public class MetricAlertResourceInner extends Resource { + /** + * the description of the metric alert that will be included in the alert + * email. + */ + @JsonProperty(value = "properties.description", required = true) + private String description; + + /** + * Alert severity {0, 1, 2, 3, 4}. + */ + @JsonProperty(value = "properties.severity", required = true) + private int severity; + + /** + * the flag that indicates whether the metric alert is enabled. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * the list of resource id's that this metric alert is scoped to. + */ + @JsonProperty(value = "properties.scopes") + private List scopes; + + /** + * how often the metric alert is evaluated represented in ISO 8601 duration + * format. + */ + @JsonProperty(value = "properties.evaluationFrequency", required = true) + private Period evaluationFrequency; + + /** + * the period of time (in ISO 8601 duration format) that is used to monitor + * alert activity based on the threshold. + */ + @JsonProperty(value = "properties.windowSize", required = true) + private Period windowSize; + + /** + * schema to use to interpret the criteria JSON. + */ + @JsonProperty(value = "properties.criteriaSchemaId", required = true) + private String criteriaSchemaId; + + /** + * json data that follows the schema defined by criteria schema id. + */ + @JsonProperty(value = "properties.criteria", required = true) + private String criteria; + + /** + * the array of actions that are performed when the alert rule becomes + * active, and when an alert condition is resolved. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * the current metric alert status. + */ + @JsonProperty(value = "properties.currentStatus", access = JsonProperty.Access.WRITE_ONLY) + private AlertStatus currentStatus; + + /** + * Last time the rule was updated in ISO8601 format. + */ + @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdatedTime; + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the severity value. + * + * @return the severity value + */ + public int severity() { + return this.severity; + } + + /** + * Set the severity value. + * + * @param severity the severity value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withSeverity(int severity) { + this.severity = severity; + return this; + } + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the scopes value. + * + * @return the scopes value + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes value. + * + * @param scopes the scopes value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the evaluationFrequency value. + * + * @return the evaluationFrequency value + */ + public Period evaluationFrequency() { + return this.evaluationFrequency; + } + + /** + * Set the evaluationFrequency value. + * + * @param evaluationFrequency the evaluationFrequency value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withEvaluationFrequency(Period evaluationFrequency) { + this.evaluationFrequency = evaluationFrequency; + return this; + } + + /** + * Get the windowSize value. + * + * @return the windowSize value + */ + public Period windowSize() { + return this.windowSize; + } + + /** + * Set the windowSize value. + * + * @param windowSize the windowSize value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withWindowSize(Period windowSize) { + this.windowSize = windowSize; + return this; + } + + /** + * Get the criteriaSchemaId value. + * + * @return the criteriaSchemaId value + */ + public String criteriaSchemaId() { + return this.criteriaSchemaId; + } + + /** + * Set the criteriaSchemaId value. + * + * @param criteriaSchemaId the criteriaSchemaId value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withCriteriaSchemaId(String criteriaSchemaId) { + this.criteriaSchemaId = criteriaSchemaId; + return this; + } + + /** + * Get the criteria value. + * + * @return the criteria value + */ + public String criteria() { + return this.criteria; + } + + /** + * Set the criteria value. + * + * @param criteria the criteria value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withCriteria(String criteria) { + this.criteria = criteria; + return this; + } + + /** + * Get the actions value. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions value. + * + * @param actions the actions value to set + * @return the MetricAlertResourceInner object itself. + */ + public MetricAlertResourceInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the currentStatus value. + * + * @return the currentStatus value + */ + public AlertStatus currentStatus() { + return this.currentStatus; + } + + /** + * Get the lastUpdatedTime value. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java new file mode 100644 index 00000000000..77333e7d046 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java @@ -0,0 +1,319 @@ +/** + * 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.implementation; + +import java.util.Map; +import java.util.List; +import org.joda.time.Period; +import com.microsoft.azure.management.monitor.Action; +import com.microsoft.azure.management.monitor.AlertStatus; +import org.joda.time.DateTime; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; + +/** + * The metric alert resource for patch operations. + */ +@JsonFlatten +public class MetricAlertResourcePatchInner { + /** + * Resource tags. + */ + @JsonProperty(value = "tags") + private Map tags; + + /** + * the description of the metric alert that will be included in the alert + * email. + */ + @JsonProperty(value = "properties.description", required = true) + private String description; + + /** + * Alert severity {0, 1, 2, 3, 4}. + */ + @JsonProperty(value = "properties.severity", required = true) + private int severity; + + /** + * the flag that indicates whether the metric alert is enabled. + */ + @JsonProperty(value = "properties.enabled", required = true) + private boolean enabled; + + /** + * the list of resource id's that this metric alert is scoped to. + */ + @JsonProperty(value = "properties.scopes") + private List scopes; + + /** + * how often the metric alert is evaluated represented in ISO 8601 duration + * format. + */ + @JsonProperty(value = "properties.evaluationFrequency", required = true) + private Period evaluationFrequency; + + /** + * the period of time (in ISO 8601 duration format) that is used to monitor + * alert activity based on the threshold. + */ + @JsonProperty(value = "properties.windowSize", required = true) + private Period windowSize; + + /** + * schema to use to interpret the criteria JSON. + */ + @JsonProperty(value = "properties.criteriaSchemaId", required = true) + private String criteriaSchemaId; + + /** + * json data that follows the schema defined by criteria schema id. + */ + @JsonProperty(value = "properties.criteria", required = true) + private String criteria; + + /** + * the array of actions that are performed when the alert rule becomes + * active, and when an alert condition is resolved. + */ + @JsonProperty(value = "properties.actions") + private List actions; + + /** + * the current metric alert status. + */ + @JsonProperty(value = "properties.currentStatus", access = JsonProperty.Access.WRITE_ONLY) + private AlertStatus currentStatus; + + /** + * Last time the rule was updated in ISO8601 format. + */ + @JsonProperty(value = "properties.lastUpdatedTime", access = JsonProperty.Access.WRITE_ONLY) + private DateTime lastUpdatedTime; + + /** + * Get the tags value. + * + * @return the tags value + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags value. + * + * @param tags the tags value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the description value. + * + * @return the description value + */ + public String description() { + return this.description; + } + + /** + * Set the description value. + * + * @param description the description value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the severity value. + * + * @return the severity value + */ + public int severity() { + return this.severity; + } + + /** + * Set the severity value. + * + * @param severity the severity value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withSeverity(int severity) { + this.severity = severity; + return this; + } + + /** + * Get the enabled value. + * + * @return the enabled value + */ + public boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled value. + * + * @param enabled the enabled value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withEnabled(boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the scopes value. + * + * @return the scopes value + */ + public List scopes() { + return this.scopes; + } + + /** + * Set the scopes value. + * + * @param scopes the scopes value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withScopes(List scopes) { + this.scopes = scopes; + return this; + } + + /** + * Get the evaluationFrequency value. + * + * @return the evaluationFrequency value + */ + public Period evaluationFrequency() { + return this.evaluationFrequency; + } + + /** + * Set the evaluationFrequency value. + * + * @param evaluationFrequency the evaluationFrequency value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withEvaluationFrequency(Period evaluationFrequency) { + this.evaluationFrequency = evaluationFrequency; + return this; + } + + /** + * Get the windowSize value. + * + * @return the windowSize value + */ + public Period windowSize() { + return this.windowSize; + } + + /** + * Set the windowSize value. + * + * @param windowSize the windowSize value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withWindowSize(Period windowSize) { + this.windowSize = windowSize; + return this; + } + + /** + * Get the criteriaSchemaId value. + * + * @return the criteriaSchemaId value + */ + public String criteriaSchemaId() { + return this.criteriaSchemaId; + } + + /** + * Set the criteriaSchemaId value. + * + * @param criteriaSchemaId the criteriaSchemaId value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withCriteriaSchemaId(String criteriaSchemaId) { + this.criteriaSchemaId = criteriaSchemaId; + return this; + } + + /** + * Get the criteria value. + * + * @return the criteria value + */ + public String criteria() { + return this.criteria; + } + + /** + * Set the criteria value. + * + * @param criteria the criteria value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withCriteria(String criteria) { + this.criteria = criteria; + return this; + } + + /** + * Get the actions value. + * + * @return the actions value + */ + public List actions() { + return this.actions; + } + + /** + * Set the actions value. + * + * @param actions the actions value to set + * @return the MetricAlertResourcePatchInner object itself. + */ + public MetricAlertResourcePatchInner withActions(List actions) { + this.actions = actions; + return this; + } + + /** + * Get the currentStatus value. + * + * @return the currentStatus value + */ + public AlertStatus currentStatus() { + return this.currentStatus; + } + + /** + * Get the lastUpdatedTime value. + * + * @return the lastUpdatedTime value + */ + public DateTime lastUpdatedTime() { + return this.lastUpdatedTime; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertStatusCollectionInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertStatusCollectionInner.java new file mode 100644 index 00000000000..de139575806 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertStatusCollectionInner.java @@ -0,0 +1,45 @@ +/** + * 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.implementation; + +import java.util.List; +import com.microsoft.azure.management.monitor.MetricAlertStatus; +import com.fasterxml.jackson.annotation.JsonProperty; + +/** + * Represents a collection of alert rule resources. + */ +public class MetricAlertStatusCollectionInner { + /** + * the values for the alert rule resources. + */ + @JsonProperty(value = "value") + private List value; + + /** + * Get the value value. + * + * @return the value value + */ + public List value() { + return this.value; + } + + /** + * Set the value value. + * + * @param value the value value to set + * @return the MetricAlertStatusCollectionInner object itself. + */ + public MetricAlertStatusCollectionInner withValue(List value) { + this.value = value; + return this; + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsInner.java new file mode 100644 index 00000000000..b77ed8139da --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsInner.java @@ -0,0 +1,601 @@ +/** + * 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.implementation; + +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsGet; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsDelete; +import com.microsoft.azure.management.resources.fluentcore.collection.InnerSupportsListing; +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.CloudException; +import com.microsoft.azure.management.monitor.ErrorResponseException; +import com.microsoft.azure.Page; +import com.microsoft.azure.PagedList; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import com.microsoft.rest.Validator; +import java.io.IOException; +import java.util.List; +import okhttp3.ResponseBody; +import retrofit2.http.Body; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.HTTP; +import retrofit2.http.PATCH; +import retrofit2.http.Path; +import retrofit2.http.PUT; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MetricAlerts. + */ +public class MetricAlertsInner implements InnerSupportsGet, InnerSupportsDelete, InnerSupportsListing { + /** The Retrofit service to perform REST calls. */ + private MetricAlertsService service; + /** The service client containing this operation class. */ + private MonitorManagementClientImpl client; + + /** + * Initializes an instance of MetricAlertsInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MetricAlertsInner(Retrofit retrofit, MonitorManagementClientImpl client) { + this.service = retrofit.create(MetricAlertsService.class); + this.client = client; + } + + /** + * The interface defining all the services for MetricAlerts to be + * used by Retrofit to perform actually REST calls. + */ + interface MetricAlertsService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts list" }) + @GET("subscriptions/{subscriptionId}/providers/Microsoft.Insight/metricAlerts") + Observable> list(@Path("subscriptionId") String subscriptionId, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts listByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts") + Observable> listByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts getByResourceGroup" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}") + Observable> getByResourceGroup(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts createOrUpdate" }) + @PUT("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}") + Observable> createOrUpdate(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Query("api-version") String apiVersion, @Body MetricAlertResourceInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts update" }) + @PATCH("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}") + Observable> update(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Query("api-version") String apiVersion, @Body MetricAlertResourcePatchInner parameters, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlerts delete" }) + @HTTP(path = "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}", method = "DELETE", hasBody = true) + Observable> delete(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve alert rule definitions in a subscription. + * + * @return the PagedList object if successful. + */ + public PagedList list() { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listWithServiceResponseAsync().toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Retrieve alert rule definitions in a subscription. + * + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listAsync(final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(), serviceCallback); + } + + /** + * Retrieve alert rule definitions in a subscription. + * + * @return the observable to the List<MetricAlertResourceInner> object + */ + public Observable> listAsync() { + return listWithServiceResponseAsync().map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Retrieve alert rule definitions in a subscription. + * + * @return the observable to the List<MetricAlertResourceInner> object + */ + public Observable>> listWithServiceResponseAsync() { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.list(this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieve alert rule defintions in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the PagedList object if successful. + */ + public PagedList listByResourceGroup(String resourceGroupName) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(listByResourceGroupWithServiceResponseAsync(resourceGroupName).toBlocking().single().body()); + page.setNextPageLink(null); + return new PagedList(page) { + @Override + public Page nextPage(String nextPageLink) { + return null; + } + }; + } + + /** + * Retrieve alert rule defintions in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @return the {@link ServiceFuture} object + */ + public ServiceFuture> listByResourceGroupAsync(String resourceGroupName, final ServiceCallback> serviceCallback) { + return ServiceFuture.fromResponse(listByResourceGroupWithServiceResponseAsync(resourceGroupName), serviceCallback); + } + + /** + * Retrieve alert rule defintions in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<MetricAlertResourceInner> object + */ + public Observable> listByResourceGroupAsync(String resourceGroupName) { + return listByResourceGroupWithServiceResponseAsync(resourceGroupName).map(new Func1>, Page>() { + @Override + public Page call(ServiceResponse> response) { + PageImpl1 page = new PageImpl1<>(); + page.setItems(response.body()); + return page; + } + }); + } + + /** + * Retrieve alert rule defintions in a resource group. + * + * @param resourceGroupName The name of the resource group. + * @return the observable to the List<MetricAlertResourceInner> object + */ + public Observable>> listByResourceGroupWithServiceResponseAsync(String resourceGroupName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.listByResourceGroup(this.client.subscriptionId(), resourceGroupName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>>() { + @Override + public Observable>> call(Response response) { + try { + ServiceResponse> result = listByResourceGroupDelegate(response); + ServiceResponse> clientResponse = new ServiceResponse>(result.body().items(), result.response()); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse> listByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory()., ErrorResponseException>newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken>() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieve an alert rule definiton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricAlertResourceInner object if successful. + */ + public MetricAlertResourceInner getByResourceGroup(String resourceGroupName, String ruleName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ruleName).toBlocking().single().body(); + } + + /** + * Retrieve an alert rule definiton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture getByResourceGroupAsync(String resourceGroupName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(getByResourceGroupWithServiceResponseAsync(resourceGroupName, ruleName), serviceCallback); + } + + /** + * Retrieve an alert rule definiton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable getByResourceGroupAsync(String resourceGroupName, String ruleName) { + return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ruleName).map(new Func1, MetricAlertResourceInner>() { + @Override + public MetricAlertResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve an alert rule definiton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable> getByResourceGroupWithServiceResponseAsync(String resourceGroupName, String ruleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.getByResourceGroup(this.client.subscriptionId(), resourceGroupName, ruleName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = getByResourceGroupDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse getByResourceGroupDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Create or update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricAlertResourceInner object if successful. + */ + public MetricAlertResourceInner createOrUpdate(String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ruleName, parameters).toBlocking().single().body(); + } + + /** + * Create or update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture createOrUpdateAsync(String resourceGroupName, String ruleName, MetricAlertResourceInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(createOrUpdateWithServiceResponseAsync(resourceGroupName, ruleName, parameters), serviceCallback); + } + + /** + * Create or update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable createOrUpdateAsync(String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { + return createOrUpdateWithServiceResponseAsync(resourceGroupName, ruleName, parameters).map(new Func1, MetricAlertResourceInner>() { + @Override + public MetricAlertResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Create or update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to create or update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable> createOrUpdateWithServiceResponseAsync(String resourceGroupName, String ruleName, MetricAlertResourceInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-03-01"; + return service.createOrUpdate(this.client.subscriptionId(), resourceGroupName, ruleName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = createOrUpdateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse createOrUpdateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricAlertResourceInner object if successful. + */ + public MetricAlertResourceInner update(String resourceGroupName, String ruleName, MetricAlertResourcePatchInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, ruleName, parameters).toBlocking().single().body(); + } + + /** + * Update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture updateAsync(String resourceGroupName, String ruleName, MetricAlertResourcePatchInner parameters, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(updateWithServiceResponseAsync(resourceGroupName, ruleName, parameters), serviceCallback); + } + + /** + * Update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable updateAsync(String resourceGroupName, String ruleName, MetricAlertResourcePatchInner parameters) { + return updateWithServiceResponseAsync(resourceGroupName, ruleName, parameters).map(new Func1, MetricAlertResourceInner>() { + @Override + public MetricAlertResourceInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Update an metric alert definition. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param parameters The parameters of the rule to update. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertResourceInner object + */ + public Observable> updateWithServiceResponseAsync(String resourceGroupName, String ruleName, MetricAlertResourcePatchInner parameters) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (parameters == null) { + throw new IllegalArgumentException("Parameter parameters is required and cannot be null."); + } + Validator.validate(parameters); + final String apiVersion = "2018-03-01"; + return service.update(this.client.subscriptionId(), resourceGroupName, ruleName, apiVersion, parameters, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = updateDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse updateDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Delete an alert rule defitiniton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws CloudException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + */ + public void delete(String resourceGroupName, String ruleName) { + deleteWithServiceResponseAsync(resourceGroupName, ruleName).toBlocking().single().body(); + } + + /** + * Delete an alert rule defitiniton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture deleteAsync(String resourceGroupName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(deleteWithServiceResponseAsync(resourceGroupName, ruleName), serviceCallback); + } + + /** + * Delete an alert rule defitiniton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable deleteAsync(String resourceGroupName, String ruleName) { + return deleteWithServiceResponseAsync(resourceGroupName, ruleName).map(new Func1, Void>() { + @Override + public Void call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Delete an alert rule defitiniton. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceResponse} object if successful. + */ + public Observable> deleteWithServiceResponseAsync(String resourceGroupName, String ruleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.delete(this.client.subscriptionId(), resourceGroupName, ruleName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = deleteDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse deleteDelegate(Response response) throws CloudException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .register(204, new TypeToken() { }.getType()) + .registerError(CloudException.class) + .build(response); + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsStatusInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsStatusInner.java new file mode 100644 index 00000000000..ebe0f2f6c27 --- /dev/null +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertsStatusInner.java @@ -0,0 +1,239 @@ +/** + * 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.implementation; + +import retrofit2.Retrofit; +import com.google.common.reflect.TypeToken; +import com.microsoft.azure.management.monitor.ErrorResponseException; +import com.microsoft.rest.ServiceCallback; +import com.microsoft.rest.ServiceFuture; +import com.microsoft.rest.ServiceResponse; +import java.io.IOException; +import okhttp3.ResponseBody; +import retrofit2.http.GET; +import retrofit2.http.Header; +import retrofit2.http.Headers; +import retrofit2.http.Path; +import retrofit2.http.Query; +import retrofit2.Response; +import rx.functions.Func1; +import rx.Observable; + +/** + * An instance of this class provides access to all the operations defined + * in MetricAlertsStatus. + */ +public class MetricAlertsStatusInner { + /** The Retrofit service to perform REST calls. */ + private MetricAlertsStatusService service; + /** The service client containing this operation class. */ + private MonitorManagementClientImpl client; + + /** + * Initializes an instance of MetricAlertsStatusInner. + * + * @param retrofit the Retrofit instance built from a Retrofit Builder. + * @param client the instance of the service client containing this operation class. + */ + public MetricAlertsStatusInner(Retrofit retrofit, MonitorManagementClientImpl client) { + this.service = retrofit.create(MetricAlertsStatusService.class); + this.client = client; + } + + /** + * The interface defining all the services for MetricAlertsStatus to be + * used by Retrofit to perform actually REST calls. + */ + interface MetricAlertsStatusService { + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlertsStatus list" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}/status") + Observable> list(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.MetricAlertsStatus listByName" }) + @GET("subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Insight/metricAlerts/{ruleName}/status/{statusName}") + Observable> listByName(@Path("subscriptionId") String subscriptionId, @Path("resourceGroupName") String resourceGroupName, @Path("ruleName") String ruleName, @Path("statusName") String statusName, @Query("api-version") String apiVersion, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricAlertStatusCollectionInner object if successful. + */ + public MetricAlertStatusCollectionInner list(String resourceGroupName, String ruleName) { + return listWithServiceResponseAsync(resourceGroupName, ruleName).toBlocking().single().body(); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listAsync(String resourceGroupName, String ruleName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceGroupName, ruleName), serviceCallback); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertStatusCollectionInner object + */ + public Observable listAsync(String resourceGroupName, String ruleName) { + return listWithServiceResponseAsync(resourceGroupName, ruleName).map(new Func1, MetricAlertStatusCollectionInner>() { + @Override + public MetricAlertStatusCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertStatusCollectionInner object + */ + public Observable> listWithServiceResponseAsync(String resourceGroupName, String ruleName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.list(this.client.subscriptionId(), resourceGroupName, ruleName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param statusName The name of the status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @throws ErrorResponseException thrown if the request is rejected by server + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent + * @return the MetricAlertStatusCollectionInner object if successful. + */ + public MetricAlertStatusCollectionInner listByName(String resourceGroupName, String ruleName, String statusName) { + return listByNameWithServiceResponseAsync(resourceGroupName, ruleName, statusName).toBlocking().single().body(); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param statusName The name of the status. + * @param serviceCallback the async ServiceCallback to handle successful and failed responses. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the {@link ServiceFuture} object + */ + public ServiceFuture listByNameAsync(String resourceGroupName, String ruleName, String statusName, final ServiceCallback serviceCallback) { + return ServiceFuture.fromResponse(listByNameWithServiceResponseAsync(resourceGroupName, ruleName, statusName), serviceCallback); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param statusName The name of the status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertStatusCollectionInner object + */ + public Observable listByNameAsync(String resourceGroupName, String ruleName, String statusName) { + return listByNameWithServiceResponseAsync(resourceGroupName, ruleName, statusName).map(new Func1, MetricAlertStatusCollectionInner>() { + @Override + public MetricAlertStatusCollectionInner call(ServiceResponse response) { + return response.body(); + } + }); + } + + /** + * Retrieve an alert rule status. + * + * @param resourceGroupName The name of the resource group. + * @param ruleName The name of the rule. + * @param statusName The name of the status. + * @throws IllegalArgumentException thrown if parameters fail the validation + * @return the observable to the MetricAlertStatusCollectionInner object + */ + public Observable> listByNameWithServiceResponseAsync(String resourceGroupName, String ruleName, String statusName) { + if (this.client.subscriptionId() == null) { + throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); + } + if (resourceGroupName == null) { + throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); + } + if (ruleName == null) { + throw new IllegalArgumentException("Parameter ruleName is required and cannot be null."); + } + if (statusName == null) { + throw new IllegalArgumentException("Parameter statusName is required and cannot be null."); + } + final String apiVersion = "2018-03-01"; + return service.listByName(this.client.subscriptionId(), resourceGroupName, ruleName, statusName, apiVersion, this.client.acceptLanguage(), this.client.userAgent()) + .flatMap(new Func1, Observable>>() { + @Override + public Observable> call(Response response) { + try { + ServiceResponse clientResponse = listByNameDelegate(response); + return Observable.just(clientResponse); + } catch (Throwable t) { + return Observable.error(t); + } + } + }); + } + + private ServiceResponse listByNameDelegate(Response response) throws ErrorResponseException, IOException, IllegalArgumentException { + return this.client.restClient().responseBuilderFactory().newInstance(this.client.serializerAdapter()) + .register(200, new TypeToken() { }.getType()) + .registerError(ErrorResponseException.class) + .build(response); + } + +} diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MonitorManagementClientImpl.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MonitorManagementClientImpl.java index 7a27435e62d..f41e2cda0ee 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MonitorManagementClientImpl.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MonitorManagementClientImpl.java @@ -315,6 +315,32 @@ public MetricBaselinesInner metricBaselines() { return this.metricBaselines; } + /** + * The MetricAlertsInner object to access its operations. + */ + private MetricAlertsInner metricAlerts; + + /** + * Gets the MetricAlertsInner object to access its operations. + * @return the MetricAlertsInner object. + */ + public MetricAlertsInner metricAlerts() { + return this.metricAlerts; + } + + /** + * The MetricAlertsStatusInner object to access its operations. + */ + private MetricAlertsStatusInner metricAlertsStatus; + + /** + * Gets the MetricAlertsStatusInner object to access its operations. + * @return the MetricAlertsStatusInner object. + */ + public MetricAlertsStatusInner metricAlertsStatus() { + return this.metricAlertsStatus; + } + /** * Initializes an instance of MonitorManagementClient client. * @@ -364,6 +390,8 @@ protected void initialize() { this.metricDefinitions = new MetricDefinitionsInner(restClient().retrofit(), this); this.metrics = new MetricsInner(restClient().retrofit(), this); this.metricBaselines = new MetricBaselinesInner(restClient().retrofit(), this); + this.metricAlerts = new MetricAlertsInner(restClient().retrofit(), this); + this.metricAlertsStatus = new MetricAlertsStatusInner(restClient().retrofit(), this); this.azureClient = new AzureClient(this); } diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/package-info.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/package-info.java index 869b80781e2..fdcbdcf7339 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/package-info.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/package-info.java @@ -5,7 +5,7 @@ // Code generated by Microsoft (R) AutoRest Code Generator. /** - * This package contains the classes for managing Azure Monitor and getting logs and metrics. + * This package contains the classes for MonitorManagementClient. * Monitor Management Client. */ package com.microsoft.azure.management.monitor; From cda781e543bd65eb76349c14bd19653901399d56 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 13 Mar 2018 22:39:37 +0000 Subject: [PATCH 02/10] Generated from d2c0142c3622bbfc3bb8ead784179d7f85d646df fix type definition --- .../MetricAlertResourceInner.java | 35 +++---------------- .../MetricAlertResourcePatchInner.java | 35 +++---------------- 2 files changed, 10 insertions(+), 60 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java index 20722844a74..54aaacb94d1 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java @@ -10,6 +10,7 @@ import java.util.List; import org.joda.time.Period; +import com.microsoft.azure.management.monitor.MetricAlertCriteria; import com.microsoft.azure.management.monitor.Action; import com.microsoft.azure.management.monitor.AlertStatus; import org.joda.time.DateTime; @@ -62,16 +63,10 @@ public class MetricAlertResourceInner extends Resource { private Period windowSize; /** - * schema to use to interpret the criteria JSON. - */ - @JsonProperty(value = "properties.criteriaSchemaId", required = true) - private String criteriaSchemaId; - - /** - * json data that follows the schema defined by criteria schema id. + * criteria. */ @JsonProperty(value = "properties.criteria", required = true) - private String criteria; + private MetricAlertCriteria criteria; /** * the array of actions that are performed when the alert rule becomes @@ -212,32 +207,12 @@ public MetricAlertResourceInner withWindowSize(Period windowSize) { return this; } - /** - * Get the criteriaSchemaId value. - * - * @return the criteriaSchemaId value - */ - public String criteriaSchemaId() { - return this.criteriaSchemaId; - } - - /** - * Set the criteriaSchemaId value. - * - * @param criteriaSchemaId the criteriaSchemaId value to set - * @return the MetricAlertResourceInner object itself. - */ - public MetricAlertResourceInner withCriteriaSchemaId(String criteriaSchemaId) { - this.criteriaSchemaId = criteriaSchemaId; - return this; - } - /** * Get the criteria value. * * @return the criteria value */ - public String criteria() { + public MetricAlertCriteria criteria() { return this.criteria; } @@ -247,7 +222,7 @@ public String criteria() { * @param criteria the criteria value to set * @return the MetricAlertResourceInner object itself. */ - public MetricAlertResourceInner withCriteria(String criteria) { + public MetricAlertResourceInner withCriteria(MetricAlertCriteria criteria) { this.criteria = criteria; return this; } diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java index 77333e7d046..9d8f80d1d24 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java @@ -11,6 +11,7 @@ import java.util.Map; import java.util.List; import org.joda.time.Period; +import com.microsoft.azure.management.monitor.MetricAlertCriteria; import com.microsoft.azure.management.monitor.Action; import com.microsoft.azure.management.monitor.AlertStatus; import org.joda.time.DateTime; @@ -68,16 +69,10 @@ public class MetricAlertResourcePatchInner { private Period windowSize; /** - * schema to use to interpret the criteria JSON. - */ - @JsonProperty(value = "properties.criteriaSchemaId", required = true) - private String criteriaSchemaId; - - /** - * json data that follows the schema defined by criteria schema id. + * criteria. */ @JsonProperty(value = "properties.criteria", required = true) - private String criteria; + private MetricAlertCriteria criteria; /** * the array of actions that are performed when the alert rule becomes @@ -238,32 +233,12 @@ public MetricAlertResourcePatchInner withWindowSize(Period windowSize) { return this; } - /** - * Get the criteriaSchemaId value. - * - * @return the criteriaSchemaId value - */ - public String criteriaSchemaId() { - return this.criteriaSchemaId; - } - - /** - * Set the criteriaSchemaId value. - * - * @param criteriaSchemaId the criteriaSchemaId value to set - * @return the MetricAlertResourcePatchInner object itself. - */ - public MetricAlertResourcePatchInner withCriteriaSchemaId(String criteriaSchemaId) { - this.criteriaSchemaId = criteriaSchemaId; - return this; - } - /** * Get the criteria value. * * @return the criteria value */ - public String criteria() { + public MetricAlertCriteria criteria() { return this.criteria; } @@ -273,7 +248,7 @@ public String criteria() { * @param criteria the criteria value to set * @return the MetricAlertResourcePatchInner object itself. */ - public MetricAlertResourcePatchInner withCriteria(String criteria) { + public MetricAlertResourcePatchInner withCriteria(MetricAlertCriteria criteria) { this.criteria = criteria; return this; } From 800477f77ed1ab9749e0c09bf0ec0d9aadb907ee Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 15 Mar 2018 13:19:14 +0000 Subject: [PATCH 03/10] Generated from 52b5586ac5772f40e6737713d295856c82587285 remove old property --- .../implementation/MetricAlertResourceInner.java | 16 ---------------- .../MetricAlertResourcePatchInner.java | 16 ---------------- .../monitor/implementation/MetricsInner.java | 12 ++++++------ 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java index 54aaacb94d1..faf6331fded 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java @@ -12,7 +12,6 @@ import org.joda.time.Period; import com.microsoft.azure.management.monitor.MetricAlertCriteria; import com.microsoft.azure.management.monitor.Action; -import com.microsoft.azure.management.monitor.AlertStatus; import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -75,12 +74,6 @@ public class MetricAlertResourceInner extends Resource { @JsonProperty(value = "properties.actions") private List actions; - /** - * the current metric alert status. - */ - @JsonProperty(value = "properties.currentStatus", access = JsonProperty.Access.WRITE_ONLY) - private AlertStatus currentStatus; - /** * Last time the rule was updated in ISO8601 format. */ @@ -247,15 +240,6 @@ public MetricAlertResourceInner withActions(List actions) { return this; } - /** - * Get the currentStatus value. - * - * @return the currentStatus value - */ - public AlertStatus currentStatus() { - return this.currentStatus; - } - /** * Get the lastUpdatedTime value. * diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java index 9d8f80d1d24..4ea6fea8641 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java @@ -13,7 +13,6 @@ import org.joda.time.Period; import com.microsoft.azure.management.monitor.MetricAlertCriteria; import com.microsoft.azure.management.monitor.Action; -import com.microsoft.azure.management.monitor.AlertStatus; import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; import com.microsoft.rest.serializer.JsonFlatten; @@ -81,12 +80,6 @@ public class MetricAlertResourcePatchInner { @JsonProperty(value = "properties.actions") private List actions; - /** - * the current metric alert status. - */ - @JsonProperty(value = "properties.currentStatus", access = JsonProperty.Access.WRITE_ONLY) - private AlertStatus currentStatus; - /** * Last time the rule was updated in ISO8601 format. */ @@ -273,15 +266,6 @@ public MetricAlertResourcePatchInner withActions(List actions) { return this; } - /** - * Get the currentStatus value. - * - * @return the currentStatus value - */ - public AlertStatus currentStatus() { - return this.currentStatus; - } - /** * Get the lastUpdatedTime value. * diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java index 17354274a57..4351df4782b 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java @@ -55,7 +55,7 @@ public MetricsInner(Retrofit retrofit, MonitorManagementClientImpl client) { interface MetricsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.Metrics list" }) @GET("{resourceUri}/providers/microsoft.insights/metrics") - Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("timespan") String timespan, @Query("interval") Period interval, @Query("metricnames") String metricnames, @Query("aggregation") String aggregation, @Query("top") Double top, @Query("orderby") String orderby, @Query("$filter") String filter, @Query("resultType") ResultType resultType1, @Query("api-version") String apiVersion, @Query("metricnamespace") String metricnamespace, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("timespan") String timespan, @Query("interval") Period interval, @Query("metricnames") String metricnames, @Query("aggregation") String aggregation, @Query("top") Integer top, @Query("orderby") String orderby, @Query("$filter") String filter, @Query("resultType") ResultType resultType1, @Query("api-version") String apiVersion, @Query("metricnamespace") String metricnamespace, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -116,7 +116,7 @@ public Observable> listWithServiceResponseAsync(S final Period interval = null; final String metricnames = null; final String aggregation = null; - final Double top = null; + final Integer top = null; final String orderby = null; final String filter = null; final ResultType resultType = null; @@ -157,7 +157,7 @@ public Observable> call(Response re * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResponseInner object if successful. */ - public ResponseInner list(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public ResponseInner list(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { return listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace).toBlocking().single().body(); } @@ -182,7 +182,7 @@ public ResponseInner list(String resourceUri, String timespan, Period interval, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace, final ServiceCallback serviceCallback) { + public ServiceFuture listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace), serviceCallback); } @@ -206,7 +206,7 @@ public ServiceFuture listAsync(String resourceUri, String timespa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResponseInner object */ - public Observable listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public Observable listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { return listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace).map(new Func1, ResponseInner>() { @Override public ResponseInner call(ServiceResponse response) { @@ -235,7 +235,7 @@ public ResponseInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResponseInner object */ - public Observable> listWithServiceResponseAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public Observable> listWithServiceResponseAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { if (resourceUri == null) { throw new IllegalArgumentException("Parameter resourceUri is required and cannot be null."); } From a83e54290977e71261730a091f104bbd063a6bf2 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 15 Mar 2018 14:39:14 +0000 Subject: [PATCH 04/10] Generated from 89e1369c4877001e2e40cead125ccfa4430e7fd7 fix type definitions --- .../management/monitor/MetricAlertStatus.java | 78 ++++++++++++++++--- 1 file changed, 67 insertions(+), 11 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java index 4119c85cc31..ed503e54fcf 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java @@ -8,11 +8,15 @@ package com.microsoft.azure.management.monitor; +import java.util.Map; +import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; +import com.microsoft.rest.serializer.JsonFlatten; /** * An alert status. */ +@JsonFlatten public class MetricAlertStatus { /** * The status name. @@ -33,10 +37,22 @@ public class MetricAlertStatus { private String type; /** - * The alert status properties of the metric alert status. + * The dimensions property. */ - @JsonProperty(value = "properties") - private MetricAlertStatus properties; + @JsonProperty(value = "properties.dimensions") + private Map dimensions; + + /** + * status value. + */ + @JsonProperty(value = "properties.status") + private String status; + + /** + * UTC time when the status was checked. + */ + @JsonProperty(value = "properties.timestamp") + private DateTime timestamp; /** * Get the name value. @@ -99,22 +115,62 @@ public MetricAlertStatus withType(String type) { } /** - * Get the properties value. + * Get the dimensions value. + * + * @return the dimensions value + */ + public Map dimensions() { + return this.dimensions; + } + + /** + * Set the dimensions value. + * + * @param dimensions the dimensions value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withDimensions(Map dimensions) { + this.dimensions = dimensions; + return this; + } + + /** + * Get the status value. + * + * @return the status value + */ + public String status() { + return this.status; + } + + /** + * Set the status value. + * + * @param status the status value to set + * @return the MetricAlertStatus object itself. + */ + public MetricAlertStatus withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the timestamp value. * - * @return the properties value + * @return the timestamp value */ - public MetricAlertStatus properties() { - return this.properties; + public DateTime timestamp() { + return this.timestamp; } /** - * Set the properties value. + * Set the timestamp value. * - * @param properties the properties value to set + * @param timestamp the timestamp value to set * @return the MetricAlertStatus object itself. */ - public MetricAlertStatus withProperties(MetricAlertStatus properties) { - this.properties = properties; + public MetricAlertStatus withTimestamp(DateTime timestamp) { + this.timestamp = timestamp; return this; } From 82e457afaa247a537e4f5aacc7553bddc631970d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 16 Mar 2018 19:31:42 +0000 Subject: [PATCH 05/10] Generated from f81b39a8a23ec058ca2c72757aedc29896428426 Change flatten flag to false --- .../management/monitor/MetricAlertStatus.java | 78 +++---------------- .../monitor/MetricAlertStatusProperties.java | 7 +- 2 files changed, 15 insertions(+), 70 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java index ed503e54fcf..6df1732077d 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java @@ -8,15 +8,11 @@ package com.microsoft.azure.management.monitor; -import java.util.Map; -import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; -import com.microsoft.rest.serializer.JsonFlatten; /** * An alert status. */ -@JsonFlatten public class MetricAlertStatus { /** * The status name. @@ -37,22 +33,10 @@ public class MetricAlertStatus { private String type; /** - * The dimensions property. + * The alert status properties of the metric alert status. */ - @JsonProperty(value = "properties.dimensions") - private Map dimensions; - - /** - * status value. - */ - @JsonProperty(value = "properties.status") - private String status; - - /** - * UTC time when the status was checked. - */ - @JsonProperty(value = "properties.timestamp") - private DateTime timestamp; + @JsonProperty(value = "properties") + private MetricAlertStatusProperties properties; /** * Get the name value. @@ -115,62 +99,22 @@ public MetricAlertStatus withType(String type) { } /** - * Get the dimensions value. - * - * @return the dimensions value - */ - public Map dimensions() { - return this.dimensions; - } - - /** - * Set the dimensions value. - * - * @param dimensions the dimensions value to set - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withDimensions(Map dimensions) { - this.dimensions = dimensions; - return this; - } - - /** - * Get the status value. - * - * @return the status value - */ - public String status() { - return this.status; - } - - /** - * Set the status value. - * - * @param status the status value to set - * @return the MetricAlertStatus object itself. - */ - public MetricAlertStatus withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the timestamp value. + * Get the properties value. * - * @return the timestamp value + * @return the properties value */ - public DateTime timestamp() { - return this.timestamp; + public MetricAlertStatusProperties properties() { + return this.properties; } /** - * Set the timestamp value. + * Set the properties value. * - * @param timestamp the timestamp value to set + * @param properties the properties value to set * @return the MetricAlertStatus object itself. */ - public MetricAlertStatus withTimestamp(DateTime timestamp) { - this.timestamp = timestamp; + public MetricAlertStatus withProperties(MetricAlertStatusProperties properties) { + this.properties = properties; return this; } diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java index b94f3d02fc2..94360c50133 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatusProperties.java @@ -9,6 +9,7 @@ package com.microsoft.azure.management.monitor; import java.util.Map; +import org.joda.time.DateTime; import com.fasterxml.jackson.annotation.JsonProperty; /** @@ -31,7 +32,7 @@ public class MetricAlertStatusProperties { * UTC time when the status was checked. */ @JsonProperty(value = "timestamp") - private String timestamp; + private DateTime timestamp; /** * Get the dimensions value. @@ -78,7 +79,7 @@ public MetricAlertStatusProperties withStatus(String status) { * * @return the timestamp value */ - public String timestamp() { + public DateTime timestamp() { return this.timestamp; } @@ -88,7 +89,7 @@ public String timestamp() { * @param timestamp the timestamp value to set * @return the MetricAlertStatusProperties object itself. */ - public MetricAlertStatusProperties withTimestamp(String timestamp) { + public MetricAlertStatusProperties withTimestamp(DateTime timestamp) { this.timestamp = timestamp; return this; } From 342d7bd65a80e38224479a232c853f34e9bbcea7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 20 Mar 2018 22:48:56 +0000 Subject: [PATCH 06/10] Generated from f55f6ab4bf342187e73b81b2ac967bfafc63cab2 Update with review feedback --- .../monitor/MetricAlertCriteria.java | 28 +++++++++++++++++++ .../management/monitor/MetricCriteria.java | 14 +++++----- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java index 3b9aa4cd944..5e6b02bafcd 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertCriteria.java @@ -8,6 +8,8 @@ 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; @@ -21,4 +23,30 @@ @JsonSubTypes.Type(name = "Microsoft.Azure.Monitor.SingleResourceMultipleMetricCriteria", value = MetricAlertSingleResourceMultipleMetricCriteria.class) }) public class MetricAlertCriteria { + /** + * Unmatched properties from the message are deserialized this collection. + */ + @JsonProperty(value = "") + private Map additionalProperties; + + /** + * Get the additionalProperties value. + * + * @return the additionalProperties value + */ + public Map additionalProperties() { + return this.additionalProperties; + } + + /** + * Set the additionalProperties value. + * + * @param additionalProperties the additionalProperties value to set + * @return the MetricAlertCriteria object itself. + */ + public MetricAlertCriteria withAdditionalProperties(Map additionalProperties) { + this.additionalProperties = additionalProperties; + return this; + } + } diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java index eb5729169fc..c5b0ce6869c 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricCriteria.java @@ -37,13 +37,13 @@ public class MetricCriteria { * the criteria operator. */ @JsonProperty(value = "operator", required = true) - private String operator; + private Object operator; /** - * the criteria time aggregation value. + * the criteria time aggregation types. */ @JsonProperty(value = "timeAggregation", required = true) - private String timeAggregation; + private Object timeAggregation; /** * the criteria threshold value that activates the alert. @@ -122,7 +122,7 @@ public MetricCriteria withMetricNamespace(String metricNamespace) { * * @return the operator value */ - public String operator() { + public Object operator() { return this.operator; } @@ -132,7 +132,7 @@ public String operator() { * @param operator the operator value to set * @return the MetricCriteria object itself. */ - public MetricCriteria withOperator(String operator) { + public MetricCriteria withOperator(Object operator) { this.operator = operator; return this; } @@ -142,7 +142,7 @@ public MetricCriteria withOperator(String operator) { * * @return the timeAggregation value */ - public String timeAggregation() { + public Object timeAggregation() { return this.timeAggregation; } @@ -152,7 +152,7 @@ public String timeAggregation() { * @param timeAggregation the timeAggregation value to set * @return the MetricCriteria object itself. */ - public MetricCriteria withTimeAggregation(String timeAggregation) { + public MetricCriteria withTimeAggregation(Object timeAggregation) { this.timeAggregation = timeAggregation; return this; } From 170d29b9bb4e7cf72c7c9a780e689866821b0eb4 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 21 Mar 2018 20:21:53 +0000 Subject: [PATCH 07/10] Generated from 56e36aba5586ca28ffa15bf1e4ced88a73fdba25 review feedback corrections, typos --- .../monitor/implementation/MetricAlertResourceInner.java | 2 +- .../monitor/implementation/MetricAlertResourcePatchInner.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java index faf6331fded..e4856008d8c 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java @@ -62,7 +62,7 @@ public class MetricAlertResourceInner extends Resource { private Period windowSize; /** - * criteria. + * definies the specific alert criteria information. */ @JsonProperty(value = "properties.criteria", required = true) private MetricAlertCriteria criteria; diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java index 4ea6fea8641..958dcc470e6 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java @@ -68,7 +68,7 @@ public class MetricAlertResourcePatchInner { private Period windowSize; /** - * criteria. + * definies the specific alert criteria information. */ @JsonProperty(value = "properties.criteria", required = true) private MetricAlertCriteria criteria; From 0581ed232ed245801e1d4712b3dc1143208d1409 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 22 Mar 2018 17:47:29 +0000 Subject: [PATCH 08/10] Generated from 39e64c50ed648db6330d2c91ccf30beda754b46e fix examples --- .../microsoft/azure/management/monitor/MetricAlertStatus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java index 6df1732077d..8a3fb875106 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/MetricAlertStatus.java @@ -27,7 +27,7 @@ public class MetricAlertStatus { private String id; /** - * Possible values include: 'microsoft.insights/metricalerts/status'. + * The extended resource type name. */ @JsonProperty(value = "type") private String type; From 8b9aa08ceac19eee1ac5f0077268430e8b048308 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 22 Mar 2018 19:00:43 +0000 Subject: [PATCH 09/10] Generated from c7c883711c9ea38d5802e14942e5763f8307b607 spelling error in comment --- .../monitor/implementation/MetricAlertResourceInner.java | 2 +- .../monitor/implementation/MetricAlertResourcePatchInner.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java index e4856008d8c..d646967537b 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourceInner.java @@ -62,7 +62,7 @@ public class MetricAlertResourceInner extends Resource { private Period windowSize; /** - * definies the specific alert criteria information. + * defines the specific alert criteria information. */ @JsonProperty(value = "properties.criteria", required = true) private MetricAlertCriteria criteria; diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java index 958dcc470e6..d6ece9bfa04 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricAlertResourcePatchInner.java @@ -68,7 +68,7 @@ public class MetricAlertResourcePatchInner { private Period windowSize; /** - * definies the specific alert criteria information. + * defines the specific alert criteria information. */ @JsonProperty(value = "properties.criteria", required = true) private MetricAlertCriteria criteria; From 59433db737796a453e983d8a557be5f6ed6700cf Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 23 Mar 2018 17:05:37 +0000 Subject: [PATCH 10/10] Generated from c7c883711c9ea38d5802e14942e5763f8307b607 spelling error in comment --- .../monitor/implementation/MetricsInner.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java index 4351df4782b..17354274a57 100644 --- a/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java +++ b/azure-mgmt-monitor/src/main/java/com/microsoft/azure/management/monitor/implementation/MetricsInner.java @@ -55,7 +55,7 @@ public MetricsInner(Retrofit retrofit, MonitorManagementClientImpl client) { interface MetricsService { @Headers({ "Content-Type: application/json; charset=utf-8", "x-ms-logging-context: com.microsoft.azure.management.monitor.Metrics list" }) @GET("{resourceUri}/providers/microsoft.insights/metrics") - Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("timespan") String timespan, @Query("interval") Period interval, @Query("metricnames") String metricnames, @Query("aggregation") String aggregation, @Query("top") Integer top, @Query("orderby") String orderby, @Query("$filter") String filter, @Query("resultType") ResultType resultType1, @Query("api-version") String apiVersion, @Query("metricnamespace") String metricnamespace, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); + Observable> list(@Path(value = "resourceUri", encoded = true) String resourceUri, @Query("timespan") String timespan, @Query("interval") Period interval, @Query("metricnames") String metricnames, @Query("aggregation") String aggregation, @Query("top") Double top, @Query("orderby") String orderby, @Query("$filter") String filter, @Query("resultType") ResultType resultType1, @Query("api-version") String apiVersion, @Query("metricnamespace") String metricnamespace, @Header("accept-language") String acceptLanguage, @Header("User-Agent") String userAgent); } @@ -116,7 +116,7 @@ public Observable> listWithServiceResponseAsync(S final Period interval = null; final String metricnames = null; final String aggregation = null; - final Integer top = null; + final Double top = null; final String orderby = null; final String filter = null; final ResultType resultType = null; @@ -157,7 +157,7 @@ public Observable> call(Response re * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @return the ResponseInner object if successful. */ - public ResponseInner list(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public ResponseInner list(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { return listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace).toBlocking().single().body(); } @@ -182,7 +182,7 @@ public ResponseInner list(String resourceUri, String timespan, Period interval, * @throws IllegalArgumentException thrown if parameters fail the validation * @return the {@link ServiceFuture} object */ - public ServiceFuture listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace, final ServiceCallback serviceCallback) { + public ServiceFuture listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace, final ServiceCallback serviceCallback) { return ServiceFuture.fromResponse(listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace), serviceCallback); } @@ -206,7 +206,7 @@ public ServiceFuture listAsync(String resourceUri, String timespa * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResponseInner object */ - public Observable listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public Observable listAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { return listWithServiceResponseAsync(resourceUri, timespan, interval, metricnames, aggregation, top, orderby, filter, resultType, metricnamespace).map(new Func1, ResponseInner>() { @Override public ResponseInner call(ServiceResponse response) { @@ -235,7 +235,7 @@ public ResponseInner call(ServiceResponse response) { * @throws IllegalArgumentException thrown if parameters fail the validation * @return the observable to the ResponseInner object */ - public Observable> listWithServiceResponseAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Integer top, String orderby, String filter, ResultType resultType, String metricnamespace) { + public Observable> listWithServiceResponseAsync(String resourceUri, String timespan, Period interval, String metricnames, String aggregation, Double top, String orderby, String filter, ResultType resultType, String metricnamespace) { if (resourceUri == null) { throw new IllegalArgumentException("Parameter resourceUri is required and cannot be null."); }