{
  "description": "EndpointMonitor is the Schema for the endpointmonitors API",
  "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": "EndpointMonitorSpec defines the desired state of EndpointMonitor",
      "properties": {
        "appInsightsConfig": {
          "description": "Configuration for AppInsights Monitor Provider",
          "properties": {
            "frequency": {
              "description": "Sets how often the test should run from each test location. Possible values: `300,600,900` seconds",
              "type": "integer"
            },
            "retryEnable": {
              "description": "If its `true`, falied test will be retry after a short interval. Possible values: `true, false`",
              "type": "boolean"
            },
            "statusCode": {
              "description": "Returned status code that is counted as a success",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "forceHttps": {
          "description": "Force monitor endpoint to use HTTPS",
          "type": "boolean"
        },
        "gcloudConfig": {
          "description": "Configuration for Google Cloud Monitor Provider",
          "properties": {
            "projectId": {
              "description": "Google Cloud Project ID",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "grafanaConfig": {
          "description": "Configuration for Grafana Cloud Monitor Provider",
          "properties": {
            "alertSensitivity": {
              "default": "none",
              "description": "The alertSensitivity value defaults to none if there are no alerts or can be set to low, medium,\nor high to correspond to the check alert levels.",
              "enum": [
                "none",
                "low",
                "medium",
                "high"
              ],
              "type": "string"
            },
            "frequency": {
              "description": "The frequency value specifies how often the check runs in milliseconds",
              "format": "int64",
              "type": "integer"
            },
            "probes": {
              "description": "Probes are the monitoring agents responsible for simulating user interactions with your web applications\nor services. These agents periodically send requests to predefined URLs and record the responses,\nchecking for expected outcomes and measuring performance.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "tenantId": {
              "format": "int64",
              "type": "integer"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "healthEndpoint": {
          "type": "string"
        },
        "pingdomConfig": {
          "description": "Configuration for Pingdom Monitor Provider",
          "properties": {
            "alertContacts": {
              "description": "`-` separated contact id's (e.g. \"1234567_8_9-9876543_2_1\")",
              "type": "string"
            },
            "alertIntegrations": {
              "description": "`-` separated set list of integrations ids (e.g. \"91166-12168\")",
              "type": "string"
            },
            "basicAuthUser": {
              "description": "Required for basic-authentication",
              "type": "string"
            },
            "notifyWhenBackUp": {
              "description": "Set to \"false\" to disable recovery notifications",
              "type": "boolean"
            },
            "paused": {
              "description": "Set to \"true\" to pause checks",
              "type": "boolean"
            },
            "postDataEnvVar": {
              "description": "Data that should be posted to the web page, for example submission data for a sign-up or login form.\nThe data needs to be formatted in the same way as a web browser would send it to the web server.\nBecause post data contains sensitive secret this field is only a reference to an environment variable.",
              "type": "string"
            },
            "requestHeaders": {
              "description": "Custom request headers",
              "type": "string"
            },
            "requestHeadersEnvVar": {
              "description": "Custom request headers that should be read from an environment variable as it possibly contains sensitive data.\nAn example would be an API token.",
              "type": "string"
            },
            "resolution": {
              "description": "The pingdom check interval in minutes",
              "type": "integer"
            },
            "sendNotificationWhenDown": {
              "description": "How many failed check attempts before notifying",
              "type": "integer"
            },
            "shouldContain": {
              "description": "Set to text string that has to be present in the HTML code of the page",
              "type": "string"
            },
            "sslDownDaysBefore": {
              "description": "Consider down prior to certificate expiring\nSelect the number of days prior to your certificate expiry date that you want to consider the check down.\nAt this day your check will be considered down and if applicable a down alert will be sent.",
              "type": "integer"
            },
            "tags": {
              "description": "Comma separated set of tags to apply to check (e.g. \"testing,aws\")",
              "type": "string"
            },
            "teamAlertContacts": {
              "description": "`-` separated team id's (e.g. \"1234567_8_9-9876543_2_1\")",
              "type": "string"
            },
            "verifyCertificate": {
              "description": "Monitor SSL/TLS certificate\nMonitor the validity of your SSL/TLS certificate. With this enabled Uptime checks will be considered DOWN when\nthe certificate becomes invalid or expires.\nSSL/TLS certificate monitoring is available for HTTP checks.",
              "type": "boolean"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "pingdomTransactionConfig": {
          "description": "Configuration for Pingdom Transaction Monitor Provider",
          "properties": {
            "alertContacts": {
              "description": "`-` separated contact id's (e.g. \"1234567_8_9-9876543_2_1\")",
              "type": "string"
            },
            "alertIntegrations": {
              "description": "`-` separated set list of integrations ids (e.g. \"91166-12168\")",
              "type": "string"
            },
            "custom_message": {
              "description": "Custom message that is part of the email and webhook alerts",
              "type": "string"
            },
            "interval": {
              "description": "TMS test intervals in minutes. Allowed intervals: 5,10,20,60,720,1440. The interval you're allowed to set may vary depending on your current plan.",
              "enum": [
                5,
                10,
                20,
                60,
                720,
                1440
              ],
              "type": "integer"
            },
            "paused": {
              "description": "Check status: active or inactive",
              "type": "boolean"
            },
            "region": {
              "description": "Name of the region where the check is executed. Supported regions: us-east, us-west, eu, au",
              "enum": [
                "us-east",
                "us-west",
                "eu",
                "au"
              ],
              "type": "string"
            },
            "send_notification_when_down": {
              "description": "Send notification when down X times",
              "format": "int64",
              "type": "integer"
            },
            "severity_level": {
              "description": "Check importance- how important are the alerts when the check fails. Allowed values: low, high",
              "enum": [
                "low",
                "high"
              ],
              "type": "string"
            },
            "steps": {
              "description": "steps to be executed as part of the check",
              "items": {
                "description": "PingdomStep respresents a step of the script to run a transcaction check",
                "properties": {
                  "args": {
                    "additionalProperties": {
                      "type": "string"
                    },
                    "description": "contains the html element with assigned value\nthe key element is always lowercase for example {\"url\": \"https://www.pingdom.com\"}\nsee available values at https://pkg.go.dev/github.com/karlderkaefer/pingdom-golang-client@latest/pkg/pingdom/client/tmschecks#StepArg",
                    "type": "object"
                  },
                  "function": {
                    "description": "contains the function that is executed as part of the step\ncommands: go_to, click, fill, check, uncheck, sleep, select_radio, basic_auth, submit, wait_for_element, wait_for_contains\nvalidations: url, exists, not_exists, contains, not_contains, field_contains, field_not_contains, is_checked, is_not_checked, radio_selected, dropdown_selected, dropdown_not_selected\nsee updated list https://docs.pingdom.com/api/#section/TMS-Steps-Vocabulary/Script-transaction-checks",
                    "type": "string"
                  }
                },
                "required": [
                  "args",
                  "function"
                ],
                "type": "object",
                "additionalProperties": false
              },
              "type": "array"
            },
            "tags": {
              "description": "List of tags for a check. The tag name may contain the characters 'A-Z', 'a-z', '0-9', '_' and '-'. The maximum length of a tag is 64 characters.",
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            "teamAlertContacts": {
              "description": "`-` separated team id's (e.g. \"1234567_8_9-9876543_2_1\")",
              "type": "string"
            }
          },
          "required": [
            "steps"
          ],
          "type": "object",
          "additionalProperties": false
        },
        "providers": {
          "description": "Comma separated list of providers",
          "type": "string"
        },
        "statusCakeConfig": {
          "description": "Configuration for StatusCake Monitor Provider",
          "properties": {
            "basicAuthSecret": {
              "description": "Basic Auth Secret Name",
              "type": "string"
            },
            "basicAuthUser": {
              "description": "Basic Auth User",
              "type": "string"
            },
            "checkRate": {
              "default": 300,
              "description": "Set Check Rate for the monitor.",
              "type": "integer"
            },
            "confirmation": {
              "description": "Confirmation value ranges from (0,10)",
              "maximum": 10,
              "minimum": 0,
              "type": "integer"
            },
            "contactGroup": {
              "description": "Contact Group to be alerted.",
              "type": "string"
            },
            "enableSslAlert": {
              "description": "Enable SSL Alert",
              "type": "boolean"
            },
            "findString": {
              "description": "String to look for within the response. Considered down if not found",
              "type": "string"
            },
            "followRedirect": {
              "description": "Enable ingress redirects",
              "type": "boolean"
            },
            "paused": {
              "description": "Pause the service",
              "type": "boolean"
            },
            "pingUrl": {
              "description": "Webhook for alerts",
              "type": "string"
            },
            "port": {
              "description": "TCP Port",
              "type": "integer"
            },
            "rawPostData": {
              "description": "RawPostData can be used to send parameters within the URL. Changes the request from a GET to a POST",
              "type": "string"
            },
            "realBrowser": {
              "description": "Enable Real Browser",
              "type": "boolean"
            },
            "regions": {
              "description": "Comma separated list of Node Location IDs",
              "type": "string"
            },
            "statusCodes": {
              "description": "Comma separated list of HTTP codes to trigger error on",
              "type": "string"
            },
            "testTags": {
              "description": "Comma separated list of tags",
              "type": "string"
            },
            "testType": {
              "description": "Set Test type - HTTP, TCP, PING, or Heartbeat",
              "enum": [
                "HTTP",
                "TCP",
                "PING",
                "Heartbeat"
              ],
              "type": "string"
            },
            "timeout": {
              "description": "Timeout is used to set a user agent string.",
              "maximum": 75,
              "minimum": 5,
              "type": "integer"
            },
            "triggerRate": {
              "description": "Minutes to wait before sending an alert",
              "type": "integer"
            },
            "userAgent": {
              "description": "UserAgent is used to set a user agent string.",
              "type": "string"
            }
          },
          "type": "object",
          "x-kubernetes-validations": [
            {
              "message": "checkRate must be between 30 and 172800 seconds for Heartbeat monitors",
              "rule": "self.testType != 'Heartbeat' || (self.checkRate >= 30 && self.checkRate <= 172800)"
            },
            {
              "message": "checkRate for uptime monitors must be one of: 0, 30, 60, 300, 900, 1800, 3600, 86400",
              "rule": "self.testType == 'Heartbeat' || self.checkRate in [0, 30, 60, 300, 900, 1800, 3600, 86400]"
            }
          ],
          "additionalProperties": false
        },
        "updownConfig": {
          "description": "Configuration for Updown Monitor Provider",
          "properties": {
            "enable": {
              "description": "Enable or disable checks",
              "type": "boolean"
            },
            "period": {
              "description": "The pingdom check interval in seconds",
              "type": "integer"
            },
            "publishPage": {
              "description": "Make status page public or not",
              "type": "boolean"
            },
            "requestHeaders": {
              "description": "Additional request headers for API calls",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "uptimeConfig": {
          "description": "Configuration for Uptime Monitor Provider",
          "properties": {
            "checkType": {
              "description": "The uptime check type that can be HTTP/DNS/ICMP etc.",
              "type": "string"
            },
            "contacts": {
              "description": "Add one or more contact groups separated by `,`",
              "type": "string"
            },
            "interval": {
              "description": "The uptime check interval in seconds",
              "type": "integer"
            },
            "locations": {
              "description": "Add different locations for the check",
              "type": "string"
            },
            "tags": {
              "description": "Add one or more tags for the check separated by `,`",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "uptimeRobotConfig": {
          "description": "Configuration for UptimeRobot Monitor Provider",
          "properties": {
            "alertContacts": {
              "description": "The uptimerobot alertContacts to be associated with this monitor",
              "type": "string"
            },
            "customHTTPStatuses": {
              "description": "Defines which http status codes are treated as up or down\nFor ex: 200:0_401:1_503:1 (to accept 200 as down and 401 and 503 as up)",
              "type": "string"
            },
            "interval": {
              "description": "The uptimerobot check interval in seconds",
              "minimum": 60,
              "type": "integer"
            },
            "keywordExists": {
              "description": "Alert if value exist (yes) or doesn't exist (no) (Only if monitor-type is keyword)",
              "enum": [
                "yes",
                "no"
              ],
              "type": "string"
            },
            "keywordValue": {
              "description": "keyword to check on URL (e.g.'search' or '404') (Only if monitor-type is keyword)",
              "type": "string"
            },
            "maintenanceWindows": {
              "description": "Specify maintenanceWindows i.e. once or recurring \u201cdo-not-monitor periods\u201d",
              "type": "string"
            },
            "monitorType": {
              "description": "The uptimerobot monitor type (http or keyword)",
              "enum": [
                "http",
                "keyword"
              ],
              "type": "string"
            },
            "statusPages": {
              "description": "The uptimerobot public status page ID to add this monitor to",
              "type": "string"
            }
          },
          "type": "object",
          "additionalProperties": false
        },
        "url": {
          "description": "URL to monitor",
          "type": "string"
        },
        "urlFrom": {
          "description": "URL to monitor from either an ingress or route reference",
          "properties": {
            "ingressRef": {
              "description": "IngressURLSource selects an Ingress to populate the URL with",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "type": "object",
              "additionalProperties": false
            },
            "routeRef": {
              "description": "RouteURLSource selects a Route to populate the URL with",
              "properties": {
                "name": {
                  "type": "string"
                }
              },
              "required": [
                "name"
              ],
              "type": "object",
              "additionalProperties": false
            }
          },
          "type": "object",
          "additionalProperties": false
        }
      },
      "type": "object",
      "additionalProperties": false
    },
    "status": {
      "description": "EndpointMonitorStatus defines the observed state of EndpointMonitor",
      "type": "object"
    }
  },
  "type": "object"
}
