|
| 1 | +CHECK_CONFIG_SCHEMA = { |
| 2 | + "$schema": "http://json-schema.org/draft-07/schema#", |
| 3 | + "title": "uptime_config", |
| 4 | + "$ref": "#/definitions/CheckConfig", |
| 5 | + "definitions": { |
| 6 | + "CheckInterval": { |
| 7 | + "title": "check_interval", |
| 8 | + "description": "The interval between each check run in seconds.", |
| 9 | + "type": "number", |
| 10 | + "enum": [60, 300, 600, 1200, 1800, 3600], |
| 11 | + }, |
| 12 | + "RequestHeader": { |
| 13 | + "title": "request_header", |
| 14 | + "description": "An individual header, consisting of a name and value as a tuple.", |
| 15 | + "type": "array", |
| 16 | + "prefixItems": [ |
| 17 | + {"title": "header_name", "type": "string"}, |
| 18 | + {"title": "header_value", "type": "string"}, |
| 19 | + ], |
| 20 | + }, |
| 21 | + "RegionScheduleMode": { |
| 22 | + "title": "region_schedule_mode", |
| 23 | + "description": "Defines how we'll schedule checks based on other active regions.", |
| 24 | + "type": "string", |
| 25 | + "enum": ["round_robin"], |
| 26 | + }, |
| 27 | + "CheckConfig": { |
| 28 | + "title": "check_config", |
| 29 | + "description": "A message containing the configuration for a check to scheduled and executed by the uptime-checker.", |
| 30 | + "type": "object", |
| 31 | + "additionalProperties": True, |
| 32 | + "properties": { |
| 33 | + "subscription_id": { |
| 34 | + "description": "UUID of the subscription that this check config represents.", |
| 35 | + "type": "string", |
| 36 | + }, |
| 37 | + "interval_seconds": {"$ref": "#/definitions/CheckInterval"}, |
| 38 | + "timeout_ms": { |
| 39 | + "description": "The total time we will allow to make the request in milliseconds.", |
| 40 | + "type": "number", |
| 41 | + }, |
| 42 | + "url": {"description": "The actual HTTP URL to check.", "type": "string"}, |
| 43 | + "request_method": { |
| 44 | + "description": "The HTTP method to use for the request.", |
| 45 | + "type": "string", |
| 46 | + "enum": ["GET", "POST", "HEAD", "PUT", "DELETE", "PATCH", "OPTIONS"], |
| 47 | + }, |
| 48 | + "request_headers": { |
| 49 | + "description": "Additional HTTP headers to send with the request", |
| 50 | + "type": "array", |
| 51 | + "items": {"$ref": "#/definitions/RequestHeader"}, |
| 52 | + }, |
| 53 | + "request_body": { |
| 54 | + "description": "Additional HTTP headers to send with the request", |
| 55 | + "type": "string", |
| 56 | + }, |
| 57 | + "trace_sampling": { |
| 58 | + "description": "Whether to allow for sampled trace spans for the request.", |
| 59 | + "type": "boolean", |
| 60 | + }, |
| 61 | + "active_regions": { |
| 62 | + "description": "A list of region slugs the uptime check is configured to run in.", |
| 63 | + "type": "array", |
| 64 | + "items": {"type": "string"}, |
| 65 | + }, |
| 66 | + "region_schedule_mode": {"$ref": "#/definitions/RegionScheduleMode"}, |
| 67 | + }, |
| 68 | + "required": ["subscription_id", "interval_seconds", "timeout_ms", "url"], |
| 69 | + }, |
| 70 | + }, |
| 71 | +} |
| 72 | +""" |
| 73 | +The json-schema for the uptime config object provided to the uptime-checker via redis. |
| 74 | +""" |
0 commit comments