From edb965beb28b6e44db24154ab716cbe816a784e3 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Tue, 12 Oct 2021 17:42:32 -0700 Subject: [PATCH 01/15] Add 2021-05-01-preview support for Autoscale --- .../2021-05-01-preview/autoscale_API.json | 916 ++++++++++++++++++ .../createOrUpdateAutoscaleSetting.json | 466 +++++++++ .../examples/deleteAutoscaleSetting.json | 12 + .../examples/getAutoscaleSetting.json | 167 ++++ .../examples/listAutoscaleSetting.json | 171 ++++ .../listAutoscaleSettingBySubscription.json | 170 ++++ .../examples/patchAutoscaleSetting.json | 313 ++++++ 7 files changed, 2215 insertions(+) create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteAutoscaleSetting.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json new file mode 100644 index 000000000000..70ccb20a557d --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -0,0 +1,916 @@ +{ + "swagger": "2.0", + "info": { + "title": "MonitorManagementClient", + "x-ms-code-generation-settings": { + "name": "MonitorManagementClient" + }, + "version": "2021-05-01-preview" + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "security": [ + { + "azure_auth": [ + "user_impersonation" + ] + } + ], + "securityDefinitions": { + "azure_auth": { + "type": "oauth2", + "authorizationUrl": "https://login.microsoftonline.com/common/oauth2/authorize", + "flow": "implicit", + "description": "Azure Active Directory OAuth2 Flow", + "scopes": { + "user_impersonation": "impersonate your user account" + } + } + }, + "paths": { + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings": { + "get": { + "description": "Lists the autoscale settings for a resource group", + "tags": [ + "AutoscaleSettings" + ], + "operationId": "AutoscaleSettings_ListByResourceGroup", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request for a list of autoscale settings", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResourceCollection" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List autoscale settings": { + "$ref": "./examples/listAutoscaleSetting.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}": { + "put": { + "description": "Creates or updates an autoscale setting.", + "tags": [ + "AutoscaleSettings" + ], + "operationId": "AutoscaleSettings_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AutoscaleSettingNameParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AutoscaleSettingResource" + }, + "description": "Parameters supplied to the operation." + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to create or update an autoscale setting", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResource" + } + }, + "201": { + "description": "Created autoscale setting", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResource" + } + } + }, + "x-ms-examples": { + "Create or update an autoscale setting": { + "$ref": "./examples/createOrUpdateAutoscaleSetting.json" + } + } + }, + "delete": { + "description": "Deletes and autoscale setting", + "tags": [ + "AutoscaleSettings" + ], + "operationId": "AutoscaleSettings_Delete", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AutoscaleSettingNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to delete an autoscale setting" + }, + "204": { + "description": "No content: Successful request to delete an autoscale setting, but the response is intentionally empty" + } + }, + "x-ms-examples": { + "Delete an autoscale setting": { + "$ref": "./examples/deleteAutoscaleSetting.json" + } + } + }, + "get": { + "description": "Gets an autoscale setting", + "tags": [ + "AutoscaleSettings" + ], + "operationId": "AutoscaleSettings_Get", + "parameters": [ + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AutoscaleSettingNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request to get one autoscale setting", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResource" + } + } + }, + "x-ms-examples": { + "Get an autoscale setting": { + "$ref": "./examples/getAutoscaleSetting.json" + } + } + }, + "patch": { + "description": "Updates an existing AutoscaleSettingsResource. To update other fields use the CreateOrUpdate method.", + "operationId": "AutoscaleSettings_Update", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AutoscaleSettingNameParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "name": "autoscaleSettingResource", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/AutoscaleSettingResourcePatch" + }, + "description": "Parameters supplied to the operation." + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "An existing autoscale setting resource was successfully updated.", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResource" + } + } + }, + "x-ms-examples": { + "Patch an autoscale setting": { + "$ref": "./examples/patchAutoscaleSetting.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings": { + "get": { + "description": "Lists the autoscale settings for a subscription", + "tags": [ + "AutoscaleSettings" + ], + "operationId": "AutoscaleSettings_ListBySubscription", + "parameters": [ + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/ErrorResponse" + } + }, + "200": { + "description": "Successful request for a list of autoscale settings", + "schema": { + "$ref": "#/definitions/AutoscaleSettingResourceCollection" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "List autoscale settings": { + "$ref": "./examples/listAutoscaleSettingBySubscription.json" + } + } + } + } + }, + "definitions": { + "Resource": { + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + } + }, + "required": [ + "location" + ], + "x-ms-azure-resource": true, + "description": "An azure resource object" + }, + "ScaleCapacity": { + "required": [ + "minimum", + "maximum", + "default" + ], + "properties": { + "minimum": { + "type": "string", + "description": "the minimum number of instances for the resource." + }, + "maximum": { + "type": "string", + "description": "the maximum number of instances for the resource. The actual maximum number of instances is limited by the cores that are available in the subscription." + }, + "default": { + "type": "string", + "description": "the number of instances that will be set if metrics are not available for evaluation. The default is only used if the current instance count is lower than the default." + } + }, + "description": "The number of instances that can be used during this profile." + }, + "MetricTrigger": { + "required": [ + "metricName", + "metricResourceUri", + "timeGrain", + "statistic", + "timeWindow", + "timeAggregation", + "operator", + "threshold" + ], + "properties": { + "metricName": { + "type": "string", + "description": "the name of the metric that defines what the rule monitors." + }, + "metricNamespace": { + "type": "string", + "description": "the namespace of the metric that defines what the rule monitors." + }, + "metricResourceUri": { + "type": "string", + "description": "the resource identifier of the resource the rule monitors." + }, + "metricResourceLocation": { + "type": "string", + "description": "the location of the resource the rule monitors." + }, + "timeGrain": { + "type": "string", + "format": "duration", + "description": "the granularity of metrics the rule monitors. Must be one of the predefined values returned from metric definitions for the metric. Must be between 12 hours and 1 minute." + }, + "statistic": { + "type": "string", + "description": "the metric statistic type. How the metrics from multiple instances are combined.", + "enum": [ + "Average", + "Min", + "Max", + "Sum", + "Count" + ], + "x-ms-enum": { + "name": "MetricStatisticType", + "modelAsString": false + } + }, + "timeWindow": { + "type": "string", + "format": "duration", + "description": "the range of time in which instance data is collected. This value must be greater than the delay in metric collection, which can vary from resource-to-resource. Must be between 12 hours and 5 minutes." + }, + "timeAggregation": { + "type": "string", + "description": "time aggregation type. How the data that is collected should be combined over time. The default value is Average.", + "enum": [ + "Average", + "Minimum", + "Maximum", + "Total", + "Count", + "Last" + ], + "x-ms-enum": { + "name": "TimeAggregationType", + "modelAsString": false + } + }, + "operator": { + "type": "string", + "description": "the operator that is used to compare the metric data and the threshold.", + "enum": [ + "Equals", + "NotEquals", + "GreaterThan", + "GreaterThanOrEqual", + "LessThan", + "LessThanOrEqual" + ], + "x-ms-enum": { + "name": "ComparisonOperationType", + "modelAsString": false + } + }, + "threshold": { + "type": "number", + "format": "double", + "description": "the threshold of the metric that triggers the scale action." + }, + "dimensions": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleRuleMetricDimension" + }, + "description": "List of dimension conditions. For example: [{\"DimensionName\":\"AppName\",\"Operator\":\"Equals\",\"Values\":[\"App1\"]},{\"DimensionName\":\"Deployment\",\"Operator\":\"Equals\",\"Values\":[\"default\"]}]." + }, + "dividePerInstance": { + "type": "boolean", + "description": "a value indicating whether metric should divide per instance." + } + }, + "description": "The trigger that results in a scaling action." + }, + "ScaleAction": { + "required": [ + "direction", + "type", + "cooldown" + ], + "properties": { + "direction": { + "type": "string", + "description": "the scale direction. Whether the scaling action increases or decreases the number of instances.", + "enum": [ + "None", + "Increase", + "Decrease" + ], + "x-ms-enum": { + "name": "ScaleDirection", + "modelAsString": false + } + }, + "type": { + "type": "string", + "description": "the type of action that should occur when the scale rule fires.", + "enum": [ + "ChangeCount", + "PercentChangeCount", + "ExactCount", + "ServiceAllowedNextValue" + ], + "x-ms-enum": { + "name": "ScaleType", + "modelAsString": false + } + }, + "value": { + "type": "string", + "description": "the number of instances that are involved in the scaling action. This value must be 1 or greater. The default value is 1.", + "default": "1" + }, + "cooldown": { + "type": "string", + "format": "duration", + "description": "the amount of time to wait since the last scaling action before this action occurs. It must be between 1 week and 1 minute in ISO 8601 format." + } + }, + "description": "The parameters for the scaling action." + }, + "ScaleRule": { + "required": [ + "scaleAction", + "metricTrigger" + ], + "properties": { + "metricTrigger": { + "$ref": "#/definitions/MetricTrigger", + "description": "the trigger that results in a scaling action." + }, + "scaleAction": { + "$ref": "#/definitions/ScaleAction", + "description": "the parameters for the scaling action." + } + }, + "description": "A rule that provide the triggers and parameters for the scaling action." + }, + "TimeWindow": { + "properties": { + "timeZone": { + "type": "string", + "description": "the timezone of the start and end times for the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time" + }, + "start": { + "type": "string", + "format": "date-time", + "description": "the start time for the profile in ISO 8601 format." + }, + "end": { + "type": "string", + "format": "date-time", + "description": "the end time for the profile in ISO 8601 format." + } + }, + "required": [ + "start", + "end" + ], + "description": "A specific date-time for the profile." + }, + "RecurrentSchedule": { + "required": [ + "timeZone", + "days", + "hours", + "minutes" + ], + "properties": { + "timeZone": { + "type": "string", + "description": "the timezone for the hours of the profile. Some examples of valid time zones are: Dateline Standard Time, UTC-11, Hawaiian Standard Time, Alaskan Standard Time, Pacific Standard Time (Mexico), Pacific Standard Time, US Mountain Standard Time, Mountain Standard Time (Mexico), Mountain Standard Time, Central America Standard Time, Central Standard Time, Central Standard Time (Mexico), Canada Central Standard Time, SA Pacific Standard Time, Eastern Standard Time, US Eastern Standard Time, Venezuela Standard Time, Paraguay Standard Time, Atlantic Standard Time, Central Brazilian Standard Time, SA Western Standard Time, Pacific SA Standard Time, Newfoundland Standard Time, E. South America Standard Time, Argentina Standard Time, SA Eastern Standard Time, Greenland Standard Time, Montevideo Standard Time, Bahia Standard Time, UTC-02, Mid-Atlantic Standard Time, Azores Standard Time, Cape Verde Standard Time, Morocco Standard Time, UTC, GMT Standard Time, Greenwich Standard Time, W. Europe Standard Time, Central Europe Standard Time, Romance Standard Time, Central European Standard Time, W. Central Africa Standard Time, Namibia Standard Time, Jordan Standard Time, GTB Standard Time, Middle East Standard Time, Egypt Standard Time, Syria Standard Time, E. Europe Standard Time, South Africa Standard Time, FLE Standard Time, Turkey Standard Time, Israel Standard Time, Kaliningrad Standard Time, Libya Standard Time, Arabic Standard Time, Arab Standard Time, Belarus Standard Time, Russian Standard Time, E. Africa Standard Time, Iran Standard Time, Arabian Standard Time, Azerbaijan Standard Time, Russia Time Zone 3, Mauritius Standard Time, Georgian Standard Time, Caucasus Standard Time, Afghanistan Standard Time, West Asia Standard Time, Ekaterinburg Standard Time, Pakistan Standard Time, India Standard Time, Sri Lanka Standard Time, Nepal Standard Time, Central Asia Standard Time, Bangladesh Standard Time, N. Central Asia Standard Time, Myanmar Standard Time, SE Asia Standard Time, North Asia Standard Time, China Standard Time, North Asia East Standard Time, Singapore Standard Time, W. Australia Standard Time, Taipei Standard Time, Ulaanbaatar Standard Time, Tokyo Standard Time, Korea Standard Time, Yakutsk Standard Time, Cen. Australia Standard Time, AUS Central Standard Time, E. Australia Standard Time, AUS Eastern Standard Time, West Pacific Standard Time, Tasmania Standard Time, Magadan Standard Time, Vladivostok Standard Time, Russia Time Zone 10, Central Pacific Standard Time, Russia Time Zone 11, New Zealand Standard Time, UTC+12, Fiji Standard Time, Kamchatka Standard Time, Tonga Standard Time, Samoa Standard Time, Line Islands Standard Time" + }, + "days": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the collection of days that the profile takes effect on. Possible values are Sunday through Saturday." + }, + "hours": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "A collection of hours that the profile takes effect on. Values supported are 0 to 23 on the 24-hour clock (AM/PM times are not supported)." + }, + "minutes": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "A collection of minutes at which the profile takes effect at." + } + }, + "description": "The scheduling constraints for when the profile begins." + }, + "Recurrence": { + "required": [ + "frequency", + "schedule" + ], + "properties": { + "frequency": { + "type": "string", + "description": "the recurrence frequency. How often the schedule profile should take effect. This value must be Week, meaning each week will have the same set of profiles. For example, to set a daily schedule, set **schedule** to every day of the week. The frequency property specifies that the schedule is repeated weekly.", + "enum": [ + "None", + "Second", + "Minute", + "Hour", + "Day", + "Week", + "Month", + "Year" + ], + "x-ms-enum": { + "name": "RecurrenceFrequency", + "modelAsString": false + } + }, + "schedule": { + "$ref": "#/definitions/RecurrentSchedule", + "description": "the scheduling constraints for when the profile begins." + } + }, + "description": "The repeating times at which this profile begins. This element is not used if the FixedDate element is used." + }, + "AutoscaleProfile": { + "required": [ + "rules", + "name", + "capacity" + ], + "properties": { + "name": { + "type": "string", + "description": "the name of the profile." + }, + "capacity": { + "$ref": "#/definitions/ScaleCapacity", + "description": "the number of instances that can be used during this profile." + }, + "rules": { + "type": "array", + "items": { + "$ref": "#/definitions/ScaleRule" + }, + "description": "the collection of rules that provide the triggers and parameters for the scaling action. A maximum of 10 rules can be specified." + }, + "fixedDate": { + "$ref": "#/definitions/TimeWindow", + "description": "the specific date-time for the profile. This element is not used if the Recurrence element is used." + }, + "recurrence": { + "$ref": "#/definitions/Recurrence", + "description": "the repeating times at which this profile begins. This element is not used if the FixedDate element is used." + } + }, + "description": "Autoscale profile." + }, + "PredictiveAutoscalePolicy": { + "required": [ + "scaleMode" + ], + "properties": { + "scaleMode": { + "type": "string", + "description": "the predictive autoscale mode", + "enum": [ + "Disabled", + "ForecastOnly", + "Enabled" + ], + "x-ms-enum": { + "name": "PredictiveAutoscalePolicyScaleMode", + "modelAsString": false + } + }, + "scaleLookAheadTime": { + "type": "string", + "format": "duration", + "description": "the amount of time to specify by which instances are launched in advance. It must be between 1 minute and 60 minutes in ISO 8601 format." + } + }, + "description": "The parameters for enabling predictive autoscale." + }, + "EmailNotification": { + "properties": { + "sendToSubscriptionAdministrator": { + "type": "boolean", + "description": "a value indicating whether to send email to subscription administrator.", + "default": false + }, + "sendToSubscriptionCoAdministrators": { + "type": "boolean", + "description": "a value indicating whether to send email to subscription co-administrators.", + "default": false + }, + "customEmails": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the custom e-mails list. This value can be null or empty, in which case this attribute will be ignored." + } + }, + "description": "Email notification of an autoscale event." + }, + "WebhookNotification": { + "properties": { + "serviceUri": { + "type": "string", + "description": "the service address to receive the notification." + }, + "properties": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "a property bag of settings. This value can be empty." + } + }, + "description": "Webhook notification of an autoscale event." + }, + "AutoscaleNotification": { + "required": [ + "operation" + ], + "properties": { + "operation": { + "type": "string", + "description": "the operation associated with the notification and its value must be \"scale\"", + "enum": [ + "Scale" + ], + "x-ms-enum": { + "name": "OperationType", + "modelAsString": false + } + }, + "email": { + "$ref": "#/definitions/EmailNotification", + "description": "the email notification." + }, + "webhooks": { + "type": "array", + "items": { + "$ref": "#/definitions/WebhookNotification" + }, + "description": "the collection of webhook notifications." + } + }, + "description": "Autoscale notification." + }, + "AutoscaleSetting": { + "required": [ + "profiles" + ], + "properties": { + "profiles": { + "type": "array", + "maxItems": 20, + "items": { + "$ref": "#/definitions/AutoscaleProfile" + }, + "description": "the collection of automatic scaling profiles that specify different scaling parameters for different time periods. A maximum of 20 profiles can be specified." + }, + "notifications": { + "type": "array", + "items": { + "$ref": "#/definitions/AutoscaleNotification" + }, + "description": "the collection of notifications." + }, + "enabled": { + "type": "boolean", + "description": "the enabled flag. Specifies whether automatic scaling is enabled for the resource. The default value is 'true'.", + "default": true + }, + "predictiveAutoscalePolicy": { + "$ref": "#/definitions/PredictiveAutoscalePolicy", + "description": "the predictive autoscale policy mode." + }, + "name": { + "type": "string", + "description": "the name of the autoscale setting." + }, + "targetResourceUri": { + "type": "string", + "description": "the resource identifier of the resource that the autoscale setting should be added to." + }, + "targetResourceLocation": { + "type": "string", + "description": "the location of the resource that the autoscale setting should be added to." + } + }, + "description": "A setting that contains all of the configuration for the automatic scaling of a resource." + }, + "AutoscaleSettingResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AutoscaleSetting", + "description": "The autoscale setting of the resource." + } + }, + "description": "The autoscale setting resource." + }, + "AutoscaleSettingResourcePatch": { + "description": "The autoscale setting object for patch operations.", + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/AutoscaleSetting", + "description": "The autoscale setting properties of the update operation." + } + } + }, + "AutoscaleSettingResourceCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/AutoscaleSettingResource" + }, + "description": "the values for the autoscale setting resources." + }, + "nextLink": { + "type": "string", + "description": "URL to get the next set of results." + } + }, + "required": [ + "value" + ], + "description": "Represents a collection of autoscale setting resources." + }, + "ErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "code": { + "description": "Error code", + "type": "string" + }, + "message": { + "description": "Error message indicating why the operation failed.", + "type": "string" + } + } + }, + "ScaleRuleMetricDimension": { + "required": [ + "DimensionName", + "Operator", + "Values" + ], + "properties": { + "DimensionName": { + "type": "string", + "description": "Name of the dimension." + }, + "Operator": { + "type": "string", + "description": "the dimension operator. Only 'Equals' and 'NotEquals' are supported. 'Equals' being equal to any of the values. 'NotEquals' being not equal to all of the values", + "enum": [ + "Equals", + "NotEquals" + ], + "x-ms-enum": { + "name": "ScaleRuleMetricDimensionOperationType", + "modelAsString": true + } + }, + "Values": { + "type": "array", + "items": { + "type": "string" + }, + "description": "list of dimension values. For example: [\"App1\",\"App2\"]." + } + }, + "description": "Specifies an auto scale rule metric dimension." + } + }, + "parameters": { + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "AutoscaleSettingNameParameter": { + "name": "autoscaleSettingName", + "in": "path", + "required": true, + "type": "string", + "description": "The autoscale setting name.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json new file mode 100644 index 000000000000..4061939d40cf --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json @@ -0,0 +1,466 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "TestingMetricsScaleSet", + "autoscaleSettingName": "MySetting", + "api-version": "2021-05-01-preview", + "parameters": { + "location": "West US", + "tags": {}, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled" + }, + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + }, + "201": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteAutoscaleSetting.json new file mode 100644 index 000000000000..59857126e096 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/deleteAutoscaleSetting.json @@ -0,0 +1,12 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "TestingMetricsScaleSet", + "autoscaleSettingName": "MySetting", + "api-version": "2021-05-01-prevew" + }, + "responses": { + "200": {}, + "204": {} + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json new file mode 100644 index 000000000000..9e1d9d13eaa8 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json @@ -0,0 +1,167 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "TestingMetricsScaleSet", + "autoscaleSettingName": "MySetting", + "api-version": "2021-05-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled" + }, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json new file mode 100644 index 000000000000..f1742473aae9 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json @@ -0,0 +1,171 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "TestingMetricsScaleSet", + "api-version": "2021-05-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled" + }, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + ], + "nextLink": "https://management.azure.com/########-####-####-####-############$skiptoken=######" + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json new file mode 100644 index 000000000000..562d737e43c6 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json @@ -0,0 +1,170 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "api-version": "2021-05-01-preview" + }, + "responses": { + "200": { + "headers": {}, + "body": { + "value": [ + { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled" + }, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + ], + "nextLink": "https://management.azure.com/########-####-####-####-############$skiptoken=######" + } + } + } +} diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json new file mode 100644 index 000000000000..e91f575b9e53 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json @@ -0,0 +1,313 @@ +{ + "parameters": { + "subscriptionId": "b67f7fec-69fc-4974-9099-a26bd6ffeda3", + "resourceGroupName": "TestingMetricsScaleSet", + "autoscaleSettingName": "MySetting", + "api-version": "2021-05-01-preview", + "autoscaleSettingResource": { + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled" + }, + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + }, + "responses": { + "200": { + "headers": {}, + "body": { + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "name": "MySetting", + "type": "Microsoft.Insights/autoscaleSettings", + "location": "West US", + "tags": { + "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" + }, + "properties": { + "profiles": [ + { + "name": "adios", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "fixedDate": { + "timeZone": "UTC", + "start": "2015-03-05T14:00:00Z", + "end": "2015-03-05T14:30:00Z" + } + }, + { + "name": "saludos", + "capacity": { + "minimum": "1", + "maximum": "10", + "default": "1" + }, + "rules": [ + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT1M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 10.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Increase", + "type": "ChangeCount", + "value": "1", + "cooldown": "PT5M" + } + }, + { + "metricTrigger": { + "metricName": "Percentage CPU", + "metricResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "timeGrain": "PT2M", + "statistic": "Average", + "timeWindow": "PT5M", + "timeAggregation": "Average", + "operator": "GreaterThan", + "threshold": 15.0, + "dividePerInstance": false + }, + "scaleAction": { + "direction": "Decrease", + "type": "ChangeCount", + "value": "2", + "cooldown": "PT6M" + } + } + ], + "recurrence": { + "frequency": "Week", + "schedule": { + "timeZone": "UTC", + "days": [ + "1" + ], + "hours": [ + 5 + ], + "minutes": [ + 15 + ] + } + } + } + ], + "enabled": true, + "name": "MySetting", + "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "notifications": [ + { + "operation": "Scale", + "email": { + "sendToSubscriptionAdministrator": true, + "sendToSubscriptionCoAdministrators": true, + "customEmails": [ + "gu@ms.com", + "ge@ns.net" + ] + }, + "webhooks": [ + { + "serviceUri": "http://myservice.com", + "properties": {} + } + ] + } + ] + } + } + } + } +} From 5affbf1aa11ab6513825de006a1ab829bd34a06d Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Thu, 14 Oct 2021 10:06:14 -0700 Subject: [PATCH 02/15] Include autoscale_API.json in readme and suppress example JSON inclusion. --- specification/monitor/resource-manager/readme.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 3c334ebaae12..012afe596ab5 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -36,6 +36,10 @@ title: MonitorManagementClient description: Monitor Management Client openapi-type: arm tag: package-2021-04 + +directive: + - suppress: Example Validations + reason: There are open issues (bugs) in the validator affecting some of the examples and since there is no way to selectively disable the validation for a particular example or paths, all of the example validation is being turned off. ``` ### Tag: package-2021-07 @@ -126,6 +130,7 @@ These settings apply only when `--tag=package-2021-05-01-preview-only` is specif ``` yaml $(tag) == 'package-2021-05-01-preview-only' input-file: +- Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json - Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettings_API.json - Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettingsCategories_API.json - Microsoft.Insights/preview/2021-05-01-preview/managementGroupDiagnosticSettings_API.json From a5adc3200828980cd012f49ddce73e5f0997210a Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Thu, 14 Oct 2021 13:33:28 -0700 Subject: [PATCH 03/15] Fix Swagger model validation --- .../preview/2021-05-01-preview/autoscale_API.json | 3 ++- .../2021-05-01-preview/examples/listAutoscaleSetting.json | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 70ccb20a557d..581275fd2239 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -328,10 +328,11 @@ ] }, "tags": { + "type": "object", "additionalProperties": { "type": "string" }, - "description": "Resource tags" + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters." } }, "required": [ diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json index f1742473aae9..7d61272544f6 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSetting.json @@ -15,7 +15,8 @@ "type": "Microsoft.Insights/autoscaleSettings", "location": "West US", "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + "key1": "value1", + "key2": "value2" }, "properties": { "profiles": [ @@ -138,7 +139,7 @@ ], "enabled": true, "predictiveAutoscalePolicy": { - "scaleMode": "Enabled" + "scaleMode": "Enabled" }, "name": "MySetting", "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", From 547d661b570b7de5112f6e532e2bd47d4d841a24 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Thu, 14 Oct 2021 16:18:10 -0700 Subject: [PATCH 04/15] Run prettier results --- .../examples/createOrUpdateAutoscaleSetting.json | 2 +- .../2021-05-01-preview/examples/patchAutoscaleSetting.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json index 4061939d40cf..15aa5da13438 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json @@ -128,7 +128,7 @@ ], "enabled": true, "predictiveAutoscalePolicy": { - "scaleMode": "Enabled" + "scaleMode": "Enabled" }, "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", "notifications": [ diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json index e91f575b9e53..8f98c28c8761 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json @@ -129,7 +129,7 @@ ], "enabled": true, "predictiveAutoscalePolicy": { - "scaleMode": "Enabled" + "scaleMode": "Enabled" }, "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", "notifications": [ From 3b1ece2f6e6a3e69aee58ce90741d98b744e68eb Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 11:02:25 -0700 Subject: [PATCH 05/15] Fix Swagger model validation error --- .../2021-05-01-preview/autoscale_API.json | 89 +++++++++---------- .../createOrUpdateAutoscaleSetting.json | 21 ++++- .../examples/getAutoscaleSetting.json | 2 +- .../listAutoscaleSettingBySubscription.json | 2 +- .../examples/patchAutoscaleSetting.json | 6 +- 5 files changed, 68 insertions(+), 52 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 581275fd2239..c783fa84204b 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -302,45 +302,6 @@ } }, "definitions": { - "Resource": { - "properties": { - "id": { - "type": "string", - "readOnly": true, - "description": "Azure resource Id" - }, - "name": { - "type": "string", - "readOnly": true, - "description": "Azure resource name" - }, - "type": { - "type": "string", - "readOnly": true, - "description": "Azure resource type" - }, - "location": { - "type": "string", - "description": "Resource location", - "x-ms-mutability": [ - "create", - "read" - ] - }, - "tags": { - "type": "object", - "additionalProperties": { - "type": "string" - }, - "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters." - } - }, - "required": [ - "location" - ], - "x-ms-azure-resource": true, - "description": "An azure resource object" - }, "ScaleCapacity": { "required": [ "minimum", @@ -777,7 +738,10 @@ }, "predictiveAutoscalePolicy": { "$ref": "#/definitions/PredictiveAutoscalePolicy", - "description": "the predictive autoscale policy mode." + "description": "the predictive autoscale policy mode.", + "x-ms-mutability": [ + "read" + ] }, "name": { "type": "string", @@ -795,16 +759,49 @@ "description": "A setting that contains all of the configuration for the automatic scaling of a resource." }, "AutoscaleSettingResource": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], "required": [ + "id", + "type", + "location", "properties" ], "properties": { + "id": { + "type": "string", + "x-ms-mutability": [ + "create", + "read" + ], + "description": "Azure resource Id" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + }, + "type": { + "type": "string", + "x-ms-mutability": [ + "create", + "read" + ], + "description": "Azure resource type" + }, + "location": { + "type": "string", + "description": "Resource location", + "x-ms-mutability": [ + "create", + "read" + ] + }, + "tags": { + "type": "object", + "additionalProperties": { + "type": "string" + }, + "description": "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters." + }, "properties": { "x-ms-client-flatten": true, "$ref": "#/definitions/AutoscaleSetting", diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json index 15aa5da13438..7c8f021533e1 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json @@ -6,7 +6,12 @@ "api-version": "2021-05-01-preview", "parameters": { "location": "West US", - "tags": {}, + "tags": { + "key1": "value1", + "key2": "value2" + }, + "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", + "type": "Microsoft.Insights/autoscaleSettings", "properties": { "profiles": [ { @@ -162,7 +167,8 @@ "type": "Microsoft.Insights/autoscaleSettings", "location": "West US", "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + "key1": "value1", + "key2": "value2" }, "properties": { "profiles": [ @@ -286,6 +292,10 @@ "enabled": true, "name": "MySetting", "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled", + "scaleLookAheadTime": null + }, "notifications": [ { "operation": "Scale", @@ -316,7 +326,8 @@ "type": "Microsoft.Insights/autoscaleSettings", "location": "West US", "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + "key1": "value1", + "key2": "value2" }, "properties": { "profiles": [ @@ -440,6 +451,10 @@ "enabled": true, "name": "MySetting", "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled", + "scaleLookAheadTime": null + }, "notifications": [ { "operation": "Scale", diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json index 9e1d9d13eaa8..f09114031abc 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/getAutoscaleSetting.json @@ -14,7 +14,7 @@ "type": "Microsoft.Insights/autoscaleSettings", "location": "West US", "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + "key1": "value1" }, "properties": { "profiles": [ diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json index 562d737e43c6..0dbc595ddd9f 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/listAutoscaleSettingBySubscription.json @@ -14,7 +14,7 @@ "type": "Microsoft.Insights/autoscaleSettings", "location": "West US", "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary, Microsoft.WindowsAzure.Management.Common.Storage" + "key1": "value1" }, "properties": { "profiles": [ diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json index 8f98c28c8761..88725fb2dbfa 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/patchAutoscaleSetting.json @@ -6,7 +6,7 @@ "api-version": "2021-05-01-preview", "autoscaleSettingResource": { "tags": { - "$type": "Microsoft.WindowsAzure.Management.Common.Storage.CasePreservedDictionary" + "key1": "value1" }, "properties": { "profiles": [ @@ -287,6 +287,10 @@ "enabled": true, "name": "MySetting", "targetResourceUri": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc", + "predictiveAutoscalePolicy": { + "scaleMode": "Enabled", + "scaleLookAheadTime": null + }, "notifications": [ { "operation": "Scale", From 252e1d4b119113041ddebc408b3b3405d7b27661 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 11:28:24 -0700 Subject: [PATCH 06/15] Fix formatter error --- .../preview/2021-05-01-preview/autoscale_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index c783fa84204b..1267f0c06625 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -740,7 +740,7 @@ "$ref": "#/definitions/PredictiveAutoscalePolicy", "description": "the predictive autoscale policy mode.", "x-ms-mutability": [ - "read" + "read" ] }, "name": { From 4dfa65f259cb3c9feccb9d1e3cbf895afffdb62f Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 12:27:24 -0700 Subject: [PATCH 07/15] Fix more swagger error --- .../2021-05-01-preview/autoscale_API.json | 35 +++++++++++-------- .../createOrUpdateAutoscaleSetting.json | 2 -- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 1267f0c06625..d2cf6916e44c 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -303,6 +303,7 @@ }, "definitions": { "ScaleCapacity": { + "type": "object", "required": [ "minimum", "maximum", @@ -325,6 +326,7 @@ "description": "The number of instances that can be used during this profile." }, "MetricTrigger": { + "type": "object", "required": [ "metricName", "metricResourceUri", @@ -429,6 +431,7 @@ "description": "The trigger that results in a scaling action." }, "ScaleAction": { + "type": "object", "required": [ "direction", "type", @@ -476,6 +479,7 @@ "description": "The parameters for the scaling action." }, "ScaleRule": { + "type": "object", "required": [ "scaleAction", "metricTrigger" @@ -493,6 +497,7 @@ "description": "A rule that provide the triggers and parameters for the scaling action." }, "TimeWindow": { + "type": "object", "properties": { "timeZone": { "type": "string", @@ -516,6 +521,7 @@ "description": "A specific date-time for the profile." }, "RecurrentSchedule": { + "type": "object", "required": [ "timeZone", "days", @@ -554,6 +560,7 @@ "description": "The scheduling constraints for when the profile begins." }, "Recurrence": { + "type": "object", "required": [ "frequency", "schedule" @@ -585,6 +592,7 @@ "description": "The repeating times at which this profile begins. This element is not used if the FixedDate element is used." }, "AutoscaleProfile": { + "type": "object", "required": [ "rules", "name", @@ -618,6 +626,7 @@ "description": "Autoscale profile." }, "PredictiveAutoscalePolicy": { + "type": "object", "required": [ "scaleMode" ], @@ -644,6 +653,7 @@ "description": "The parameters for enabling predictive autoscale." }, "EmailNotification": { + "type": "object", "properties": { "sendToSubscriptionAdministrator": { "type": "boolean", @@ -666,6 +676,7 @@ "description": "Email notification of an autoscale event." }, "WebhookNotification": { + "type": "object", "properties": { "serviceUri": { "type": "string", @@ -682,6 +693,7 @@ "description": "Webhook notification of an autoscale event." }, "AutoscaleNotification": { + "type": "object", "required": [ "operation" ], @@ -712,6 +724,7 @@ "description": "Autoscale notification." }, "AutoscaleSetting": { + "type": "object", "required": [ "profiles" ], @@ -738,10 +751,7 @@ }, "predictiveAutoscalePolicy": { "$ref": "#/definitions/PredictiveAutoscalePolicy", - "description": "the predictive autoscale policy mode.", - "x-ms-mutability": [ - "read" - ] + "description": "the predictive autoscale policy mode." }, "name": { "type": "string", @@ -759,19 +769,15 @@ "description": "A setting that contains all of the configuration for the automatic scaling of a resource." }, "AutoscaleSettingResource": { + "type": "object", "required": [ - "id", - "type", "location", "properties" ], "properties": { "id": { "type": "string", - "x-ms-mutability": [ - "create", - "read" - ], + "readOnly": true, "description": "Azure resource Id" }, "name": { @@ -781,10 +787,7 @@ }, "type": { "type": "string", - "x-ms-mutability": [ - "create", - "read" - ], + "readOnly": true, "description": "Azure resource type" }, "location": { @@ -811,9 +814,11 @@ "description": "The autoscale setting resource." }, "AutoscaleSettingResourcePatch": { + "type": "object", "description": "The autoscale setting object for patch operations.", "properties": { "tags": { + "type": "object", "additionalProperties": { "type": "string" }, @@ -827,6 +832,7 @@ } }, "AutoscaleSettingResourceCollection": { + "type": "object", "properties": { "value": { "type": "array", @@ -860,6 +866,7 @@ } }, "ScaleRuleMetricDimension": { + "type": "object", "required": [ "DimensionName", "Operator", diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json index 7c8f021533e1..e35e20a4db7d 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/createOrUpdateAutoscaleSetting.json @@ -10,8 +10,6 @@ "key1": "value1", "key2": "value2" }, - "id": "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/microsoft.insights/autoscalesettings/MySetting", - "type": "Microsoft.Insights/autoscaleSettings", "properties": { "profiles": [ { From d641501c876771d3eeabf3b6b8d291d191c93c3a Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 13:15:15 -0700 Subject: [PATCH 08/15] More fixing swagger errr --- .../2021-05-01-preview/autoscale_API.json | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index d2cf6916e44c..3c9864a1b059 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -811,6 +811,7 @@ "description": "The autoscale setting of the resource." } }, + "x-ms-azure-resource": true, "description": "The autoscale setting resource." }, "AutoscaleSettingResourcePatch": { @@ -855,13 +856,27 @@ "description": "Describes the format of Error response.", "type": "object", "properties": { - "code": { - "description": "Error code", - "type": "string" - }, - "message": { - "description": "Error message indicating why the operation failed.", - "type": "string" + "error": { + "type": "object", + "description": "The error object.", + "properties": { + "code": { + "description": "One of a server-defined set of error codes.", + "type": "string" + }, + "message": { + "description": "A human-readable representation of the error.", + "type": "string" + }, + "target": { + "description": "The target of the particular error.", + "type": "string" + }, + "details": { + "description": "A human-readable representation of the error's details.", + "type": "string" + } + } } } }, From 2ca81947ea130724abaadc62ac8be7b19af04395 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 14:05:27 -0700 Subject: [PATCH 09/15] Fix lint formatting issue --- specification/monitor/resource-manager/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/readme.md b/specification/monitor/resource-manager/readme.md index 012afe596ab5..041bcc2df5dd 100644 --- a/specification/monitor/resource-manager/readme.md +++ b/specification/monitor/resource-manager/readme.md @@ -128,7 +128,7 @@ input-file: These settings apply only when `--tag=package-2021-05-01-preview-only` is specified on the command line. -``` yaml $(tag) == 'package-2021-05-01-preview-only' +```yaml $(tag) == 'package-2021-05-01-preview-only' input-file: - Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json - Microsoft.Insights/preview/2021-05-01-preview/diagnosticsSettings_API.json From 23d233e3edf4dce36398b57c93e197ce676faaa7 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 14:47:08 -0700 Subject: [PATCH 10/15] Fix duplicate "ErrorResponse" issue --- .../preview/2021-05-01-preview/autoscale_API.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 3c9864a1b059..3ac46df5b099 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -58,7 +58,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -112,7 +112,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -158,7 +158,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -198,7 +198,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -244,7 +244,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -280,7 +280,7 @@ "default": { "description": "Error response describing why the operation failed.", "schema": { - "$ref": "#/definitions/ErrorResponse" + "$ref": "#/definitions/AutoscaleErrorResponse" } }, "200": { @@ -852,7 +852,7 @@ ], "description": "Represents a collection of autoscale setting resources." }, - "ErrorResponse": { + "AutoscaleErrorResponse": { "description": "Describes the format of Error response.", "type": "object", "properties": { From 780811fdb21134ae0b62d4b723170133bb981a6a Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 15:07:09 -0700 Subject: [PATCH 11/15] Swagger errors --- .../preview/2021-05-01-preview/autoscale_API.json | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 3ac46df5b099..0c29b509c852 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -2,9 +2,6 @@ "swagger": "2.0", "info": { "title": "MonitorManagementClient", - "x-ms-code-generation-settings": { - "name": "MonitorManagementClient" - }, "version": "2021-05-01-preview" }, "host": "management.azure.com", @@ -294,7 +291,7 @@ "nextLinkName": "nextLink" }, "x-ms-examples": { - "List autoscale settings": { + "List autoscale settings by subs": { "$ref": "./examples/listAutoscaleSettingBySubscription.json" } } @@ -809,6 +806,11 @@ "x-ms-client-flatten": true, "$ref": "#/definitions/AutoscaleSetting", "description": "The autoscale setting of the resource." + }, + "systemData": { + "readOnly": true, + "description": "The system metadata related to the response.", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" } }, "x-ms-azure-resource": true, @@ -877,6 +879,11 @@ "type": "string" } } + }, + "systemData": { + "readOnly": true, + "description": "The system metadata related to ththe response.", + "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" } } }, From 6fbc94f44297ebcd48c1830d5b2a6795cc5498ec Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 15:25:07 -0700 Subject: [PATCH 12/15] fix typo --- .../preview/2021-05-01-preview/autoscale_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 0c29b509c852..945c9aece01c 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -882,7 +882,7 @@ }, "systemData": { "readOnly": true, - "description": "The system metadata related to ththe response.", + "description": "The system metadata related to the response.", "$ref": "../../../../../common-types/resource-management/v2/types.json#/definitions/systemData" } } From f389df2b27963621029780e4f2b0955f4e51bbd5 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 17:34:57 -0700 Subject: [PATCH 13/15] Add new controller path autoscaleResourceUri/predictiveMetrics --- .../2021-05-01-preview/autoscale_API.json | 151 ++++++++++++++++++ .../examples/GetPredictiveMetric.json | 39 +++++ 2 files changed, 190 insertions(+) create mode 100644 specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 945c9aece01c..31ec3730f64a 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -258,6 +258,57 @@ } } }, + "/{autoscaleResourceUri}/predictiveMetrics": { + "get": { + "tags": [ + "Metrics" + ], + "operationId": "PredictiveMetric_Get", + "description": "get predictive autoscale etric future data", + "parameters": [ + { + "$ref": "#/parameters/ResourceUriParameter" + }, + { + "$ref": "#/parameters/TimespanParameter" + }, + { + "$ref": "#/parameters/IntervalParameter" + }, + { + "$ref": "#/parameters/MetricNamespaceParameter" + }, + { + "$ref": "#/parameters/MetricNamesParameter" + }, + { + "$ref": "#/parameters/AggregationParameter" + }, + { + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/ApiVersionParameter" + } + ], + "responses": { + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/AutoscaleErrorResponse" + } + }, + "200": { + "description": "Successful request to get the list of metric values.", + "schema": { + "$ref": "#/definitions/PredictiveResponse" + } + } + }, + "x-ms-examples": { + "Get Metric for data": { + "$ref": "./examples/GetPredictiveMetric.json" + } + } + } + }, "/subscriptions/{subscriptionId}/providers/Microsoft.Insights/autoscalesettings": { "get": { "description": "Lists the autoscale settings for a subscription", @@ -920,6 +971,56 @@ } }, "description": "Specifies an auto scale rule metric dimension." + }, + "PredictiveResponse": { + "type": "object", + "properties": { + "timespan": { + "type": "string", + "description": "The timespan for which the data was retrieved. Its value consists of two datetimes concatenated, separated by '/'. This may be adjusted in the future and returned back from what was originally requested." + }, + "interval": { + "type": "string", + "format": "duration", + "description": "The interval (window size) for which the metric data was returned in. This may be adjusted in the future and returned back from what was originally requested. This is not present if a metadata request was made." + }, + "metricName": { + "type": "string", + "description": "The metrics being queried" + }, + "targetResourceId": { + "type": "string", + "description": "resource of the predictive metric." + }, + "data": { + "type": "array", + "items": { + "$ref": "#/definitions/PredictiveValue" + }, + "description": "the value of the collection." + } + }, + "description": "The response to a metrics query." + }, + "PredictiveValue": { + "type": "object", + "required": [ + "timeStamp", + "value" + ], + "properties": { + "timeStamp": { + "type": "string", + "format": "date-time", + "description": "the timestamp for the metric value in ISO 8601 format." + }, + "value": { + "type": "number", + "format": "double", + "description": "Predictive value in this time bucket." + } + }, + "description": "Represents a predictive metric value in the given bucket." } }, "parameters": { @@ -938,6 +1039,56 @@ "type": "string", "description": "The autoscale setting name.", "x-ms-parameter-location": "method" + }, + "ResourceUriParameter": { + "name": "autoscaleResourceUri", + "in": "path", + "required": true, + "type": "string", + "description": "The identifier of the resource.", + "x-ms-parameter-location": "method", + "x-ms-skip-url-encoding": true + }, + "TimespanParameter": { + "name": "timespan", + "in": "query", + "required": true, + "type": "string", + "description": "The timespan of the query. It is a string with the following format 'startDateTime_ISO/endDateTime_ISO'.", + "x-ms-parameter-location": "method" + }, + "IntervalParameter": { + "name": "interval", + "in": "query", + "required": true, + "type": "string", + "format": "duration", + "description": "The interval (i.e. timegrain) of the query.", + "x-ms-parameter-location": "method" + }, + "MetricNamesParameter": { + "name": "metricName", + "in": "query", + "required": true, + "type": "string", + "description": "The names of the metrics (comma separated) to retrieve. Special case: If a metricname itself has a comma in it then use %2 to indicate it. Eg: 'Metric,Name1' should be **'Metric%2Name1'**", + "x-ms-parameter-location": "method" + }, + "AggregationParameter": { + "name": "aggregation", + "in": "query", + "required": true, + "type": "string", + "description": "The list of aggregation types (comma separated) to retrieve.", + "x-ms-parameter-location": "method" + }, + "MetricNamespaceParameter": { + "name": "metricNamespace", + "in": "query", + "required": true, + "type": "string", + "description": "Metric namespace to query metric definitions for.", + "x-ms-parameter-location": "method" } } } diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json new file mode 100644 index 000000000000..78b890f72334 --- /dev/null +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json @@ -0,0 +1,39 @@ +{ + "parameters": { + "autoscaleResourceUri": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patttsRG/providers/microsoft.insights/autoscalesettings/pattts-vmss1-Autoscale-775", + "timespan": "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z", + "metricNamespace": "Microsoft.Compute/virtualMachineScaleSets", + "metricName": "PercentageCPU", + "aggregation": "Total", + "interval": "PT1H", + "api-version": "2021-05-01-preview" + }, + "responses": { + "200": { + "body": { + "timespan": "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z", + "interval": "PT1H", + "metricName": "PercentageCPU", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patttsRG/providers/Microsoft.Compute/virtualMachineScaleSets/pattts-vmss1", + "data": [ + { + "timeStamp": "2021-10-14T22:00:00Z", + "value": 123.0 + }, + { + "timeStamp": "2021-10-14T22:02:00Z", + "value": 120.0 + }, + { + "timeStamp": "2021-10-14T22:02:00Z", + "value": 88.0 + }, + { + "timeStamp": "2021-10-14T22:03:00Z", + "value": 100.0 + } + ] + } + } + } +} From e3ae20a9641db9b0788eac2ce2e312db360fc747 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Fri, 15 Oct 2021 17:48:36 -0700 Subject: [PATCH 14/15] Fix typo --- .../preview/2021-05-01-preview/autoscale_API.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 31ec3730f64a..320cec16eed7 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -264,7 +264,7 @@ "Metrics" ], "operationId": "PredictiveMetric_Get", - "description": "get predictive autoscale etric future data", + "description": "get predictive autoscale metric future data", "parameters": [ { "$ref": "#/parameters/ResourceUriParameter" From d4678258321ccc4c4e6e5309313766d39fd7e7d0 Mon Sep 17 00:00:00 2001 From: Patrick Tseng Date: Sat, 16 Oct 2021 13:10:55 -0700 Subject: [PATCH 15/15] Trying fix braking changes. --- .../2021-05-01-preview/autoscale_API.json | 19 ++++++++----------- .../examples/GetPredictiveMetric.json | 6 ++++-- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json index 320cec16eed7..bb73f6675c83 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/autoscale_API.json @@ -258,7 +258,7 @@ } } }, - "/{autoscaleResourceUri}/predictiveMetrics": { + "/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Insights/autoscalesettings/{autoscaleSettingName}/predictiveMetrics": { "get": { "tags": [ "Metrics" @@ -267,7 +267,13 @@ "description": "get predictive autoscale metric future data", "parameters": [ { - "$ref": "#/parameters/ResourceUriParameter" + "$ref": "../../../../../common-types/resource-management/v2/types.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/AutoscaleSettingNameParameter" }, { "$ref": "#/parameters/TimespanParameter" @@ -1040,15 +1046,6 @@ "description": "The autoscale setting name.", "x-ms-parameter-location": "method" }, - "ResourceUriParameter": { - "name": "autoscaleResourceUri", - "in": "path", - "required": true, - "type": "string", - "description": "The identifier of the resource.", - "x-ms-parameter-location": "method", - "x-ms-skip-url-encoding": true - }, "TimespanParameter": { "name": "timespan", "in": "query", diff --git a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json index 78b890f72334..165be02c8a0c 100644 --- a/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json +++ b/specification/monitor/resource-manager/Microsoft.Insights/preview/2021-05-01-preview/examples/GetPredictiveMetric.json @@ -1,6 +1,8 @@ { "parameters": { - "autoscaleResourceUri": "subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patttsRG/providers/microsoft.insights/autoscalesettings/pattts-vmss1-Autoscale-775", + "subscriptionId": "00000000-0000-0000-0000-000000000000", + "resourceGroupName": "myRG", + "autoscaleSettingName": "vmss1-Autoscale-775", "timespan": "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z", "metricNamespace": "Microsoft.Compute/virtualMachineScaleSets", "metricName": "PercentageCPU", @@ -14,7 +16,7 @@ "timespan": "2021-10-14T22:00:00.000Z/2021-10-16T22:00:00.000Z", "interval": "PT1H", "metricName": "PercentageCPU", - "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/patttsRG/providers/Microsoft.Compute/virtualMachineScaleSets/pattts-vmss1", + "targetResourceId": "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.Compute/virtualMachineScaleSets/vmss1", "data": [ { "timeStamp": "2021-10-14T22:00:00Z",