hí ộ
This commit is contained in:
170
templates/schemas/redis-service.v1.json
Normal file
170
templates/schemas/redis-service.v1.json
Normal file
@@ -0,0 +1,170 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "https://platform.example/templates/redis-service/v1",
|
||||
"title": "redis-service@v1",
|
||||
"description": "Redis replication with Sentinel; objects are built by the cluster gateway",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"templateRef": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"name": {
|
||||
"const": "redis-service"
|
||||
},
|
||||
"version": {
|
||||
"const": "v1"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"name",
|
||||
"version"
|
||||
]
|
||||
},
|
||||
"engineVersion": {
|
||||
"type": "string",
|
||||
"minLength": 1,
|
||||
"maxLength": 64
|
||||
},
|
||||
"image": {
|
||||
"type": "string",
|
||||
"pattern": "^[^\\s]+@sha256:[a-f0-9]{64}$"
|
||||
},
|
||||
"parameters": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"mode": {
|
||||
"enum": [
|
||||
"cache",
|
||||
"persistent"
|
||||
]
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"mode"
|
||||
]
|
||||
},
|
||||
"resources": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"profile": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9-]{0,62}$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"profile"
|
||||
]
|
||||
},
|
||||
"storage": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"profile": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9-]{0,62}$"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"pattern": "^[1-9][0-9]*(Mi|Gi|Ti)$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"profile",
|
||||
"size"
|
||||
]
|
||||
},
|
||||
"backup": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"profile": {
|
||||
"type": "string",
|
||||
"pattern": "^[a-z][a-z0-9-]{0,62}$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"profile"
|
||||
]
|
||||
},
|
||||
"restoreFrom": {
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"instanceId": {
|
||||
"type": "string",
|
||||
"pattern": "^ds-[a-f0-9]{32}$"
|
||||
},
|
||||
"backupId": {
|
||||
"type": "string",
|
||||
"pattern": "^op-[a-f0-9]{32}$"
|
||||
},
|
||||
"targetTime": {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"instanceId",
|
||||
"backupId"
|
||||
]
|
||||
},
|
||||
"sentinelImage": {
|
||||
"type": "string",
|
||||
"pattern": "^[^\\s]+@sha256:[a-f0-9]{64}$"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"templateRef",
|
||||
"engineVersion",
|
||||
"image",
|
||||
"parameters",
|
||||
"resources",
|
||||
"sentinelImage"
|
||||
],
|
||||
"allOf": [
|
||||
{
|
||||
"if": {
|
||||
"properties": {
|
||||
"parameters": {
|
||||
"properties": {
|
||||
"mode": {
|
||||
"const": "persistent"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"then": {
|
||||
"required": [
|
||||
"storage",
|
||||
"backup"
|
||||
]
|
||||
},
|
||||
"else": {
|
||||
"not": {
|
||||
"anyOf": [
|
||||
{
|
||||
"required": [
|
||||
"storage"
|
||||
]
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"backup"
|
||||
]
|
||||
},
|
||||
{
|
||||
"required": [
|
||||
"restoreFrom"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user