{
  "description": "Generator information:\n- Generated from: /alertsmanagement/resource-manager/Microsoft.AlertsManagement/stable/2021-04-01/SmartDetectorAlertRulesApi.json\n- ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/microsoft.alertsManagement/smartDetectorAlertRules/{alertRuleName}",
  "properties": {
    "apiVersion": {
      "description": "APIVersion defines the versioned schema of this representation of an object.\nServers should convert recognized schemas to the latest internal value, and\nmay reject unrecognized values.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources",
      "type": "string"
    },
    "kind": {
      "description": "Kind is a string value representing the REST resource this object represents.\nServers may infer this from the endpoint the client submits requests to.\nCannot be updated.\nIn CamelCase.\nMore info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds",
      "type": "string"
    },
    "metadata": {
      "type": "object"
    },
    "spec": {
      "properties": {
        "actionGroups": {
          "description": "ActionGroups: The alert rule actions.",
          "properties": {
            "customEmailSubject": {
              "description": "CustomEmailSubject: An optional custom email subject to use in email notifications.",
              "type": "string"
            },
            "customWebhookPayload": {
              "description": "CustomWebhookPayload: An optional custom web-hook payload to use in web-hook notifications.",
              "type": "string"
            },
            "groupReferences": {
              "description": "GroupReferences: The Action Group resource IDs.",
              "items": {
                "description": "ResourceReference represents a resource reference, either to a Kubernetes resource or directly to an Azure resource via ARMID",
                "properties": {
                  "armId": {
                    "description": "ARMID is a string of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.\nThe /resourcegroups/{resourceGroupName} bit is optional as some resources are scoped at the subscription level\nARMID is mutually exclusive with Group, Kind, Namespace and Name.",
                    "pattern": "(?i)(^(/subscriptions/([^/]+)(/resourcegroups/([^/]+))?)?/providers/([^/]+)/([^/]+/[^/]+)(/([^/]+/[^/]+))*$|^/subscriptions/([^/]+)(/resourcegroups/([^/]+))?$)",
                    "type": "string"
                  },
                  "group": {
                    "description": "Group is the Kubernetes group of the resource.",
                    "type": "string"
                  },
                  "kind": {
                    "description": "Kind is the Kubernetes kind of the resource.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name is the Kubernetes name of the resource.",
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "required": [
            "groupReferences"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "azureName": {
          "description": "AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it\ndoesn't have to be.",
          "type": "string"
        },
        "description": {
          "description": "Description: The alert rule description.",
          "type": "string"
        },
        "detector": {
          "description": "Detector: The alert rule's detector.",
          "properties": {
            "id": {
              "description": "Id: The detector id.",
              "type": "string"
            },
            "parameters": {
              "additionalProperties": {
                "x-kubernetes-preserve-unknown-fields": true
              },
              "description": "Parameters: The detector's parameters.'",
              "type": "object"
            }
          },
          "required": [
            "id"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "frequency": {
          "description": "Frequency: The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1\nminute, depending on the detector.",
          "type": "string"
        },
        "location": {
          "description": "Location: The resource location.",
          "type": "string"
        },
        "operatorSpec": {
          "description": "OperatorSpec: The specification for configuring operator behavior. This field is interpreted by the operator and not\npassed directly to Azure",
          "properties": {
            "configMapExpressions": {
              "description": "ConfigMapExpressions: configures where to place operator written dynamic ConfigMaps (created with CEL expressions).",
              "items": {
                "description": "DestinationExpression is a CEL expression and a destination to store the result in. The destination may\nbe a secret or a configmap. The value of the expression is stored at the specified location in\nthe destination.",
                "properties": {
                  "key": {
                    "description": "Key is the key in the ConfigMap or Secret being written to. If the CEL expression in Value returns a string\nthis is required to identify what key to write to. If the CEL expression in Value returns a map[string]string\nKey must not be set, instead the keys written will be determined dynamically based on the keys of the resulting\nmap[string]string.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name is the name of the Kubernetes configmap or secret to write to.\nThe configmap or secret will be created in the same namespace as the resource.",
                    "type": "string"
                  },
                  "value": {
                    "description": "Value is a CEL expression. The CEL expression may return a string or a map[string]string. For more information\non CEL in ASO see https://azure.github.io/azure-service-operator/guide/expressions/",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "value"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "secretExpressions": {
              "description": "SecretExpressions: configures where to place operator written dynamic secrets (created with CEL expressions).",
              "items": {
                "description": "DestinationExpression is a CEL expression and a destination to store the result in. The destination may\nbe a secret or a configmap. The value of the expression is stored at the specified location in\nthe destination.",
                "properties": {
                  "key": {
                    "description": "Key is the key in the ConfigMap or Secret being written to. If the CEL expression in Value returns a string\nthis is required to identify what key to write to. If the CEL expression in Value returns a map[string]string\nKey must not be set, instead the keys written will be determined dynamically based on the keys of the resulting\nmap[string]string.",
                    "type": "string"
                  },
                  "name": {
                    "description": "Name is the name of the Kubernetes configmap or secret to write to.\nThe configmap or secret will be created in the same namespace as the resource.",
                    "type": "string"
                  },
                  "value": {
                    "description": "Value is a CEL expression. The CEL expression may return a string or a map[string]string. For more information\non CEL in ASO see https://azure.github.io/azure-service-operator/guide/expressions/",
                    "type": "string"
                  }
                },
                "required": [
                  "name",
                  "value"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "owner": {
          "description": "Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also\ncontrols the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a\nreference to a resources.azure.com/ResourceGroup resource",
          "properties": {
            "armId": {
              "pattern": "(?i)(^(/subscriptions/([^/]+)(/resourcegroups/([^/]+))?)?/providers/([^/]+)/([^/]+/[^/]+)(/([^/]+/[^/]+))*$|^/subscriptions/([^/]+)(/resourcegroups/([^/]+))?$)",
              "type": "string"
            },
            "name": {
              "description": "This is the name of the Kubernetes resource to reference.",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "scopeReferences": {
          "description": "ScopeReferences: The alert rule resources scope.",
          "items": {
            "description": "ResourceReference represents a resource reference, either to a Kubernetes resource or directly to an Azure resource via ARMID",
            "properties": {
              "armId": {
                "description": "ARMID is a string of the form /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}.\nThe /resourcegroups/{resourceGroupName} bit is optional as some resources are scoped at the subscription level\nARMID is mutually exclusive with Group, Kind, Namespace and Name.",
                "pattern": "(?i)(^(/subscriptions/([^/]+)(/resourcegroups/([^/]+))?)?/providers/([^/]+)/([^/]+/[^/]+)(/([^/]+/[^/]+))*$|^/subscriptions/([^/]+)(/resourcegroups/([^/]+))?$)",
                "type": "string"
              },
              "group": {
                "description": "Group is the Kubernetes group of the resource.",
                "type": "string"
              },
              "kind": {
                "description": "Kind is the Kubernetes kind of the resource.",
                "type": "string"
              },
              "name": {
                "description": "Name is the Kubernetes name of the resource.",
                "type": "string"
              }
            },
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "severity": {
          "description": "Severity: The alert rule severity.",
          "enum": [
            "Sev0",
            "Sev1",
            "Sev2",
            "Sev3",
            "Sev4"
          ],
          "type": "string"
        },
        "state": {
          "description": "State: The alert rule state.",
          "enum": [
            "Disabled",
            "Enabled"
          ],
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags: The resource tags.",
          "type": "object"
        },
        "throttling": {
          "description": "Throttling: The alert rule throttling information.",
          "properties": {
            "duration": {
              "description": "Duration: The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time\ngranularity must be in minutes and minimum value is 0 minutes",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "required": [
        "actionGroups",
        "detector",
        "frequency",
        "owner",
        "scopeReferences",
        "severity",
        "state"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "properties": {
        "actionGroups": {
          "description": "ActionGroups: The alert rule actions.",
          "properties": {
            "customEmailSubject": {
              "description": "CustomEmailSubject: An optional custom email subject to use in email notifications.",
              "type": "string"
            },
            "customWebhookPayload": {
              "description": "CustomWebhookPayload: An optional custom web-hook payload to use in web-hook notifications.",
              "type": "string"
            },
            "groupIds": {
              "description": "GroupIds: The Action Group resource IDs.",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "conditions": {
          "description": "Conditions: The observed state of the resource",
          "items": {
            "description": "Condition defines an extension to status (an observation) of a resource",
            "properties": {
              "lastTransitionTime": {
                "description": "LastTransitionTime is the last time the condition transitioned from one status to another.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "Message is a human readable message indicating details about the transition. This field may be empty.",
                "type": "string"
              },
              "observedGeneration": {
                "description": "ObservedGeneration is the .metadata.generation that the condition was set based upon. For instance, if\n.metadata.generation is currently 12, but the .status.condition[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "type": "integer"
              },
              "reason": {
                "description": "Reason for the condition's last transition.\nReasons are upper CamelCase (PascalCase) with no spaces. A reason is always provided, this field will not be empty.",
                "type": "string"
              },
              "severity": {
                "description": "Severity with which to treat failures of this type of condition.\nFor conditions which have positive polarity (Status == True is their normal/healthy state), this will be omitted when Status == True\nFor conditions which have negative polarity (Status == False is their normal/healthy state), this will be omitted when Status == False.\nThis is omitted in all cases when Status == Unknown",
                "type": "string"
              },
              "status": {
                "description": "Status of the condition, one of True, False, or Unknown.",
                "type": "string"
              },
              "type": {
                "description": "Type of condition.",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "description": {
          "description": "Description: The alert rule description.",
          "type": "string"
        },
        "detector": {
          "description": "Detector: The alert rule's detector.",
          "properties": {
            "description": {
              "description": "Description: The Smart Detector description.",
              "type": "string"
            },
            "id": {
              "description": "Id: The detector id.",
              "type": "string"
            },
            "imagePaths": {
              "description": "ImagePaths: The Smart Detector image path. By default this is not populated, unless it's specified in expandDetector",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "name": {
              "description": "Name: The Smart Detector name.",
              "type": "string"
            },
            "parameterDefinitions": {
              "description": "ParameterDefinitions: The Smart Detector parameters definitions.'",
              "items": {
                "description": "The detector parameter definition.",
                "properties": {
                  "description": {
                    "description": "Description: The detector parameter description.",
                    "type": "string"
                  },
                  "displayName": {
                    "description": "DisplayName: The detector parameter display name.",
                    "type": "string"
                  },
                  "isMandatory": {
                    "description": "IsMandatory: A value indicating whether this detector parameter is mandatory.",
                    "type": "boolean"
                  },
                  "name": {
                    "description": "Name: The detector parameter name.",
                    "type": "string"
                  },
                  "type": {
                    "description": "Type: The detector parameter type.",
                    "type": "string"
                  }
                },
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "parameters": {
              "additionalProperties": {
                "x-kubernetes-preserve-unknown-fields": true
              },
              "description": "Parameters: The detector's parameters.'",
              "type": "object"
            },
            "supportedCadences": {
              "description": "SupportedCadences: The Smart Detector supported cadences.",
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            "supportedResourceTypes": {
              "description": "SupportedResourceTypes: The Smart Detector supported resource types.",
              "items": {
                "type": "string"
              },
              "type": "array"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "frequency": {
          "description": "Frequency: The alert rule frequency in ISO8601 format. The time granularity must be in minutes and minimum value is 1\nminute, depending on the detector.",
          "type": "string"
        },
        "id": {
          "description": "Id: The resource ID.",
          "type": "string"
        },
        "location": {
          "description": "Location: The resource location.",
          "type": "string"
        },
        "name": {
          "description": "Name: The resource name.",
          "type": "string"
        },
        "scope": {
          "description": "Scope: The alert rule resources scope.",
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "severity": {
          "description": "Severity: The alert rule severity.",
          "type": "string"
        },
        "state": {
          "description": "State: The alert rule state.",
          "type": "string"
        },
        "tags": {
          "additionalProperties": {
            "type": "string"
          },
          "description": "Tags: The resource tags.",
          "type": "object"
        },
        "throttling": {
          "description": "Throttling: The alert rule throttling information.",
          "properties": {
            "duration": {
              "description": "Duration: The required duration (in ISO8601 format) to wait before notifying on the alert rule again. The time\ngranularity must be in minutes and minimum value is 0 minutes",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "type": {
          "description": "Type: The resource type.",
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
