From 86103017dd0ad9a2c02c7e30a3b369e5ba903c68 Mon Sep 17 00:00:00 2001 From: vikram-m Date: Tue, 17 Jul 2018 23:03:49 +0530 Subject: [PATCH] AlertsManagement RP Public preview Swagger Spec --- .../2018-05-05-preview/AlertsManagement.json | 1589 +++++++++++++++++ .../examples/Alerts_ChangeState.json | 38 + .../examples/Alerts_GetbyId.json | 35 + .../examples/Alerts_History.json | 40 + .../examples/Alerts_List.json | 61 + .../examples/Alerts_Summary.json | 89 + .../examples/SmartGroups_ChangeState.json | 74 + .../examples/SmartGroups_GetbyId.json | 70 + .../examples/SmartGroups_History.json | 30 + .../examples/SmartGroups_List.json | 145 ++ .../resource-manager/readme.md | 139 ++ 11 files changed, 2310 insertions(+) create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_ChangeState.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_GetbyId.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_History.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_List.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_Summary.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_ChangeState.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_GetbyId.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_History.json create mode 100644 specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_List.json create mode 100644 specification/alertsmanagement/resource-manager/readme.md diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json new file mode 100644 index 000000000000..b57a92105dc9 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json @@ -0,0 +1,1589 @@ +{ + "swagger": "2.0", + "info": { + "version": "2018-05-05-preview", + "title": "Azure Alerts Management Service Resource Provider", + "description": "REST APIs for Azure Alerts Management Service." + }, + "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": { + "/providers/Microsoft.AlertsManagement/operations": { + "get": { + "operationId": "Operations_List", + "description": "List all operations available through Azure Alerts Management Resource Provider.", + "parameters": [ + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Succesfully retrieved operations list.", + "schema": { + "$ref": "#/definitions/operationsList" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts": { + "get": { + "operationId": "Alerts_GetAll", + "description": "List all the existing alerts, where the results can be selective by passing multiple filter parameters including time range and sorted on specific fields. ", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/targetResource" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/targetResourceType" + }, + { + "$ref": "#/parameters/monitorService" + }, + { + "$ref": "#/parameters/monitorCondition" + }, + { + "$ref": "#/parameters/severity" + }, + { + "$ref": "#/parameters/alertState" + }, + { + "$ref": "#/parameters/smartGroupIdFilter" + }, + { + "$ref": "#/parameters/includePayload" + }, + { + "$ref": "#/parameters/pageCount" + }, + { + "$ref": "#/parameters/alertsSortBy" + }, + { + "$ref": "#/parameters/sortOrder" + }, + { + "$ref": "#/parameters/timeRange" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Succesfully listed alert objects.", + "schema": { + "$ref": "#/definitions/alertsList" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-pageable": { + "nextLinkName": "nextLink" + }, + "x-ms-examples": { + "ListAlerts": { + "$ref": "./examples/Alerts_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}": { + "get": { + "operationId": "Alerts_GetById", + "summary": "Get a specific alert.", + "description": "Get information related to a specific alert", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the alert with the specified ID.", + "schema": { + "$ref": "#/definitions/alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "GetById": { + "$ref": "./examples/Alerts_GetbyId.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/changestate": { + "post": { + "operationId": "Alerts_ChangeState", + "description": "Change the state of the alert.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/newState" + } + ], + "responses": { + "200": { + "description": "OK. Alert state updated.", + "schema": { + "$ref": "#/definitions/alert" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_ChangeState.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alerts/{alertId}/history": { + "get": { + "operationId": "Alerts_GetHistory", + "description": "Get the history of the changes of an alert.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/alertId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the list of changes of alert.", + "schema": { + "$ref": "#/definitions/alertModification" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/Alerts_History.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/alertsSummary": { + "get": { + "operationId": "Alerts_GetSummary", + "description": "Summary of alerts with the count each severity.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/timeRange" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Alert state updated.", + "schema": { + "$ref": "#/definitions/alertsSummary" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Summary": { + "$ref": "./examples/Alerts_Summary.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups": { + "get": { + "operationId": "SmartGroups_GetAll", + "summary": "Get all smartGroups within the subscription", + "description": "List all the smartGroups within the specified subscription. ", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/targetResource" + }, + { + "$ref": "#/parameters/targetResourceGroup" + }, + { + "$ref": "#/parameters/targetResourceType" + }, + { + "$ref": "#/parameters/monitorService" + }, + { + "$ref": "#/parameters/monitorCondition" + }, + { + "$ref": "#/parameters/severity" + }, + { + "$ref": "#/parameters/smartGroupState" + }, + { + "$ref": "#/parameters/timeRange" + }, + { + "$ref": "#/parameters/pageCount" + }, + { + "$ref": "#/parameters/smartGroupsSortBy" + }, + { + "$ref": "#/parameters/sortOrder" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "produces": [ + "application/json" + ], + "responses": { + "200": { + "description": "OK. Returns list of all smartGroups.", + "schema": { + "$ref": "#/definitions/smartGroupsList", + "description": "List of smart groups in value property." + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "List": { + "$ref": "./examples/SmartGroups_List.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}": { + "get": { + "operationId": "SmartGroups_GetById", + "summary": "Get information of smart alerts group.", + "description": "Get details of smart group.", + "produces": [ + "application/json" + ], + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the group with the specified smart group Id.", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/smartGroup" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Get": { + "$ref": "./examples/SmartGroups_GetbyId.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/changeState": { + "post": { + "operationId": "SmartGroups_ChangeState", + "description": "Change the state from unresolved to resolved and all the alerts within the smart group will also be resolved.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + }, + { + "$ref": "#/parameters/newState" + } + ], + "responses": { + "200": { + "description": "OK. Alert state updated.", + "headers": { + "x-ms-request-id": { + "type": "string", + "description": "Service generated Request ID." + } + }, + "schema": { + "$ref": "#/definitions/smartGroup" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "changestate": { + "$ref": "./examples/SmartGroups_ChangeState.json" + } + } + } + }, + "/subscriptions/{subscriptionId}/providers/Microsoft.AlertsManagement/smartGroups/{smartGroupId}/history": { + "get": { + "operationId": "SmartGroups_GetHistory", + "description": "Get the history of the changes of smart group.", + "parameters": [ + { + "$ref": "#/parameters/subscriptionId" + }, + { + "$ref": "#/parameters/smartGroupId" + }, + { + "$ref": "#/parameters/api-version" + } + ], + "responses": { + "200": { + "description": "OK. Returns the list of changes of smart group.", + "schema": { + "$ref": "#/definitions/smartGroupModification" + } + }, + "default": { + "description": "Error response describing why the operation failed.", + "schema": { + "$ref": "#/definitions/errorResponse" + } + } + }, + "x-ms-examples": { + "Resolve": { + "$ref": "./examples/SmartGroups_History.json" + } + } + } + } + }, + "parameters": { + "subscriptionId": { + "name": "subscriptionId", + "description": "subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.", + "type": "string", + "in": "path", + "required": true + }, + "api-version": { + "name": "api-version", + "description": "client API version", + "type": "string", + "in": "query", + "required": true, + "enum": [ + "2017-11-15-privatepreview", + "2018-05-05-preview" + ], + "x-ms-enum": { + "name": "api-version", + "modelAsString": true + } + }, + "alertId": { + "name": "alertId", + "description": "Unique ID of an alert object.", + "type": "string", + "in": "path", + "required": true, + "x-ms-parameter-location": "method" + }, + "targetResourceGroup": { + "description": "filter by target resource group name", + "name": "targetResourceGroup", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "targetResource": { + "description": "filter by target resource", + "name": "targetResource", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "targetResourceType": { + "description": "filter by target resource type", + "name": "targetResourceType", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "monitorService": { + "description": "filter by monitor service which is the source of the alert object.", + "name": "monitorService", + "type": "string", + "in": "query", + "required": false, + "enum": [ + "Platform", + "Application Insights", + "Log Analytics", + "Zabbix", + "SCOM", + "Nagios", + "Infrastructure Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "ServiceHealth", + "SmartDetector" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true + } + }, + "severity": { + "description": "filter by severity", + "name": "severity", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } + }, + "smartGroupIdFilter": { + "description": "filter by smart Group Id", + "name": "smartGroupId", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "smartGroupId": { + "description": "Smart Group Id", + "name": "smartGroupId", + "type": "string", + "in": "path", + "required": true, + "x-ms-parameter-location": "method" + }, + "newState": { + "description": "filter by state", + "name": "newState", + "type": "string", + "in": "query", + "required": true, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } + }, + "alertState": { + "description": "filter by state", + "name": "alertState", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } + }, + "smartGroupState": { + "description": "filter by state", + "name": "smartGroupState", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } + }, + "monitorCondition": { + "description": "filter by monitor condition which is the state of the alert at monitor service", + "name": "monitorCondition", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true + } + }, + "timeRange": { + "description": "filter by time range, default value is 1 day", + "name": "timeRange", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "1h", + "1d", + "7d", + "30d" + ], + "x-ms-enum": { + "name": "TimeRange", + "modelAsString": true + } + }, + "includePayload": { + "description": "include payload field content, default value is 'false'.", + "name": "includePayload", + "type": "boolean", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "pageCount": { + "description": "number of items per page, default value is '25'.", + "name": "pageCount", + "type": "integer", + "in": "query", + "required": false, + "x-ms-parameter-location": "method" + }, + "alertsSortBy": { + "description": "sort the query results by input field, default value is 'lastModifiedDateTime'.", + "name": "sortBy", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "name", + "severity", + "alertState", + "monitorCondition", + "targetResource", + "targetResourceName", + "targetResourceGroup", + "targetResourceType", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "AlertsSortByFields", + "modelAsString": true + } + }, + "smartGroupsSortBy": { + "description": "sort the query results by input field, default value is 'lastModifiedDateTime'.", + "name": "sortBy", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "alertsCount", + "state", + "severity", + "startDateTime", + "lastModifiedDateTime" + ], + "x-ms-enum": { + "name": "SmartGroupsSortByFields", + "modelAsString": true + } + }, + "sortOrder": { + "description": "sort the query results order in either ascending or descending, default value is 'desc' for time fields and 'asc' for others.", + "name": "sortOrder", + "type": "string", + "in": "query", + "required": false, + "x-ms-parameter-location": "method", + "enum": [ + "asc", + "desc" + ] + } + }, + "definitions": { + "operation": { + "description": "Operation provided by provider", + "properties": { + "name": { + "type": "string", + "description": "Name of the operation" + }, + "display": { + "type": "object", + "description": "Properties of the operation", + "properties": { + "provider": { + "type": "string", + "description": "Provider name" + }, + "resource": { + "type": "string", + "description": "Resource name" + }, + "operation": { + "type": "string", + "description": "Operation name" + }, + "description": { + "type": "string", + "description": "Description of the operation" + } + } + } + } + }, + "operationsList": { + "description": "Lists the operations available in the AlertsManagement RP.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, + "value": { + "description": "Array of operations", + "type": "array", + "items": { + "$ref": "#/definitions/operation" + } + } + }, + "required": [ + "value" + ] + }, + "errorResponse": { + "description": "An error response from the service.", + "x-ms-external": true, + "properties": { + "error": { + "$ref": "#/definitions/errorResponseBody" + } + } + }, + "errorResponseBody": { + "description": "Details of error response.", + "x-ms-external": true, + "properties": { + "code": { + "type": "string", + "description": "Error code, intended to be consumed programmatically." + }, + "message": { + "type": "string", + "description": "Description of the error, intended for display in user interface." + }, + "target": { + "type": "string", + "description": "Target of the particular error, for example name of the property." + }, + "details": { + "type": "array", + "description": "A list of additional details about the error.", + "items": { + "$ref": "#/definitions/errorResponseBody" + } + } + } + }, + "Resource": { + "x-ms-azure-resource": true, + "description": "An azure resource object", + "properties": { + "id": { + "type": "string", + "readOnly": true, + "description": "Azure resource Id" + }, + "type": { + "type": "string", + "readOnly": true, + "description": "Azure resource type" + }, + "name": { + "type": "string", + "readOnly": true, + "description": "Azure resource name" + } + } + }, + "alert": { + "description": "An alert created in alert management service.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertProperties", + "x-ms-client-flatten": true + } + } + }, + "alertsList": { + "description": "List the alerts.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, + "value": { + "description": "List of alerts", + "type": "array", + "items": { + "$ref": "#/definitions/alert" + } + } + } + }, + "alertProperties": { + "type": "object", + "description": "An alert created in alert management service.", + "properties": { + "severity": { + "type": "string", + "description": "Severity of alert Sev1 being highest and Sev3 being lowest.", + "readOnly": true, + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } + }, + "signalType": { + "type": "string", + "description": "Log based alert or metric based alert", + "readOnly": true, + "enum": [ + "Metric", + "Log", + "Unknown" + ], + "x-ms-enum": { + "name": "SignalType", + "modelAsString": true + } + }, + "alertState": { + "type": "string", + "description": "Alert object state", + "readOnly": true, + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "AlertState", + "modelAsString": true + } + }, + "monitorCondition": { + "type": "string", + "description": "Condition of the rule at the monitor service", + "readOnly": true, + "enum": [ + "Fired", + "Resolved" + ], + "x-ms-enum": { + "name": "MonitorCondition", + "modelAsString": true + } + }, + "targetResource": { + "type": "string", + "description": "Target ARM resource, on which alert got created." + }, + "targetResourceName": { + "type": "string", + "description": "Target ARM resource name, on which alert got created." + }, + "targetResourceGroup": { + "type": "string", + "description": "Resource group of target ARM resource." + }, + "targetResourceType": { + "type": "string", + "description": "Resource type of target ARM resource" + }, + "monitorService": { + "type": "string", + "description": "Monitor service which is the source of the alert object.", + "readOnly": true, + "enum": [ + "Platform", + "Application Insights", + "Log Analytics", + "Infrastructure Insights", + "ActivityLog Administrative", + "ActivityLog Security", + "ActivityLog Recommendation", + "ActivityLog Policy", + "ActivityLog Autoscale", + "ServiceHealth", + "SmartDetector", + "Zabbix", + "SCOM", + "Nagios" + ], + "x-ms-enum": { + "name": "MonitorService", + "modelAsString": true + } + }, + "sourceCreatedId": { + "type": "string", + "description": "Unique Id created by monitor service", + "readOnly": true + }, + "smartGroupId": { + "type": "string", + "description": "Unique Id of the smart group", + "readOnly": true + }, + "smartGroupingReason": { + "type": "string", + "description": "Reason for addition to a smart group", + "readOnly": true + }, + "startDateTime": { + "type": "string", + "format": "date-time", + "description": "Creation time(ISO-8601 format).", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "Last modification time(ISO-8601 format).", + "readOnly": true + }, + "lastModifiedUserName": { + "type": "string", + "description": "User who last modified the alert.", + "readOnly": true + }, + "payload": { + "type": "object", + "description": "More details which are contextual to the monitor service.", + "readOnly": true + } + } + }, + "alertModification": { + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertModificationProperties" + } + } + }, + "alertModificationProperties": { + "type": "object", + "description": "Properties of the alert modification item.", + "properties": { + "alertId": { + "type": "string", + "description": "Unique Id of the alert for which the history is being retrieved", + "readOnly": true + }, + "modifications": { + "type": "array", + "description": "Modification details", + "items": { + "$ref": "#/definitions/alertModificationItem" + } + } + } + }, + "alertModificationItem": { + "description": "Alert modification item.", + "properties": { + "modificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "AlertCreated", + "StateChange", + "MonitorConditionChange" + ], + "x-ms-enum": { + "name": "AlertModificationEvent" + } + }, + "oldValue": { + "type": "string", + "description": "Old value" + }, + "newValue": { + "type": "string", + "description": "New value" + }, + "modifiedAt": { + "type": "string", + "description": "Modified date and time" + }, + "modifiedBy": { + "type": "string", + "description": "Modified user details (Principal client name)" + }, + "comments": { + "type": "string", + "description": "Modification comments" + }, + "description": { + "type": "string", + "description": "Description of the modification" + } + } + }, + "smartGroupModification": { + "description": "Alert Modification details", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/smartGroupModificationProperties" + } + } + }, + "smartGroupModificationProperties": { + "description": "Properties of the smartGroup modification item.", + "properties": { + "smartGroupId": { + "type": "string", + "description": "Unique Id of the smartGroup for which the history is being retrieved", + "readOnly": true + }, + "modifications": { + "type": "array", + "description": "Modification details", + "items": { + "$ref": "#/definitions/smartGroupModificationItem" + } + }, + "nextLink": { + "description": "URL to fetch the next set of results.", + "type": "string" + } + } + }, + "smartGroupModificationItem": { + "description": "smartGroup modification item.", + "properties": { + "modificationEvent": { + "type": "string", + "description": "Reason for the modification", + "enum": [ + "SmartGroupCreated", + "StateChange", + "AlertAdded", + "AlertRemoved" + ], + "x-ms-enum": { + "name": "SmartGroupModificationEvent" + } + }, + "oldValue": { + "type": "string", + "description": "Old value" + }, + "newValue": { + "type": "string", + "description": "New value" + }, + "modifiedAt": { + "type": "string", + "description": "Modified date and time" + }, + "modifiedBy": { + "type": "string", + "description": "Modified user details (Principal client name)" + }, + "comments": { + "type": "string", + "description": "Modification comments" + }, + "description": { + "type": "string", + "description": "Description of the modification" + } + } + }, + "alertsSummary": { + "description": "Summary of the alerts.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "$ref": "#/definitions/alertsSummaryProperties", + "x-ms-client-flatten": true + } + } + }, + "alertsSummaryProperties": { + "type": "object", + "description": "Summary of the alerts", + "properties": { + "total": { + "type": "integer", + "description": "Total number of alerts." + }, + "smartGroupsCount": { + "type": "integer", + "description": "Total number of smart groups." + }, + "summaryByState": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by state" + }, + "summaryBySeverity": { + "type": "object", + "description": "Summary of alerts by severity", + "properties": { + "sev0": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by severity 'Sev0'" + }, + "sev1": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by severity 'Sev1'" + }, + "sev2": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by severity 'Sev2'" + }, + "sev3": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by severity 'Sev3'" + }, + "sev4": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByState" + } + ], + "type": "object", + "description": "Summary of alerts by severity 'Sev4'" + } + } + }, + "summaryBySeverityAndMonitorCondition": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryBySeverityAndMonitorCondition" + } + ], + "type": "object", + "description": "Summary of alerts by severity and monitor condition" + }, + "summaryByMonitorService": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorService" + } + ], + "type": "object", + "description": "Summary of alerts by severity" + }, + "nextLink": { + "description": "URL to fetch the next set of results.", + "type": "string" + } + } + }, + "alertsSummaryByState": { + "type": "object", + "description": "Summary of alerts by state", + "properties": { + "new": { + "type": "integer", + "description": "Count of alerts with state 'New'" + }, + "acknowledged": { + "type": "integer", + "description": "Count of alerts with state 'Acknowledged'" + }, + "closed": { + "type": "integer", + "description": "Count of alerts with state 'Closed'" + } + } + }, + "alertsSummaryBySeverityAndMonitorCondition": { + "type": "object", + "description": "Summary of the alerts by severity and monitor condition", + "properties": { + "sev0": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorCondition" + } + ], + "description": "Summary of alerts by monitor condition with severity 'Sev0'" + }, + "sev1": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorCondition" + } + ], + "description": "Summary of alerts by monitor condition with severity 'Sev1'" + }, + "sev2": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorCondition" + } + ], + "description": "Summary of alerts by monitor condition with severity 'Sev2'" + }, + "sev3": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorCondition" + } + ], + "description": "Summary of alerts by monitor condition with severity 'Sev3'" + }, + "sev4": { + "allOf": [ + { + "$ref": "#/definitions/alertsSummaryByMonitorCondition" + } + ], + "description": "Summary of alerts by monitor condition with severity 'Sev4'" + } + } + }, + "alertsSummaryByMonitorCondition": { + "type": "object", + "description": "Summary of the alerts by monitor condition", + "properties": { + "fired": { + "type": "integer", + "description": "Count of alerts with monitorCondition 'Fired'" + }, + "resolved": { + "type": "integer", + "description": "Count of alerts with monitorCondition 'Resolved'" + } + } + }, + "alertsSummaryByMonitorService": { + "type": "object", + "description": "Summary of the alerts by monitor service", + "properties": { + "platform": { + "type": "integer", + "description": "Count of alerts of \"Platform\"" + }, + "application Insights": { + "type": "integer", + "description": "Count of alerts of \"Application Insights\"" + }, + "log Analytics": { + "type": "integer", + "description": "Count of alerts of \"Log Analytics\"" + }, + "zabbix": { + "type": "integer", + "description": "Count of alerts of \"Zabbix\"" + }, + "scom": { + "type": "integer", + "description": "Count of alerts of \"SCOM\"" + }, + "nagios": { + "type": "integer", + "description": "Count of alerts of \"Nagios\"" + }, + "infrastructure Insights": { + "type": "integer", + "description": "Count of alerts of \"Infrastructure Insights\"" + }, + "activityLog Administrative": { + "type": "integer", + "description": "Count of alerts of \"ActivityLog Administrative\"" + }, + "activityLog Security": { + "type": "integer", + "description": "Count of alerts of \"ActivityLog Security\"" + }, + "activityLog Recommendation": { + "type": "integer", + "description": "Count of alerts of \"ActivityLog Recommendation\"" + }, + "activityLog Policy": { + "type": "integer", + "description": "Count of alerts of \"ActivityLog Policy\"" + }, + "activityLog Autoscale": { + "type": "integer", + "description": "Count of alerts of \"ActivityLog Autoscale\"" + }, + "serviceHealth": { + "type": "integer", + "description": "Count of alerts of \"ServiceHealth\"" + }, + "smartDetector": { + "type": "integer", + "description": "Count of alerts of \"Smart Detector\"" + } + } + }, + "smartGroupsList": { + "description": "List the alerts.", + "properties": { + "nextLink": { + "description": "URL to fetch the next set of alerts.", + "type": "string" + }, + "value": { + "description": "List of alerts", + "type": "array", + "items": { + "$ref": "#/definitions/smartGroup" + } + } + } + }, + "smartGroup": { + "description": "Set of related alerts grouped together smartly by AMS.", + "allOf": [ + { + "$ref": "#/definitions/Resource" + } + ], + "properties": { + "properties": { + "x-ms-client-flatten": true, + "$ref": "#/definitions/smartGroupProperties" + } + } + }, + "smartGroupProperties": { + "type": "object", + "description": "Properties of smart group.", + "properties": { + "alertsCount": { + "type": "integer", + "description": "Total number of alerts in smart group" + }, + "smartGroupState": { + "type": "string", + "description": "Smart group state", + "readOnly": true, + "enum": [ + "New", + "Acknowledged", + "Closed" + ], + "x-ms-enum": { + "name": "State", + "modelAsString": true + } + }, + "severity": { + "type": "string", + "description": "Severity of smart group is the highest(Sev0 >... > Sev4) severity of all the alerts in the group.", + "readOnly": true, + "enum": [ + "Sev0", + "Sev1", + "Sev2", + "Sev3", + "Sev4" + ], + "x-ms-enum": { + "name": "Severity", + "modelAsString": true + } + }, + "startDateTime": { + "type": "string", + "format": "date-time", + "description": "Creation time of smart group. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "lastModifiedDateTime": { + "type": "string", + "format": "date-time", + "description": "Last updated time of smart group. Date-Time in ISO-8601 format.", + "readOnly": true + }, + "lastModifiedUserName": { + "type": "string", + "description": "Last modified by user name.", + "readOnly": true + }, + "resources": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resources in the smart group" + }, + "resourceTypes": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resource types in the smart group" + }, + "resourceGroups": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of target resource groups in the smart group" + }, + "monitorServices": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of monitorServices in the smart group" + }, + "monitorConditions": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of monitorConditions in the smart group" + }, + "alertStates": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of alertStates in the smart group" + }, + "alertSeverities": { + "items": { + "$ref": "#/definitions/smartGroupAggregatedProperty" + }, + "type": "array", + "description": "Summary of alertSeverities in the smart group" + }, + "nextLink": { + "type": "string", + "description": "The URI to fetch the next page of alerts. Call ListNext() with this URI to fetch the next page alerts." + } + } + }, + "smartGroupAggregatedProperty": { + "type": "object", + "description": "Aggregated property of each type", + "properties": { + "name": { + "type": "string", + "description": "Name of the type." + }, + "count": { + "type": "integer", + "description": "Total number of items of type." + } + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_ChangeState.json new file mode 100644 index 000000000000..b77a6029fb67 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_ChangeState.json @@ -0,0 +1,38 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100", + "newState": "Acknowledged", + "body":{ + "comments" : "Acknowledging alert" + } + }, + "responses": { + "200": { + "body": { + "properties": { + "severity":"Sev3", + "signalType":"Log", + "alertState":"New", + "monitorCondition":"Fired", + "monitorService":"Application Insights", + "targetResourceName":"alertscorrelationworkerrole_int", + "targetResourceGroup":"alertscorrelationrg", + "targetResource":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "targetResourceType":"components", + "sourceCreatedId":"57c049b5-9654-4bb4-a443-3bac3f725d34", + "smartGroupId":"a808445e-bb38-4751-85c2-1b109ccc1059", + "smartGroupingReason":"Alerts that frequently occur together have been grouped.", + "startDateTime":"2018-06-12T22:05:09Z", + "lastModifiedDateTime":"2018-06-12T22:05:09Z", + "lastModifiedUserName":"vikramm@microsoft.com", + "payload":{} + }, + "id":"/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type":"Microsoft.AlertsManagement/alerts", + "name":"cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_GetbyId.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_GetbyId.json new file mode 100644 index 000000000000..aad3d0031733 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_GetbyId.json @@ -0,0 +1,35 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + }, + "responses": { + "200": { + "body": { + + "properties":{ + "severity":"Sev3", + "signalType":"Log", + "alertState":"New", + "monitorCondition":"Fired", + "monitorService":"Application Insights", + "targetResourceName":"alertscorrelationworkerrole_int", + "targetResourceGroup":"alertscorrelationrg", + "targetResource":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "targetResourceType":"components", + "sourceCreatedId":"57c049b5-9654-4bb4-a443-3bac3f725d34", + "smartGroupId":"a808445e-bb38-4751-85c2-1b109ccc1059", + "smartGroupingReason":"Alerts that frequently occur together have been grouped.", + "startDateTime":"2018-06-12T22:05:09Z", + "lastModifiedDateTime":"2018-06-12T22:05:09Z", + "lastModifiedUserName":"System", + "payload":{} + }, + "id":"/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type":"Microsoft.AlertsManagement/alerts", + "name":"cpu alert" + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_History.json new file mode 100644 index 000000000000..2305f2aa9598 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_History.json @@ -0,0 +1,40 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "alertId": "66114d64-d9d9-478b-95c9-b789d6502100" + }, + "responses": { + "200": { + "body": { + "properties":{ + "alertId":"66114d64-d9d9-478b-95c9-b789d6502100", + "modifications":[ + { + "modificationEvent":"StateChange", + "oldValue":"New", + "newValue":"Acknowledged", + "modifiedAt":"2018-06-13T06:14:15.7378737Z", + "modifiedBy":"vikramm@microsoft.com", + "comments":"Acknowledging alert", + "description":"State changed from 'New' to 'Acknowledged'" + }, + { + "modificationEvent":"AlertCreated", + "oldValue":"", + "newValue":"", + "modifiedAt":"2018-06-13T06:09:01Z", + "modifiedBy":"System", + "comments":"", + "description":"New Alert Object is created" + } + ] + }, + "id":"/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100/history/default", + "type":"Microsoft.AlertsManagement/alerts", + "name":"CPU Alert" + } + } + } +} + diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_List.json new file mode 100644 index 000000000000..1e299af0a821 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_List.json @@ -0,0 +1,61 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" + }, + "responses": { + "200": { + "body": { + "nextLink":"https://management.azure.com:443/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts?api-version=2018-05-05-preview&timeRange=1d&ctoken=%2bRID%3aPlwOAPHEGwB9UwEAAAAgCw%3d%3d%23RT%3a2%23TRC%3a500%23RTD%3aqtQyMDE4LTA2LTEyVDE1OjEyOjE1", + "value": [ + { + "properties":{ + "severity":"Sev3", + "signalType":"Log", + "alertState":"New", + "monitorCondition":"Fired", + "monitorService":"Application Insights", + "targetResourceName":"alertscorrelationworkerrole_int", + "targetResourceGroup":"alertscorrelationrg", + "targetResource":"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "targetResourceType":"components", + "sourceCreatedId":"57c049b5-9654-4bb4-a443-3bac3f725d34", + "smartGroupId":"a808445e-bb38-4751-85c2-1b109ccc1059", + "smartGroupingReason":"Alerts that frequently occur together have been grouped.", + "startDateTime":"2018-06-12T22:05:09Z", + "lastModifiedDateTime":"2018-06-12T22:05:09Z", + "lastModifiedUserName":"System", + "payload":{} + }, + "id":"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts/66114d64-d9d9-478b-95c9-b789d6502100", + "type":"Microsoft.AlertsManagement/alerts", + "name":"cpu alert" + }, + { + "properties":{ + "severity":"Sev3", + "signalType":"Log", + "alertState":"New", + "monitorCondition":"Fired", + "monitorService":"Application Insights", + "targetResourceName":"alertscorrelationworkerrole_int", + "targetResourceGroup":"alertscorrelationrg", + "targetResource":"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "targetResourceType":"components", + "sourceCreatedId":"e1c5c974-b796-46a1-bb59-740eeca48c15", + "smartGroupId":"a808445e-bb38-4751-85c2-1b109ccc1059", + "smartGroupingReason":"Alerts that frequently occur together have been grouped.", + "startDateTime":"2018-06-12T21:40:09Z", + "lastModifiedDateTime":"2018-06-12T21:40:09Z", + "lastModifiedUserName":"System", + "payload":{} + }, + "id":"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alerts/239f0e9f-9871-4c8b-a6a2-b893853d1066", + "type":"Microsoft.AlertsManagement/alerts", + "name":"cpu alert" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_Summary.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_Summary.json new file mode 100644 index 000000000000..54c6c6e73a8f --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/Alerts_Summary.json @@ -0,0 +1,89 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "1e3ff1c0-771a-4119-a03b-be82a51e232d" + }, + "responses": { + "200": { + "body": { + "properties":{ + "total":885, + "smartGroupsCount":2, + "summaryByState":{ + "new":884, + "acknowledged":1, + "closed":0 + }, + "summaryBySeverity":{ + "sev0":{ + "new":286, + "acknowledged":0, + "closed":0 + }, + "sev1":{ + "new":309, + "acknowledged":0, + "closed":0 + }, + "sev2":{ + "new":0, + "acknowledged":0, + "closed":0 + }, + "sev3":{ + "new":289, + "acknowledged":1, + "closed":0 + }, + "sev4":{ + "new":0, + "acknowledged":0, + "closed":0 + } + }, + "summaryBySeverityAndMonitorCondition":{ + "sev0":{ + "fired":286, + "resolved":0 + }, + "sev1":{ + "fired":309, + "resolved":0 + }, + "sev2":{ + "fired":0, + "resolved":0 + }, + "sev3":{ + "fired":290, + "resolved":0 + }, + "sev4":{ + "fired":0, + "resolved":0 + } + }, + "summaryByMonitorService":{ + "platform":0, + "application Insights":290, + "log Analytics":595, + "zabbix":0, + "scom":0, + "nagios":0, + "infrastructure Insights":0, + "activityLog Administrative":0, + "activityLog Security":0, + "activityLog Recommendation":0, + "activityLog Policy":0, + "activityLog Autoscale":0, + "serviceHealth":0, + "smartDetector":0 + } + }, + "id":"/subscriptions/1e3ff1c0-771a-4119-a03b-be82a51e232d/providers/Microsoft.AlertsManagement/alertsSummary/current", + "type":"Microsoft.AlertsManagement/alertsSummary", + "name":"current" + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_ChangeState.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_ChangeState.json new file mode 100644 index 000000000000..9d5acd7f3fb0 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_ChangeState.json @@ -0,0 +1,74 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72", + "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059", + "newState": "Acknowledged", + "body":{ + "comments" : "Acknowledging smart group" + } + }, + "responses": { + "200": { + "body": { + "properties":{ + "alertsCount":1942, + "smartGroupState":"Acknowledged", + "severity":"Sev3", + "startDateTime":"2018-06-06T12:35:09Z", + "lastModifiedDateTime":"2018-06-13T06:30:09Z", + "lastModifiedUserName":"System", + "resources":[ + { + "name":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count":1942 + } + ], + "resourceTypes":[ + { + "name":"components", + "count":1942 + } + ], + "resourceGroups":[ + { + "name":"alertscorrelationrg", + "count":1942 + } + ], + "monitorServices":[ + { + "name":"Application Insights", + "count":1942 + } + ], + "monitorConditions":[ + { + "name":"Fired", + "count":1942 + } + ], + "alertStates":[ + { + "name":"New", + "count":1941 + }, + { + "name":"Acknowledged", + "count":1 + } + ], + "alertSeverities":[ + { + "name":"Sev3", + "count":1942 + } + ] + }, + "id":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type":"Microsoft.AlertsManagement/smartGroups", + "name":"cpu alert" + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_GetbyId.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_GetbyId.json new file mode 100644 index 000000000000..3fdbc04189b1 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_GetbyId.json @@ -0,0 +1,70 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "smartGroupId": "603675da-9851-4b26-854a-49fc53d32715" + }, + "responses": { + "200": { + "body": { + "properties":{ + "alertsCount":1942, + "smartGroupState":"New", + "severity":"Sev3", + "startDateTime":"2018-06-06T12:35:09Z", + "lastModifiedDateTime":"2018-06-13T06:30:09Z", + "lastModifiedUserName":"System", + "resources":[ + { + "name":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count":1942 + } + ], + "resourceTypes":[ + { + "name":"components", + "count":1942 + } + ], + "resourceGroups":[ + { + "name":"alertscorrelationrg", + "count":1942 + } + ], + "monitorServices":[ + { + "name":"Application Insights", + "count":1942 + } + ], + "monitorConditions":[ + { + "name":"Fired", + "count":1942 + } + ], + "alertStates":[ + { + "name":"New", + "count":1941 + }, + { + "name":"Acknowledged", + "count":1 + } + ], + "alertSeverities":[ + { + "name":"Sev3", + "count":1942 + } + ] + }, + "id":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type":"Microsoft.AlertsManagement/smartGroups", + "name":"cpu alert" + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_History.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_History.json new file mode 100644 index 000000000000..d4a2671b3808 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_History.json @@ -0,0 +1,30 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "9e261de7-c804-4b9d-9ebf-6f50fe350a9a", + "smartGroupId": "a808445e-bb38-4751-85c2-1b109ccc1059" + }, + "responses": { + "200": { + "body": { + "properties":{ + "smartGroupId":"a808445e-bb38-4751-85c2-1b109ccc1059", + "modifications":[ + { + "modificationEvent":"SmartGroupCreated", + "oldValue":"", + "newValue":"", + "modifiedAt":"2018-06-06T12:35:09Z", + "modifiedBy":"System", + "comments":"", + "description":"New Smart Group is created" + } + ] + }, + "id":"/subscriptions/9e261de7-c804-4b9d-9ebf-6f50fe350a9a/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059/history/default", + "type":"Microsoft.AlertsManagement/alerts", + "name":"cpu alert" + } + } + } +} diff --git a/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_List.json b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_List.json new file mode 100644 index 000000000000..46c24ed19a12 --- /dev/null +++ b/specification/alertsmanagement/resource-manager/Microsoft.AlertsManagement/preview/2018-05-05-preview/examples/SmartGroups_List.json @@ -0,0 +1,145 @@ +{ + "parameters": { + "api-version": "2018-05-05-preview", + "subscriptionId": "dd91de05-d791-4ceb-b6dc-988682dc7d72" + }, + "responses": { + "200": { + "body": { + "nextLink": "", + "value": [ + { + "properties":{ + "alertsCount":1942, + "smartGroupState":"New", + "severity":"Sev3", + "startDateTime":"2018-06-06T12:35:09Z", + "lastModifiedDateTime":"2018-06-13T06:30:09Z", + "lastModifiedUserName":"System", + "resources":[ + { + "name":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/alertscorrelationrg/providers/microsoft.insights/components/alertscorrelationworkerrole_int", + "count":1942 + } + ], + "resourceTypes":[ + { + "name":"components", + "count":1942 + } + ], + "resourceGroups":[ + { + "name":"alertscorrelationrg", + "count":1942 + } + ], + "monitorServices":[ + { + "name":"Application Insights", + "count":1942 + } + ], + "monitorConditions":[ + { + "name":"Fired", + "count":1942 + } + ], + "alertStates":[ + { + "name":"New", + "count":1941 + }, + { + "name":"Acknowledged", + "count":1 + } + ], + "alertSeverities":[ + { + "name":"Sev3", + "count":1942 + } + ] + }, + "id":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/a808445e-bb38-4751-85c2-1b109ccc1059", + "type":"Microsoft.AlertsManagement/smartGroups", + "name":"cpu alert" + }, + { + "properties":{ + "alertsCount":15374, + "smartGroupState":"Acknowledged", + "severity":"Sev0", + "startDateTime":"2018-05-17T10:18:44.2020997Z", + "lastModifiedDateTime":"2018-06-13T06:29:01Z", + "lastModifiedUserName":"System", + "resources":[ + { + "name":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/resourcegroups/mms-eus/providers/microsoft.operationalinsights/workspaces/alertsint", + "count":15374 + } + ], + "resourceTypes":[ + { + "name":"microsoft.operationalinsights/workspaces", + "count":6912 + }, + { + "name":"workspaces", + "count":8462 + } + ], + "resourceGroups":[ + { + "name":"mms-eus", + "count":15374 + } + ], + "monitorServices":[ + { + "name":"Log Analytics", + "count":13911 + } + ], + "monitorConditions":[ + { + "name":"Fired", + "count":15374 + } + ], + "alertStates":[ + { + "name":"New", + "count":15358 + }, + { + "name":"Acknowledged", + "count":12 + }, + { + "name":"Closed", + "count":4 + } + ], + "alertSeverities":[ + { + "name":"Sev0", + "count":6984 + }, + { + "name":"Sev1", + "count":6927 + } + ] + }, + "id":"/subscriptions/dd91de05-d791-4ceb-b6dc-988682dc7d72/providers/Microsoft.AlertsManagement/smartGroups/01114c7c-769f-4fd4-b6fa-ab77693b83cd", + "type":"Microsoft.AlertsManagement/smartGroups", + "name":"CPU Alert" + } + ] + } + } + } +} \ No newline at end of file diff --git a/specification/alertsmanagement/resource-manager/readme.md b/specification/alertsmanagement/resource-manager/readme.md new file mode 100644 index 000000000000..8ac5decf13cf --- /dev/null +++ b/specification/alertsmanagement/resource-manager/readme.md @@ -0,0 +1,139 @@ +# AlertsManagement + +> see https://aka.ms/autorest + +This is the AutoRest configuration file for AlerManagement. + + +--- +## Getting Started +To build the SDK for AlertManagement, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: + +> `autorest` + +To see additional help and options, run: + +> `autorest --help` +--- + +## Configuration + + +### Basic Information +These are the global settings for the AlertManagement API. + +``` yaml +title: AlertsManagementClient +description: AlertsManagement Client +openapi-type: arm +tag: package-2018-05-preview +``` + +### Tag: package-2018-05-preview + +These settings apply only when `--tag=package-2018-05` is specified on the command line. + +``` yaml $(tag) == 'package-2018-05-preview' +input-file: +- Microsoft.AlertsManagement/preview/2018-05-05-preview/AlertsManagement.json +``` + +--- +# Code Generation + +## Swagger to SDK + +This section describes what SDK should be generated by the automatic system. +This is not used by Autorest itself. + +``` yaml $(swagger-to-sdk) +swagger-to-sdk: + - repo: azure-sdk-for-python + - repo: azure-libraries-for-java + - repo: azure-sdk-for-go +``` + +## C# + +These settings apply only when `--csharp` is specified on the command line. +Please also specify `--csharp-sdks-folder=`. + +``` yaml $(csharp) +csharp: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + namespace: Microsoft.Azure.Management.AlertsManagement + output-folder: $(csharp-sdks-folder)/AlertsManagement/Management.AlertsManagement/Generated + clear-output-folder: true +``` + +## Python + +These settings apply only when `--python` is specified on the command line. +Please also specify `--python-sdks-folder=`. +Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. + +``` yaml $(python) +python-mode: create +python: + azure-arm: true + license-header: MICROSOFT_MIT_NO_VERSION + payload-flattening-threshold: 2 + namespace: azure.mgmt.alertsmanagement + package-name: azure-mgmt-alertsmanagement + clear-output-folder: true +``` +``` yaml $(python) && $(python-mode) == 'update' +python: + no-namespace-folders: true + output-folder: $(python-sdks-folder)/azure-mgmt-alertsmanagement/azure/mgmt/alertsmanagement +``` +``` yaml $(python) && $(python-mode) == 'create' +python: + basic-setup-py: true + output-folder: $(python-sdks-folder)/azure-mgmt-alertsmanagement +``` + + +## Go + +These settings apply only when `--go` is specified on the command line. + +``` yaml $(go) +go: + license-header: MICROSOFT_APACHE_NO_VERSION + namespace: alertsmanagement + clear-output-folder: true +``` + +### Go multi-api +``` yaml $(go) && $(multiapi) +batch: + - tag: package-2018-05-preview +``` + +### Tag: package-2018-05-preview and go + +These settings apply only when `--tag=package-2018-05-preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2018-05-preview' && $(go) +output-folder: $(go-sdk-folder)/services/alertsmanagement/mgmt/2018-05-05-preview/alertsmanagement +``` + +## Java + +These settings apply only when `--java` is specified on the command line. +Please also specify `--azure-libraries-for-java-folder=`. + +``` yaml $(java) +java: + azure-arm: true + fluent: true + namespace: com.microsoft.azure.management.alertsmanagement + license-header: MICROSOFT_MIT_NO_CODEGEN + payload-flattening-threshold: 1 + output-folder: $(azure-libraries-for-java-folder)/azure-mgmt-alertsmanagement +``` + +