Resources/Schema/New-CmAzMonitorLogAlerts.Schema.json

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "New-CmAzMonitorLogAlerts",
    "type": "object",
    "title": "New-CmAzMonitorLogAlerts",
    "description": "Settings Root.",
    "required": [
        "component",
        "groups"
    ],
    "properties": {
        "component": {
            "$id": "#/component",
            "type": ["string", "null"],
            "title": "Component",
            "description": "Value to determine what cmdlet should be dynamically loaded for these settings."
        },
        "service": {
            "$id": "#/service",
            "type": "object",
            "title": "Service",
            "description": "Contains dependency and publish details for service location.",
            "required": [
                "dependencies"
            ],
            "properties": {
                "dependencies": {
                    "$id": "#/service/dependencies",
                    "type": "object",
                    "title": "Dependencies",
                    "description": "Contains dependency details for service location.",
                    "required": [
                        "workspace"
                    ],
                    "properties": {
                        "workspace": {
                            "$id": "#/service/dependencies/workspace",
                            "type": "string",
                            "title": "Workspace",
                            "description": "Dependency value to fetch existing resource type."
                        },
                        "actionGroups": {
                            "$id": "#/service/dependencies/actionGroups",
                            "type": ["array", "null"],
                            "title": "Action Groups",
                            "description": "Global default dependency value to fetch existing resource type."
                        }
                    },
                    "additionalProperties": false
                },
                "publish": {
                    "$id": "#/service/publish",
                    "type": ["object", "null"],
                    "title": "Publish",
                    "description": "Contains publish details for service location.",
                    "properties": {
                        "logAlert": {
                            "$id": "#/service/publish/logAlert",
                            "type": ["string", "null"],
                            "title": "Log Alert",
                            "description": "Global default value to publish on deployed resource type."
                        }
                    },
                    "additionalProperties": false
                }
            },
            "additionalProperties": false
        },
        "groups": {
            "$id": "#/groups",
            "type": "array",
            "title": "Groups",
            "description": "Contains all details pertaining to logical groupings of alert sets.",
            "items": {
                "$id": "#/groups/items",
                "minItems": 1,
                "allOf": [
                    {
                        "$id": "#/groups/items/allOf",
                        "type": "object",
                        "required": [
                            "name",
                            "alertSets"
                        ],
                        "properties": {
                            "name": {
                                "$id": "#/groups/items/allOf/name",
                                "type": "string",
                                "title": "Name",
                                "description": "The name of the grouping."
                            },
                            "alertSets": {
                                "$id": "#/groups/items/allOf/alertSets",
                                "type": "array",
                                "title": "Alert Sets",
                                "description": "Contains all alert set details for a specific grouping.",
                                "items": {
                                    "$id": "#/groups/items/allOf/alertSets/items",
                                    "minItems": 1,
                                    "allOf": [
                                        {
                                            "$id": "#/groups/items/allOf/alertSets/items/allOf",
                                            "type": "object",
                                            "required": [
                                                "type",
                                                "alerts"
                                            ],
                                            "properties": {
                                                "type": {
                                                    "$id": "#/groups/items/allOf/alertSets/items/allOf/type",
                                                    "type": "string",
                                                    "title": "Type",
                                                    "description": "The type of resource the collection of alerts is grouped against."
                                                },
                                                "name": {
                                                    "$id": "#/groups/items/allOf/alertSets/items/allOf/name",
                                                    "type": ["string", "null"],
                                                    "title": "Name",
                                                    "description": "Becomes part of log alert rule generated name."
                                                },
                                                "alerts": {
                                                    "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts",
                                                    "type": "array",
                                                    "title": "Alerts",
                                                    "description": "Contains all details of the log alert rules to be deployed.",
                                                    "items": {
                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items",
                                                        "minItems": 1,
                                                        "allOf": [
                                                            {
                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf",
                                                                "type": "object",
                                                                "properties": {
                                                                    "definition": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/definition",
                                                                        "type": ["string", "null"],
                                                                        "title": "Definition",
                                                                        "description": "Name of a pre-existing definition of a log alert."
                                                                    },
                                                                    "name": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/name",
                                                                        "type": ["string", "null"],
                                                                        "title": "Name",
                                                                        "description": "Becomes part of log alert rule generated name."
                                                                    },
                                                                    "description": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/description",
                                                                        "type": ["string", "null"],
                                                                        "title": "Description",
                                                                        "description": "Description of the log alert."
                                                                    },
                                                                    "suppress": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/suppress",
                                                                        "type": ["object", "null"],
                                                                        "title": "Suppress",
                                                                        "description": "Set the suppression time on a triggered alert.",
                                                                        "required": [
                                                                            "enabled"
                                                                        ],
                                                                        "properties": {
                                                                            "enabled": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/enable",
                                                                                "type": "boolean",
                                                                                "title": "Enabled",
                                                                                "description": "If alert suppression is enabled or not."
                                                                            },
                                                                            "mins": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/mins",
                                                                                "type": ["integer", "null"],
                                                                                "title": "mins",
                                                                                "description": "Time (in minutes) for which Alerts should be throttled or suppressed."
                                                                            },
                                                                            "windows": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/windows",
                                                                                "type": ["integer", "null"],
                                                                                "title": "windows",
                                                                                "description": "Consecutive periods to continue suppressing the alert."
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "threshold": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold",
                                                                        "type": ["object", "null"],
                                                                        "title": "Threshold",
                                                                        "description": "Contains threshold details for the log alert rule query.",
                                                                        "required": [
                                                                            "operator",
                                                                            "value"
                                                                        ],
                                                                        "properties": {
                                                                            "operator": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/operator",
                                                                                "type": "string",
                                                                                "title": "Operator",
                                                                                "description": "The value comparison operator.",
                                                                                "enum": ["greaterThan", "equal", "lessThan"]
                                                                            },
                                                                            "value": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/value",
                                                                                "type": "integer",
                                                                                "title": "Value",
                                                                                "description": "The threshold value that triggers the alert."
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "enabled": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/severity",
                                                                        "type": ["boolean", "null"],
                                                                        "title": "Enabled",
                                                                        "description": "If the alert rule is enabled or not.",
                                                                        "default": true
                                                                    },
                                                                    "severity": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/severity",
                                                                        "type": ["string", "null"],
                                                                        "title": "Severity",
                                                                        "description": "The severity level of the alert to trigger.",
                                                                        "enum": ["Critical", "Error", "Warning", "Informational", "Verbose"]
                                                                    },
                                                                    "schedule": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/schedule",
                                                                        "type": ["object", "null"],
                                                                        "title": "Schedule",
                                                                        "description": "Contains the log alert rule schedule details.",
                                                                        "required": [
                                                                            "frequencyInMinutes",
                                                                            "timeWindowInMinutes"
                                                                        ],
                                                                        "properties": {
                                                                            "frequencyInMinutes": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/schedule/frequencyInMinutes",
                                                                                "type": "integer",
                                                                                "title": "Frequency In Minutes",
                                                                                "description": "The frequency in which the log analytics query is executed.",
                                                                                "enum": [5, 10, 15, 30, 45, 60, 120, 180, 240, 300, 360, 1440]
                                                                            },
                                                                            "timeWindowInMinutes": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/schedule/timeWindowInMinutes",
                                                                                "type": "integer",
                                                                                "title": "Time Window In Minutes",
                                                                                "description": "The time windows of results to return for the log analytics query",
                                                                                "enum": [5, 10, 15, 30, 45, 60, 120, 180, 240, 300, 360, 1440, 2880]
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "service": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service",
                                                                        "type": ["object", "null"],
                                                                        "title": "Service",
                                                                        "description": "Contains dependency and publish details for service location.",
                                                                        "properties": {
                                                                            "dependencies": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies",
                                                                                "type": ["object", "null"],
                                                                                "title": "Dependencies",
                                                                                "description": "Contains dependency details for service location.",
                                                                                "properties": {
                                                                                    "actionGroups": {
                                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/actionGroups",
                                                                                        "type": ["array", "null"],
                                                                                        "title": "Action Groups",
                                                                                        "description": "Local overriding dependency value to fetch existing resource type.",
                                                                                        "items": {
                                                                                            "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/actionGroups/items"
                                                                                        }
                                                                                    }
                                                                                },
                                                                                "additionalProperties": false
                                                                            },
                                                                            "publish": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/publish",
                                                                                "type": ["object", "null"],
                                                                                "title": "Publish",
                                                                                "description": "Contains publish details for service location.",
                                                                                "properties": {
                                                                                    "logAlert": {
                                                                                        "$id": "#/service/publish/logAlert",
                                                                                        "type": ["string", "null"],
                                                                                        "title": "Log Alert",
                                                                                        "description": "Local overriding value to publish on deployed existing resource type."
                                                                                    }
                                                                                },
                                                                                "additionalProperties": false
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "customisedActions": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/customisedActions",
                                                                        "type": ["object", "null"],
                                                                        "title": "Customised Actions",
                                                                        "description": "Container of additonal custom actions for when an alert is triggered.",
                                                                        "properties": {
                                                                            "emailSubject": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/customisedActions/emailSubject",
                                                                                "type": "string",
                                                                                "title": "Email Subject",
                                                                                "description": "Subject of email sent from action group."
                                                                            },
                                                                            "webhookJsonPayload": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/customisedActions/webhookJsonPayload",
                                                                                "type": "string",
                                                                                "title": "Webhook Json Payload",
                                                                                "description": "Specify a custom json payload that gets sent to the webhook instead of the default alert payload."
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "parameters": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/parameters",
                                                                        "type": ["object", "null"],
                                                                        "title": "Parameters",
                                                                        "description": "Any required parameters for the log alert",
                                                                        "additonalProperties": true
                                                                    }
                                                                },
                                                                "additonalProperties": false
                                                            }
 
                                                        ]
                                                    }
                                                }
                                            },
                                            "additonalProperties": false
                                        }
                                    ]
                                }
                            }
                        },
                        "additonalProperties": false
                    }
                ]
            }
        }
    },
    "additonalProperties": false
}