Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"parameters": {
"subscriptionId": "af52d502-a447-4bc6-8cb7-4780fbb00490",
"resourceGroupName": "alertsweu",
"ruleName": "logtometricfoo",
"api-version": "2018-04-16",
"parameters": {
"location": "West Europe",
"tags": {
"hidden-link:/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu": "Resource"
},
"properties": {
"description": "log to metric description",
"enabled": "true",
"source": {
"dataSourceId": "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu"
},
"action": {
"criteria": [
{
"metricName": "Average_% Idle Time",
"dimensions": []
}
],
"odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"
}
}
}
},
"responses": {
"200": {
"headers": {},
"body": {
"id": "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/microsoft.insights/scheduledqueryrules/logtometricfoo",
"name": "logtometricfoo",
"type": "microsoft.insights/scheduledqueryrules",
"location": "westeurope",
"tags": {
"hidden-link:/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu": "Resource"
},
"properties": {
"description": "log to metric description",
"displayName": "logtometricfoo",
"enabled": "true",
"lastUpdatedTime": "2018-09-04T06:31:56.3737792Z",
"provisioningState": "Succeeded",
"source": {
"query": null,
"dataSourceId": "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu"
},
"schedule": null,
"action": {
"criteria": [
{
"metricName": "Average_% Idle Time",
"dimensions": []
}
],
"odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"
}
}
}
},
"201": {
"headers": {},
"body": {
"id": "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/microsoft.insights/scheduledqueryrules/logtometricfoo",
"name": "logtometricfoo",
"type": "microsoft.insights/scheduledqueryrules",
"location": "westeurope",
"tags": {
"hidden-link:/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu": "Resource"
},
"properties": {
"description": "log to metric description",
"enabled": "true",
"lastUpdatedTime": "2018-09-04T06:27:58.3892575Z",
"provisioningState": "Succeeded",
"source": {
"query": null,
"dataSourceId": "/subscriptions/af52d502-a447-4bc6-8cb7-4780fbb00490/resourceGroups/alertsweu/providers/Microsoft.OperationalInsights/workspaces/alertsweu"
},
"schedule": null,
"action": {
"criteria": [
{
"metricName": "Average_% Idle Time",
"dimensions": []
}
],
"odata.type": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction"
}
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@
}
},
"x-ms-examples": {
"Create or Update rule": { "$ref": "./examples/createOrUpdateScheduledQueryRules.json" }
"Create or Update rule - AletringAction": { "$ref": "./examples/createOrUpdateScheduledQueryRules.json" },
"Create or Update rule - LogToMetricAction": { "$ref": "./examples/createOrUpdateScheduledQueryRule-LogToMetricAction.json" }
}
},
"get": {
Expand Down Expand Up @@ -380,7 +381,7 @@
"properties": {
"query": {
"type": "string",
"description": "Log search query."
"description": "Log search query. Required for action type - AlertingAction"
},
"authorizedResources": {
"type": "array",
Expand All @@ -399,7 +400,6 @@
}
},
"required": [
"query",
"dataSourceId"
]
},
Expand Down Expand Up @@ -587,15 +587,14 @@
},
"schedule": {
"$ref": "#/definitions/Schedule",
"description": "Schedule (Frequnecy, Time Window) for rule."
"description": "Schedule (Frequnecy, Time Window) for rule. Required for action type - AlertingAction"
},
"action": {
"$ref": "#/definitions/Action",
"description": "Action needs to be taken on rule execution."
}
},
"required": [
"schedule",
"source",
"action"
]
Expand Down Expand Up @@ -623,7 +622,7 @@
"properties": {
"odata.type": {
"type": "string",
"description": "Specifies the action. Only supported value - AlertingAction "
"description": "Specifies the action. Supported values - AlertingAction, LogToMetricAction"
}
},
"required": [
Expand Down Expand Up @@ -665,6 +664,78 @@
"severity"
]
},
"Dimension": {
"type": "object",
"description": "Specifies the criteria for converting log to metric.",
"properties": {
"name": {
"type": "string",
"description": "Name of the dimension"
},
"operator": {
"type": "string",
"description": "Operator for dimension values",
"enum": [
"Include"
],
"x-ms-enum": {
"name": "operator",
"modelAsString": true
}
},
"values": {
"type": "array",
"items": {
"type": "string"
},
"description": "List of dimension values"
}
},
"required": [
"name",
"operator",
"values"
]
},
"Criteria": {
"type": "object",
"description": "Specifies the criteria for converting log to metric.",
"properties": {
"metricName": {
"type": "string",
"description": "Name of the metric"
},
"dimensions": {
"type": "array",
"items": {
"$ref": "#/definitions/Dimension"
},
"description": "List of Dimensions for creating metric"
}
},
"required": [
"metricName"
]
},
"LogToMetricAction": {
"description": "Specifiy action need to be taken when rule type is converting log to metric",
"x-ms-discriminator-value": "Microsoft.WindowsAzure.Management.Monitoring.Alerts.Models.Microsoft.AppInsights.Nexus.DataContracts.Resources.ScheduledQueryRules.LogToMetricAction",
"type": "object",
"allOf": [
{
"$ref": "#/definitions/Action"
}
],
"properties": {
"criteria": {
"$ref": "#/definitions/Criteria",
"description": "Severity of the alert"
}
},
"required": [
"criteria"
]
},
"ErrorResponse": {
"description": "Describes the format of Error response.",
"type": "object",
Expand Down