From c31d0100f8c8aaf11210ad718cbe2a6e3cd87e7c Mon Sep 17 00:00:00 2001 From: giladsu <43436811+giladsu@users.noreply.github.com> Date: Thu, 5 Nov 2020 05:04:26 +0200 Subject: [PATCH] Renamed swagger file to ResourceHealthAlerts (#11164) * Renamed swagger file to ResourceHealthAlertRules * Extracted operations API to AlertsManagement file * Renamed ResourceHealthAlerts to ResourceHealthAlertRules * Added new file to readme * Updated examples * Fixed prettier issues * Prettier fix --- .../2020-08-04-preview/AlertsManagement.json | 532 ---------------- .../ResourceHealthAlertRules.json | 574 ++++++++++++++++++ ...reateOrUpdateResourceHealthAlertRule.json} | 6 +- ...son => deleteResourceHealthAlertRule.json} | 0 ...t.json => getResourceHealthAlertRule.json} | 4 +- ...json => listResourceHealthAlertRules.json} | 4 +- ...json => patchResourceHealthAlertRule.json} | 8 +- .../resource-manager/readme.md | 1 + 8 files changed, 591 insertions(+), 538 deletions(-) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/ResourceHealthAlertRules.json rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/{createOrUpdateResourceHealthAlert.json => createOrUpdateResourceHealthAlertRule.json} (95%) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/{deleteResourceHealthAlert.json => deleteResourceHealthAlertRule.json} (100%) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/{getResourceHealthAlert.json => getResourceHealthAlertRule.json} (94%) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/{listResourceHealthAlerts.json => listResourceHealthAlertRules.json} (94%) rename specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/{patchResourceHealthAlert.json => patchResourceHealthAlertRule.json} (93%) diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/AlertsManagement.json index 6a49a3228a39..9b17f3d56e34 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/AlertsManagement.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/AlertsManagement.json @@ -51,518 +51,9 @@ "nextLinkName": "nextLink" } } - }, - "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/resourceHealthAlerts": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve health alert rule definitions in a subscription.", - "operationId": "HealthAlerts_ListBySubscription", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResourceCollection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - }, - "x-ms-examples": { - "ListResourceHealthAlertRules": { - "$ref": "./examples/listResourceHealthAlerts.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlerts": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve alert rule definitions in a resource group.", - "operationId": "HealthAlerts_ListByResourceGroup", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResourceCollection" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-pageable": { - "nextLinkName": null - }, - "x-ms-examples": { - "ListResourceHealthAlertRules": { - "$ref": "./examples/listResourceHealthAlerts.json" - } - } - } - }, - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlerts/{ruleName}": { - "get": { - "tags": [ - "HealthAlerts" - ], - "description": "Retrieve an alert rule definition.", - "operationId": "HealthAlerts_Get", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request for a list of health alerts", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "GetResourceHealthAlertRule": { - "$ref": "./examples/getResourceHealthAlert.json" - } - } - }, - "put": { - "tags": [ - "HealthAlerts" - ], - "description": "Create or update an health alert definition.", - "operationId": "HealthAlerts_CreateOrUpdate", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HealthAlertResource" - }, - "description": "The parameters of the rule to create or update." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "CreateResourceHealthAlertRule": { - "$ref": "./examples/createOrUpdateResourceHealthAlert.json" - } - } - }, - "patch": { - "tags": [ - "HealthAlerts" - ], - "description": "Update an health alert definition.", - "operationId": "HealthAlerts_Update", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - }, - { - "name": "parameters", - "in": "body", - "required": true, - "schema": { - "$ref": "#/definitions/HealthAlertResourcePatch" - }, - "description": "The parameters of the rule to update." - } - ], - "responses": { - "200": { - "description": "OK", - "schema": { - "$ref": "#/definitions/HealthAlertResource" - } - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "PatchResourceHealthAlertRule": { - "$ref": "./examples/patchResourceHealthAlert.json" - } - } - }, - "delete": { - "tags": [ - "HealthAlerts" - ], - "description": "Delete an alert rule definition.", - "operationId": "HealthAlerts_Delete", - "parameters": [ - { - "$ref": "#/parameters/SubscriptionIdParameter" - }, - { - "$ref": "#/parameters/ResourceGroupNameParameter" - }, - { - "$ref": "#/parameters/RuleNameParameter" - }, - { - "$ref": "#/parameters/ApiVersionParameter" - } - ], - "responses": { - "200": { - "description": "Successful request to delete an health alert rule" - }, - "204": { - "description": "No content: the request was successful, but the response is empty" - }, - "default": { - "description": "Error response describing why the operation failed.", - "schema": { - "$ref": "#/definitions/HealthAlertsErrorResponse" - } - } - }, - "x-ms-examples": { - "DeleteResourceHealthAlertRule": { - "$ref": "./examples/deleteResourceHealthAlert.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" - }, - "HealthAlertAction": { - "description": "An alert action.", - "properties": { - "actionGroupId": { - "type": "string", - "description": "the id of the action group to use." - }, - "webHookProperties": { - "type": "object", - "additionalProperties": { - "type": "string", - "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." - }, - "description": "The properties of a webhook object." - } - } - }, - "HealthAlertProperties": { - "required": [ - "enabled", - "description", - "criteria" - ], - "properties": { - "description": { - "type": "string", - "description": "the description of the health alert that will be included in the alert email." - }, - "enabled": { - "type": "boolean", - "description": "the flag that indicates whether the health alert is enabled." - }, - "scopes": { - "type": "array", - "items": { - "type": "string" - }, - "description": "the list of resource id's that this health alert is scoped to." - }, - "criteria": { - "$ref": "#/definitions/HealthAlertCriteria", - "description": "defines the specific alert criteria information." - }, - "actions": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertAction" - }, - "description": "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved." - }, - "lastUpdatedTime": { - "readOnly": true, - "type": "string", - "format": "date-time", - "description": "Last time the rule was updated in ISO8601 format." - } - }, - "description": "An alert rule." - }, - "HealthAlertResource": { - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/Resource" - } - ], - "required": [ - "properties" - ], - "properties": { - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/HealthAlertProperties", - "description": "The alert rule properties of the resource." - } - }, - "description": "The health alert resource." - }, - "HealthAlertResourcePatch": { - "properties": { - "tags": { - "additionalProperties": { - "type": "string" - }, - "description": "Resource tags" - }, - "properties": { - "x-ms-client-flatten": true, - "$ref": "#/definitions/HealthAlertProperties", - "description": "The alert rule properties of the resource." - } - }, - "description": "The health alert resource for patch operations." - }, - "HealthAlertResourceCollection": { - "properties": { - "value": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertResource" - }, - "description": "the values for the alert rule resources." - } - }, - "description": "Represents a collection of alert rule resources." - }, - "HealthAlertCriteria": { - "type": "object", - "properties": { - "allOf": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthAlertCriterion" - }, - "description": "The list of metric criteria for this 'all of' operation. " - } - }, - "description": "Specifies the resource health alert criteria for a single resource that has multiple metric criteria." - }, - "HealthAlertCriterion": { - "type": "object", - "additionalProperties": { - "type": "object" - }, - "discriminator": "namespace", - "properties": { - "namespace": { - "type": "string", - "enum": [ - "VmGuestHealth" - ], - "x-ms-enum": { - "name": "HealthAlertsNamespace", - "modelAsString": true - }, - "description": "specifies the type of the alert criterion." - } - }, - "required": [ - "namespace" - ], - "description": "The rule criterion that defines the conditions of the alert rule." - }, - "VmGuestHealthAlertCriterion": { - "x-ms-discriminator-value": "VmGuestHealth", - "type": "object", - "allOf": [ - { - "$ref": "#/definitions/HealthAlertCriterion" - } - ], - "properties": { - "healthMonitorName": { - "type": "string", - "description": "Name of health monitor on which to define alert" - }, - "healthStates": { - "type": "array", - "items": { - "$ref": "#/definitions/HealthState" - }, - "description": "Health states to alert on" - } - }, - "required": [ - "healthMonitorName" - ], - "description": "Specifies the health alert criteria to alert on." - }, - "HealthState": { - "type": "object", - "properties": { - "healthStateName": { - "type": "string", - "description": "Health state" - }, - "severity": { - "type": "string", - "description": "Severity of alert fired" - } - }, - "required": [ - "healthStateName", - "severity" - ], - "description": "Specifies the health state to alert on and the corresponding severity" - }, - "HealthAlertsErrorResponse": { - "description": "Describes the format of Error response.", - "type": "object", - "properties": { - "error": { - "$ref": "#/definitions/HealthAlertsErrorResponseBody" - } - } - }, - "HealthAlertsErrorResponseBody": { - "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" - } - } - }, "operation": { "description": "Operation provided by provider", "properties": { @@ -615,35 +106,12 @@ } }, "parameters": { - "SubscriptionIdParameter": { - "name": "subscriptionId", - "in": "path", - "required": true, - "type": "string", - "description": "The Azure subscription Id." - }, "ApiVersionParameter": { "name": "api-version", "in": "query", "required": true, "type": "string", "description": "Client Api Version." - }, - "ResourceGroupNameParameter": { - "name": "resourceGroupName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the resource group.", - "x-ms-parameter-location": "method" - }, - "RuleNameParameter": { - "name": "ruleName", - "in": "path", - "required": true, - "type": "string", - "description": "The name of the rule.", - "x-ms-parameter-location": "method" } } } diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/ResourceHealthAlertRules.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/ResourceHealthAlertRules.json new file mode 100644 index 000000000000..0ede910f5f1b --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/ResourceHealthAlertRules.json @@ -0,0 +1,574 @@ +{ + "swagger": "2.0", + "info": { + "version": "2020-08-04-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "Azure Alerts Management Service provides a single pane of glass of alerts across Azure Monitor." + }, + "host": "management.azure.com", + "schemes": [ + "https" + ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], + "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}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve health alert rule definitions in a subscription.", + "operationId": "HealthAlerts_ListBySubscription", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListResourceHealthAlertRules": { + "$ref": "./examples/listResourceHealthAlertRules.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve alert rule definitions in a resource group.", + "operationId": "HealthAlerts_ListByResourceGroup", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResourceCollection" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": null + }, + "x-ms-examples": { + "ListResourceHealthAlertRules": { + "$ref": "./examples/listResourceHealthAlertRules.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AlertsManagement/resourceHealthAlertRules/{ruleName}": { + "get": { + "tags": [ + "HealthAlerts" + ], + "description": "Retrieve an alert rule definition.", + "operationId": "HealthAlerts_Get", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request for a list of health alerts", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "GetResourceHealthAlertRuleRule": { + "$ref": "./examples/getResourceHealthAlertRule.json" + } + } + }, + "put": { + "tags": [ + "HealthAlerts" + ], + "description": "Create or update an health alert definition.", + "operationId": "HealthAlerts_CreateOrUpdate", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/HealthAlertResource" + }, + "description": "The parameters of the rule to create or update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "CreateResourceHealthAlertRule": { + "$ref": "./examples/createOrUpdateResourceHealthAlertRule.json" + } + } + }, + "patch": { + "tags": [ + "HealthAlerts" + ], + "description": "Update an health alert definition.", + "operationId": "HealthAlerts_Update", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + }, + { + "name": "parameters", + "in": "body", + "required": true, + "schema": { + "$ref": "#/definitions/HealthAlertResourcePatch" + }, + "description": "The parameters of the rule to update." + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/HealthAlertResource" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "PatchResourceHealthAlertRule": { + "$ref": "./examples/patchResourceHealthAlertRule.json" + } + } + }, + "delete": { + "tags": [ + "HealthAlerts" + ], + "description": "Delete an alert rule definition.", + "operationId": "HealthAlerts_Delete", + "parameters": [ + { + "$ref": "#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "#/parameters/ResourceGroupNameParameter" + }, + { + "$ref": "#/parameters/RuleNameParameter" + }, + { + "$ref": "#/parameters/ApiVersionParameter" + } + ], + "responses": { + "200": { + "description": "Successful request to delete an health alert rule" + }, + "204": { + "description": "No content: the request was successful, but the response is empty" + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/HealthAlertsErrorResponse" + } + } + }, + "x-ms-examples": { + "DeleteResourceHealthAlertRule": { + "$ref": "./examples/deleteResourceHealthAlertRule.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" + }, + "HealthAlertAction": { + "description": "An alert action.", + "properties": { + "actionGroupId": { + "type": "string", + "description": "the id of the action group to use." + }, + "webHookProperties": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "the dictionary of custom properties to include with the post operation. These data are appended to the webhook payload." + }, + "description": "The properties of a webhook object." + } + } + }, + "HealthAlertProperties": { + "required": [ + "enabled", + "description", + "criteria" + ], + "properties": { + "description": { + "type": "string", + "description": "the description of the health alert that will be included in the alert email." + }, + "enabled": { + "type": "boolean", + "description": "the flag that indicates whether the health alert is enabled." + }, + "scopes": { + "type": "array", + "items": { + "type": "string" + }, + "description": "the list of resource id's that this health alert is scoped to." + }, + "criteria": { + "$ref": "#/definitions/HealthAlertCriteria", + "description": "defines the specific alert criteria information." + }, + "actions": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertAction" + }, + "description": "the array of actions that are performed when the alert rule becomes active, and when an alert condition is resolved." + }, + "lastUpdatedTime": { + "readOnly": true, + "type": "string", + "format": "date-time", + "description": "Last time the rule was updated in ISO8601 format." + } + }, + "description": "An alert rule." + }, + "HealthAlertResource": { + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "required": [ + "properties" + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/HealthAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The health alert resource." + }, + "HealthAlertResourcePatch": { + "properties": { + "tags": { + "additionalProperties": { + "type": "string" + }, + "description": "Resource tags" + }, + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/HealthAlertProperties", + "description": "The alert rule properties of the resource." + } + }, + "description": "The health alert resource for patch operations." + }, + "HealthAlertResourceCollection": { + "properties": { + "value": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertResource" + }, + "description": "the values for the alert rule resources." + } + }, + "description": "Represents a collection of alert rule resources." + }, + "HealthAlertCriteria": { + "type": "object", + "properties": { + "allOf": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthAlertCriterion" + }, + "description": "The list of metric criteria for this 'all of' operation. " + } + }, + "description": "Specifies the resource health alert criteria for a single resource that has multiple metric criteria." + }, + "HealthAlertCriterion": { + "type": "object", + "additionalProperties": { + "type": "object" + }, + "discriminator": "namespace", + "properties": { + "namespace": { + "type": "string", + "enum": [ + "VmGuestHealth" + ], + "x-ms-enum": { + "name": "HealthAlertsNamespace", + "modelAsString": true + }, + "description": "specifies the type of the alert criterion." + } + }, + "required": [ + "namespace" + ], + "description": "The rule criterion that defines the conditions of the alert rule." + }, + "VmGuestHealthAlertCriterion": { + "x-ms-discriminator-value": "VmGuestHealth", + "type": "object", + "allOf": [ + { + "$ref": "#/definitions/HealthAlertCriterion" + } + ], + "properties": { + "healthMonitorName": { + "type": "string", + "description": "Name of health monitor on which to define alert" + }, + "healthStates": { + "type": "array", + "items": { + "$ref": "#/definitions/HealthState" + }, + "description": "Health states to alert on" + } + }, + "required": [ + "healthMonitorName" + ], + "description": "Specifies the health alert criteria to alert on." + }, + "HealthState": { + "type": "object", + "properties": { + "healthStateName": { + "type": "string", + "description": "Health state" + }, + "severity": { + "type": "string", + "description": "Severity of alert fired" + } + }, + "required": [ + "healthStateName", + "severity" + ], + "description": "Specifies the health state to alert on and the corresponding severity" + }, + "HealthAlertsErrorResponse": { + "description": "Describes the format of Error response.", + "type": "object", + "properties": { + "error": { + "$ref": "#/definitions/HealthAlertsErrorResponseBody" + } + } + }, + "HealthAlertsErrorResponseBody": { + "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" + } + } + } + }, + "parameters": { + "SubscriptionIdParameter": { + "name": "subscriptionId", + "in": "path", + "required": true, + "type": "string", + "description": "The Azure subscription Id." + }, + "ApiVersionParameter": { + "name": "api-version", + "in": "query", + "required": true, + "type": "string", + "description": "Client Api Version." + }, + "ResourceGroupNameParameter": { + "name": "resourceGroupName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the resource group.", + "x-ms-parameter-location": "method" + }, + "RuleNameParameter": { + "name": "ruleName", + "in": "path", + "required": true, + "type": "string", + "description": "The name of the rule.", + "x-ms-parameter-location": "method" + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlert.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlertRule.json similarity index 95% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlert.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlertRule.json index 0a46e4630d1f..cf3775ea4d92 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlert.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/createOrUpdateResourceHealthAlertRule.json @@ -15,7 +15,9 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": [ + "root" + ], "namespace": "VmGuestHealth" } ] @@ -48,7 +50,7 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": "root", "namespace": "VmGuestHealth" } ] diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/deleteResourceHealthAlert.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/deleteResourceHealthAlertRule.json similarity index 100% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/deleteResourceHealthAlert.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/deleteResourceHealthAlertRule.json diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlert.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlertRule.json similarity index 94% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlert.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlertRule.json index 18432a7ab89a..05e87704df81 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlert.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/getResourceHealthAlertRule.json @@ -21,7 +21,9 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": [ + "root" + ], "namespace": "VmGuestHealth" } ] diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlerts.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlertRules.json similarity index 94% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlerts.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlertRules.json index 42bc3c7156c4..e3fb76364246 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlerts.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/listResourceHealthAlertRules.json @@ -22,7 +22,9 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": [ + "root" + ], "namespace": "VmGuestHealth" } ] diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlert.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlertRule.json similarity index 93% rename from specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlert.json rename to specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlertRule.json index c67cb10e162e..6a697de53e05 100644 --- a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlert.json +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2020-08-04-preview/examples/patchResourceHealthAlertRule.json @@ -14,7 +14,9 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": [ + "root" + ], "namespace": "VmGuestHealth" } ] @@ -47,7 +49,9 @@ "criteria": { "allOf": [ { - "healthMonitorName": "root", + "monitorNames": [ + "root" + ], "namespace": "VmGuestHealth" } ] diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md index 4c1754e7b365..2d93e1fcf5e4 100644 --- a/specification/alertsmanagement/resource-manager/readme.md +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -112,6 +112,7 @@ These settings apply only when `--tag=package-2020-08-04` is specified on the co ``` yaml $(tag) == 'package-2020-08-04-preview' input-file: - Microsoft.AlertsManagement/preview/2020-08-04-preview/AlertsManagement.json +- Microsoft.AlertsManagement/preview/2020-08-04-preview/ResourceHealthAlertRules.json ``` ---