Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add deployment template schema for Edge Runtime 1.1 and 1.2 #1784

Merged
merged 2 commits into from
Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/api/json/catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@
"url": "https://json.schemastore.org/azure-iot-edge-deployment-template-2.0.json",
"versions": {
"1.0": "https://json.schemastore.org/azure-iot-edge-deployment-template-1.0.json",
"1.1": "https://json.schemastore.org/azure-iot-edge-deployment-template-2.0.json"
"1.1": "https://json.schemastore.org/azure-iot-edge-deployment-template-2.0.json",
"1.2": "https://json.schemastore.org/azure-iot-edge-deployment-template-3.0.json",
"1.3": "https://json.schemastore.org/azure-iot-edge-deployment-template-4.0.json"
}
},
{
Expand Down
24 changes: 24 additions & 0 deletions src/schema-validation.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,30 @@
]
}
},
{
"azure-iot-edge-deployment-template-3.0.json": {
"unknownKeywords": [
"examples",
"contentMediaType"
],
"externalSchema": [
"azure-iot-edgeagent-deployment-1.1.json",
"azure-iot-edgehub-deployment-1.1.json"
]
}
},
{
"azure-iot-edge-deployment-template-4.0.json": {
"unknownKeywords": [
"examples",
"contentMediaType"
],
"externalSchema": [
"azure-iot-edgeagent-deployment-1.1.json",
"azure-iot-edgehub-deployment-1.2.json"
]
}
},
{
"azure-iot-edge-deployment-2.0.json": {
"unknownKeywords": [
Expand Down
180 changes: 180 additions & 0 deletions src/schemas/json/azure-iot-edge-deployment-template-3.0.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"id": "https://json.schemastore.org/azure-iot-edge-deployment-template-3.0.json",
"type": "object",
"title": "JSON schema for Azure IoT Edge Deployment Template version 3.0 (Edge Agent schema v1.1 + Edge Hub schema v1.1 )",
"required": [
"modulesContent"
],
"properties": {
"modulesContent": {
"type": "object",
"title": "The configuration for all the modules.",
"required": [
"$edgeAgent"
],
"properties": {
"$edgeAgent": {
"type": "object",
"title": "Configuration for the edgeAgent module",
"required": [
"properties.desired"
],
"properties": {
"properties.desired": {
"type": "object",
"required": [
"schemaVersion",
"runtime",
"systemModules",
"modules"
],
"properties": {
"schemaVersion": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/properties/$edgeAgent/properties/properties.desired/properties/schemaVersion"
},
"runtime": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/properties/$edgeAgent/properties/properties.desired/properties/runtime"
},
"systemModules": {
"type": "object",
"required": [
"edgeAgent",
"edgeHub"
],
"properties": {
"edgeAgent": {
"type": "object",
"required": [
"type",
"settings"
],
"properties": {
"type": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/moduleType"
},
"settings": {
"$ref": "#/definitions/moduleSettings"
},
"env": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/env"
},
"imagePullPolicy": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/imagePullPolicy"
}
}
},
"edgeHub": {
"type": "object",
"title": "The Edgehub Schema",
"required": [
"type",
"settings",
"status",
"restartPolicy"
],
"properties": {
"type": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/moduleType"
},
"settings": {
"$ref": "#/definitions/moduleSettings"
},
"env": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/env"
},
"status": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/status"
},
"restartPolicy": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/restartPolicy"
},
"imagePullPolicy": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/imagePullPolicy"
},
"startupOrder": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/startupOrder"
}
}
}
}
},
"modules": {
"type": "object",
"patternProperties": {
"^[a-zA-Z0-9_-]+$": {
"type": "object",
"required": [
"type",
"status",
"restartPolicy",
"settings"
],
"properties": {
"version": {
"type": "string",
"examples": [
"1.0"
]
},
"type": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/moduleType"
},
"status": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/status"
},
"restartPolicy": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/restartPolicy"
},
"env": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/env"
},
"settings": {
"$ref": "#/definitions/moduleSettings"
},
"imagePullPolicy": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/imagePullPolicy"
},
"startupOrder": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/startupOrder"
}
}
}
}
}
}
}
}
},
"$edgeHub": {
"$ref": "https://json.schemastore.org/azure-iot-edgehub-deployment-1.1.json#/properties/$edgeHub"
}
}
}
},
"definitions": {
"moduleSettings": {
"type": "object",
"required": [
"image"
],
"properties": {
"image": {
"$ref": "https://json.schemastore.org/azure-iot-edgeagent-deployment-1.1.json#/definitions/moduleSettings/properties/image"
}
},
"patternProperties": {
"^(createoptions|createOptions)[0-9]*$": {
"$ref": "#/definitions/createOptions"
}
}
},
"createOptions": {
"type": [
"object",
"string"
],
"contentMediaType": "application/json"
}
}
}
Loading