Resources/Schema/New-CmAzMonitorMetricAlerts.Schema.json

{
    "$schema": "http://json-schema.org/draft-07/schema",
    "$id": "New-CmAzMonitorMetricAlerts",
    "type": "object",
    "title": "New-CmAzMonitorMetricAlerts",
    "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.",
            "properties": {
                "dependencies": {
                    "$id": "#/service/dependencies",
                    "type": "object",
                    "title": "Dependencies",
                    "description": "Contains dependency details for service location.",
                    "required": [
                        "resourceGroup"
                    ],
                    "properties": {
                        "actionGroups": {
                            "$id": "#/service/dependencies/actionGroups",
                            "type": ["array", "null"],
                            "title": "Action Groups",
                            "description": "Global default dependency value to fetch existing resource type."
                        },
                        "resourceGroup": {
                            "$id": "#/service/dependencies/resourceGroup",
                            "type": "string",
                            "title": "ResourceGroup",
                            "description": "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": {
                        "metricAlert": {
                            "$id": "#/service/publish/metricAlert",
                            "type": ["string", "null"],
                            "title": "Metric 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": [
                                                "resourceType",
                                                "alerts"
                                            ],
                                            "properties": {
                                                "resourceType": {
                                                    "$id": "#/groups/items/allOf/alertSets/items/allOf/resourceType",
                                                    "type": "string",
                                                    "title": "Resource Type",
                                                    "description": "The resource Type as defined in the Azure namespace."
                                                },
                                                "alerts": {
                                                    "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts",
                                                    "type": "array",
                                                    "title": "Alerts",
                                                    "description": "Contains all details of the metric alert rules to be deployed.",
                                                    "items": {
                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items",
                                                        "minItems": 1,
                                                        "required": [
                                                            "metricName",
                                                            "targetResourceLocation",
                                                            "threshold",
                                                            "service"
                                                        ],
                                                        "allOf": [
                                                            {
                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf",
                                                                "type": "object",
                                                                "properties": {
                                                                    "metricName": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/metricName",
                                                                        "name": "string",
                                                                        "title": "Metric Name",
                                                                        "description": "The name of the metric alert rule."
                                                                    },
                                                                    "description": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/description",
                                                                        "type": ["string", "null"],
                                                                        "title": "Description",
                                                                        "description": "Description of the metric alert rule."
                                                                    },
                                                                    "targetResourceLocation": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/targetResourceLocation",
                                                                        "type": "string",
                                                                        "title": "TargetResourceLocation",
                                                                        "description": "Location of the resources that the alert rule is set to."
                                                                    },
                                                                    "threshold": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold",
                                                                        "type": "object",
                                                                        "title": "Threshold",
                                                                        "description": "Contains threshold details for the metric alert rule.",
                                                                        "required": [
                                                                            "operator",
                                                                            "value",
                                                                            "timeAggregation"
                                                                        ],
                                                                        "properties": {
                                                                            "operator": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/operator",
                                                                                "type": "string",
                                                                                "title": "Operator",
                                                                                "description": "The value comparison operator.",
                                                                                "enum": ["Equals", "NotEquals", "GreaterThan", "GreaterThanOrEqual", "LessThan", "LessThanOrEqual"]
                                                                            },
                                                                            "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."
                                                                            },
                                                                            "timeAggregation": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/threshold/timeAggregation",
                                                                                "type": "string",
                                                                                "title": "Time Aggregation",
                                                                                "enum": ["Average", "Maximum", "Minimum", "Total", "Count"],
                                                                                "description": "The type of aggregation to apply to the monitored data."
                                                                            }
                                                                        },
                                                                        "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": "Container of metric 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 metric alert rule is run.",
                                                                                "enum": [1, 2, 15, 30, 60]
                                                                            },
                                                                            "aggregationGranulat": {
                                                                                "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/schedule/timeWindowInMinutes",
                                                                                "type": "integer",
                                                                                "title": "Time Window In Minutes",
                                                                                "description": "The interval over which the data is grouped according to the selected aggregation type.",
                                                                                "enum": [1, 5, 15, 30, 60, 360, 720, 1440]
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    },
                                                                    "service": {
                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service",
                                                                        "type": "object",
                                                                        "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",
                                                                                "title": "Dependencies",
                                                                                "description": "Contains dependency details for service location.",
                                                                                "oneOf": [
                                                                                    {
                                                                                        "required" : [
                                                                                            "targetResourceGroups"
                                                                                        ]
                                                                                    },
                                                                                    {
                                                                                        "required" : [
                                                                                            "targetResources"
                                                                                        ]
                                                                                    }
                                                                                ],
                                                                                "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"
                                                                                        }
                                                                                    },
                                                                                    "targetResources": {
                                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/targetResources",
                                                                                        "type": ["array", "null"],
                                                                                        "title": "TargetResources",
                                                                                        "description": "Service tag value to fetch existing resources of which to apply the metric alert rule.",
                                                                                        "items": {
                                                                                            "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/targetResources/items"
                                                                                        }
                                                                                    },
                                                                                    "targetResourceGroups": {
                                                                                        "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/targetResourceGroups",
                                                                                        "type": ["array", "null"],
                                                                                        "title": "TargetResourceGroups",
                                                                                        "description": "Service tag value to fetch existing resource groups of which to apply the metric alert rule.",
                                                                                        "items": {
                                                                                            "$id": "#/groups/items/allOf/alertSets/items/allOf/alerts/items/allOf/service/dependencies/targetResourceGroups/items"
                                                                                        }
                                                                                    }
                                                                                     
                                                                                },
                                                                                "additonalProperties": false
                                                                            }
                                                                        },
                                                                        "additonalProperties": false
                                                                    }
                                                                },
                                                                "additonalProperties": false
                                                            }
                                                        ]
                                                    }
                                                }
                                            },
                                            "additonalProperties": false
                                        }
                                    ]
                                }
                            }
                        },
                        "additonalProperties": false
                    }
                ]
            }
        }
    },
    "additonalProperties": false
}