{
  "description": "AlertScheduler is the Schema for the AlertSchedulers API.\nIt is used to suppress or activate alerts based on a schedule.\nSee also https://coralogix.com/docs/user-guides/alerting/alert-suppression-rules/\n\n**Added in v0.4.0**",
  "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": {
      "description": "AlertSchedulerSpec defines the desired state Coralogix AlertScheduler.",
      "properties": {
        "description": {
          "description": "Alert Scheduler description.",
          "type": "string"
        },
        "enabled": {
          "default": true,
          "description": "Alert Scheduler enabled. If set to `false`, the alert scheduler will be disabled. True by default.",
          "type": "boolean"
        },
        "filter": {
          "description": "Alert Scheduler filter. Exactly one of `metaLabels` or `alerts` can be set.\nIf none of them set, all alerts will be affected.",
          "properties": {
            "alerts": {
              "description": "Alert references. Conflicts with `metaLabels`.",
              "items": {
                "properties": {
                  "resourceRef": {
                    "description": "Alert custom resource name and namespace. If namespace is not set, the AlertScheduler namespace will be used.",
                    "properties": {
                      "name": {
                        "description": "Name of the resource (not id).",
                        "type": "string"
                      },
                      "namespace": {
                        "description": "Kubernetes namespace.",
                        "type": "string"
                      }
                    },
                    "required": [
                      "name"
                    ],
                    "type": "object",
                    "additionalProperties": false
                  }
                },
                "required": [
                  "resourceRef"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "metaLabels": {
              "description": "Alert Scheduler meta labels. Conflicts with `alerts`.",
              "items": {
                "properties": {
                  "key": {
                    "type": "string"
                  },
                  "value": {
                    "type": "string"
                  }
                },
                "required": [
                  "key"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "whatExpression": {
              "description": "DataPrime query expression - https://coralogix.com/docs/dataprime-query-language.",
              "type": "string"
            }
          },
          "required": [
            "whatExpression"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "Exactly one of metaLabels or alerts must be set",
              "rule": "has(self.metaLabels) != has(self.alerts)"
            }
          ],
          "additionalProperties": false
        },
        "metaLabels": {
          "description": "Alert Scheduler meta labels.",
          "items": {
            "properties": {
              "key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "key"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "name": {
          "description": "Alert Scheduler name.",
          "type": "string"
        },
        "schedule": {
          "description": "Alert Scheduler schedule. Exactly one of `oneTime` or `recurring` must be set.",
          "properties": {
            "oneTime": {
              "description": "One-time schedule. Conflicts with `recurring`.",
              "properties": {
                "duration": {
                  "description": "The duration from the start time to wait before the operation is performed.\nConflicts with `endTime`.",
                  "properties": {
                    "forOver": {
                      "description": "The number of time units to wait before the alert is triggered. For example,\nif the frequency is set to `hours` and the value is set to `2`, the alert will be triggered after 2 hours.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "frequency": {
                      "description": "The time unit to wait before the alert is triggered. Can be `minutes`, `hours` or `days`.",
                      "enum": [
                        "minutes",
                        "hours",
                        "days"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "forOver",
                    "frequency"
                  ],
                  "type": "object",
                  "additionalProperties": false
                },
                "endTime": {
                  "description": "The end time of the time frame. In isodate format. For example, `2021-01-01T00:00:00.000`.\nConflicts with `duration`.",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$",
                  "type": "string"
                },
                "startTime": {
                  "description": "The start time of the time frame. In isodate format. For example, `2021-01-01T00:00:00.000`.",
                  "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$",
                  "type": "string"
                },
                "timezone": {
                  "description": "The timezone of the time frame. For example, `UTC-4` or `UTC+10`.",
                  "pattern": "^UTC[+-]\\d{1,2}$",
                  "type": "string"
                }
              },
              "required": [
                "startTime",
                "timezone"
              ],
              "type": "object",
              "x-kubernetes-validations": [
                {
                  "message": "Exactly one of endTime or duration must be set",
                  "rule": "has(self.endTime) != has(self.duration)"
                }
              ],
              "additionalProperties": false
            },
            "operation": {
              "description": "The operation to perform. Can be `mute` or `activate`.",
              "enum": [
                "mute",
                "activate"
              ],
              "type": "string"
            },
            "recurring": {
              "description": "Recurring schedule. Conflicts with `oneTime`.",
              "properties": {
                "always": {
                  "description": "Recurring always.",
                  "type": "object"
                },
                "dynamic": {
                  "description": "Dynamic schedule.",
                  "properties": {
                    "frequency": {
                      "description": "The rule will be activated in a recurring mode (daily, weekly or monthly).",
                      "properties": {
                        "daily": {
                          "type": "object"
                        },
                        "monthly": {
                          "properties": {
                            "days": {
                              "description": "The days of the month to activate the rule.",
                              "items": {
                                "format": "int32",
                                "type": "integer"
                              },
                              "type": "array"
                            }
                          },
                          "required": [
                            "days"
                          ],
                          "type": "object",
                          "additionalProperties": false
                        },
                        "weekly": {
                          "properties": {
                            "days": {
                              "description": "The days of the week to activate the rule.",
                              "items": {
                                "enum": [
                                  "Sunday",
                                  "Monday",
                                  "Tuesday",
                                  "Wednesday",
                                  "Thursday",
                                  "Friday",
                                  "Saturday"
                                ],
                                "type": "string"
                              },
                              "type": "array"
                            }
                          },
                          "required": [
                            "days"
                          ],
                          "type": "object",
                          "additionalProperties": false
                        }
                      },
                      "type": "object",
                      "additionalProperties": false
                    },
                    "repeatEvery": {
                      "description": "The rule will be activated in a recurring mode according to the interval.",
                      "format": "int32",
                      "type": "integer"
                    },
                    "terminationDate": {
                      "description": "The termination date of the rule.",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$",
                      "type": "string"
                    },
                    "timeFrame": {
                      "description": "The time frame of the rule.",
                      "properties": {
                        "duration": {
                          "description": "The duration from the start time to wait before the operation is performed.\nConflicts with `endTime`.",
                          "properties": {
                            "forOver": {
                              "description": "The number of time units to wait before the alert is triggered. For example,\nif the frequency is set to `hours` and the value is set to `2`, the alert will be triggered after 2 hours.",
                              "format": "int32",
                              "type": "integer"
                            },
                            "frequency": {
                              "description": "The time unit to wait before the alert is triggered. Can be `minutes`, `hours` or `days`.",
                              "enum": [
                                "minutes",
                                "hours",
                                "days"
                              ],
                              "type": "string"
                            }
                          },
                          "required": [
                            "forOver",
                            "frequency"
                          ],
                          "type": "object",
                          "additionalProperties": false
                        },
                        "endTime": {
                          "description": "The end time of the time frame. In isodate format. For example, `2021-01-01T00:00:00.000`.\nConflicts with `duration`.",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$",
                          "type": "string"
                        },
                        "startTime": {
                          "description": "The start time of the time frame. In isodate format. For example, `2021-01-01T00:00:00.000`.",
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}$",
                          "type": "string"
                        },
                        "timezone": {
                          "description": "The timezone of the time frame. For example, `UTC-4` or `UTC+10`.",
                          "pattern": "^UTC[+-]\\d{1,2}$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "startTime",
                        "timezone"
                      ],
                      "type": "object",
                      "x-kubernetes-validations": [
                        {
                          "message": "Exactly one of endTime or duration must be set",
                          "rule": "has(self.endTime) != has(self.duration)"
                        }
                      ],
                      "additionalProperties": false
                    }
                  },
                  "required": [
                    "frequency",
                    "repeatEvery",
                    "timeFrame"
                  ],
                  "type": "object",
                  "additionalProperties": false
                }
              },
              "type": "object",
              "x-kubernetes-validations": [
                {
                  "message": "Exactly one of always or dynamic must be set",
                  "rule": "has(self.always) != has(self.dynamic)"
                }
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "operation"
          ],
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "Exactly one of oneTime or recurring must be set",
              "rule": "has(self.oneTime) != has(self.recurring)"
            }
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "filter",
        "name",
        "schedule"
      ],
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "AlertSchedulerStatus defines the observed state of AlertScheduler.",
      "properties": {
        "conditions": {
          "items": {
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another.\nThis should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition.\nThis may be an empty string.",
                "maxLength": 32768,
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon.\nFor instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date\nwith respect to the current state of the instance.",
                "format": "int64",
                "minimum": 0,
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition.\nProducers of specific condition types may define expected values and meanings for this field,\nand whether the values are considered a guaranteed API.\nThe value should be a CamelCase string.\nThis field may not be empty.",
                "maxLength": 1024,
                "minLength": 1,
                "pattern": "^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "enum": [
                  "True",
                  "False",
                  "Unknown"
                ],
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "maxLength": 316,
                "pattern": "^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object",
            "additionalProperties": false
          },
          "type": "array"
        },
        "id": {
          "type": "string"
        },
        "printableStatus": {
          "type": "string"
        }
      },
      "type": "object",
      "additionalProperties": false
    }
  },
  "type": "object"
}
