From 3f568b4898533a2699c90a7f451448dfebae140a Mon Sep 17 00:00:00 2001 From: sumitabarahmand <43867857+sumitabarahmand@users.noreply.github.com> Date: Fri, 9 Nov 2018 15:35:20 -0800 Subject: [PATCH] Add spec for alert repair/remediate (#4084) * Add spec for alert repair/remediate * Update remediate route to repair * Add alert remediation properties to the alert model * fix oav validation errors * update remediationActionType items * remove remediationActionType as that is not exposed on an alert * change hasRemediationAction type to boolean --- .../preview/2016-05-01/Alert.json | 70 ++++++++++++++----- .../2016-05-01/examples/Alert/Repair.json | 13 ++++ 2 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/examples/Alert/Repair.json diff --git a/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/Alert.json b/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/Alert.json index 4833a35d70a7..87a98d6aabcf 100644 --- a/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/Alert.json +++ b/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/Alert.json @@ -9,6 +9,12 @@ "schemes": [ "https" ], + "consumes": [ + "application/json" + ], + "produces": [ + "application/json" + ], "paths": { "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/{location}/alerts": { "get": { @@ -50,13 +56,7 @@ "x-ms-pageable": { "nextLinkName": "nextLink" }, - "x-ms-odata": "#/definitions/Alert", - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + "x-ms-odata": "#/definitions/Alert" } }, "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/{location}/alerts/{alertName}": { @@ -95,13 +95,7 @@ "$ref": "#/definitions/Alert" } } - }, - "produces": [ - "application/json" - ], - "consumes": [ - "application/json" - ] + } }, "put": { "x-ms-examples": { @@ -144,13 +138,47 @@ "$ref": "#/definitions/Alert" } } + } + } + }, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.InfrastructureInsights.Admin/regionHealths/{location}/alerts/{alertName}/repair": { + "post": { + "x-ms-examples": { + "Repairs an alert.": { + "$ref": "./examples/Alert/Repair.json" + } }, - "produces": [ - "application/json" + "tags": [ + "Alerts" + ], + "x-ms-long-running-operation": true, + "description": "Repairs an alert.", + "operationId": "Alerts_Repair", + "parameters": [ + { + "$ref": "InfrastructureInsights.json#/parameters/SubscriptionIdParameter" + }, + { + "$ref": "InfrastructureInsights.json#/parameters/ResourceGroupParameter" + }, + { + "$ref": "InfrastructureInsights.json#/parameters/LocationParameter" + }, + { + "$ref": "#/parameters/AlertNameParameter" + }, + { + "$ref": "InfrastructureInsights.json#/parameters/ApiVersionParameter" + } ], - "consumes": [ - "application/json" - ] + "responses": { + "200": { + "description": "OK" + }, + "202": { + "description": "ACCEPTED" + } + } } } }, @@ -250,6 +278,10 @@ "closedByUserAlias": { "description": "User alias who closed the alert.", "type": "string" + }, + "hasValidRemediationAction": { + "description": "Indicates if the alert can be remediated.", + "type": "boolean" } } }, diff --git a/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/examples/Alert/Repair.json b/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/examples/Alert/Repair.json new file mode 100644 index 000000000000..2054303645dd --- /dev/null +++ b/specification/azsadmin/resource-manager/infrastructureinsights/Microsoft.InfrastructureInsights.Admin/preview/2016-05-01/examples/Alert/Repair.json @@ -0,0 +1,13 @@ +{ + "parameters": { + "subscriptionId": "20ff7fc3-e762-44dd-bd96-b71116dcdc23", + "resourceGroupName": "System.local", + "location": "local", + "alertName": "ca55be03-9be9-4deb-8467-e890ab1d116b", + "api-version": "2016-05-01" + }, + "responses": { + "200": {}, + "202": {} + } +}