diff --git a/schemas/infra/opala/cron/v1.configs.json b/schemas/infra/opala/cron/v2.configs.json similarity index 78% rename from schemas/infra/opala/cron/v1.configs.json rename to schemas/infra/opala/cron/v2.configs.json index 7fbcf580..3d9abf84 100644 --- a/schemas/infra/opala/cron/v1.configs.json +++ b/schemas/infra/opala/cron/v2.configs.json @@ -6,7 +6,11 @@ "logger": { "level": "info", "prettyPrint": false - } + }, + "tracing": { + "$ref": { "configName": "common-tracing", "version": "latest" } + }, + "shared": {} }, "db": { "$ref": { "configName": "infra-opala-db", "version": "latest" } diff --git a/schemas/infra/opala/cron/v2.schema.json b/schemas/infra/opala/cron/v2.schema.json new file mode 100644 index 00000000..d50aa1cd --- /dev/null +++ b/schemas/infra/opala/cron/v2.schema.json @@ -0,0 +1,101 @@ +{ + "$id": "https://mapcolonies.com/infra/opala/cron/v2", + "description": "The opala cron service schema", + "title": "opalaCronSchemaV2", + "type": "object", + "allOf": [ + { + "type": "object", + "required": ["telemetry", "cron", "db"], + "properties": { + "telemetry": { + "$ref": "#/definitions/telemetry" + }, + "db": { + "$ref": "https://mapcolonies.com/common/db/full/v1" + }, + "cron": { + "$ref": "#/definitions/crons" + } + } + } + ], + "definitions": { + "crons": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": ["np"] + }, + { + "required": ["stage"] + }, + { + "required": ["prod"] + } + ], + "properties": { + "np": { + "$ref": "#/definitions/cron" + }, + "prod": { + "$ref": "#/definitions/cron" + }, + "stage": { + "$ref": "#/definitions/cron" + } + } + }, + "cron": { + "type": "object", + "required": ["pattern", "s3"], + "properties": { + "pattern": { + "type": "string", + "description": "The cron timing spec", + "examples": ["*/1 * * * *"] + }, + "s3": { + "type": "object", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/s3/partial/v1" + }, + { + "type": "object", + "required": ["key", "bucket"], + "properties": { + "key": { + "type": "string", + "description": "specific key of bundle inside s3", + "x-env-value": "S3_KEY" + }, + "bucket": { + "type": "string", + "description": "specific bucket name inside s3", + "x-env-value": "S3_BUCKET" + } + } + } + ] + } + } + }, + "telemetry": { + "type": "object", + "required": ["logger", "tracing", "shared"], + "properties": { + "logger": { + "$ref": "https://mapcolonies.com/common/telemetry/logger/v1" + }, + "tracing": { + "$ref": "https://mapcolonies.com/common/telemetry/tracing/v1" + }, + "shared": { + "$ref": "https://mapcolonies.com/common/telemetry/base/v1" + } + } + } + } +}