{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/versions/1.2.json",
  "title": "JSON schema for Azure IoT Edge Deployment Template version 3.0 (Edge Agent schema v1.1 + Edge Hub schema v1.1 )",
  "x-lintel": {
    "source": "https://www.schemastore.org/azure-iot-edge-deployment-template-3.0.json",
    "sourceSha256": "8b456182b93f812a900e059fef570b8507da1adeb5a6e86c7c0d33b11e1940bf",
    "fileMatch": [
      "deployment.template.json",
      "deployment.debug.template.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "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://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/properties/$edgeAgent/properties/properties.desired/properties/schemaVersion"
                },
                "runtime": {
                  "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--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://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/moduleType"
                        },
                        "settings": {
                          "$ref": "#/$defs/moduleSettings"
                        },
                        "env": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/env"
                        },
                        "imagePullPolicy": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/imagePullPolicy"
                        }
                      }
                    },
                    "edgeHub": {
                      "type": "object",
                      "title": "The Edgehub Schema",
                      "required": [
                        "type",
                        "settings",
                        "status",
                        "restartPolicy"
                      ],
                      "properties": {
                        "type": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/moduleType"
                        },
                        "settings": {
                          "$ref": "#/$defs/moduleSettings"
                        },
                        "env": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/env"
                        },
                        "status": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/status"
                        },
                        "restartPolicy": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/restartPolicy"
                        },
                        "imagePullPolicy": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/imagePullPolicy"
                        },
                        "startupOrder": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/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://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/moduleType"
                        },
                        "status": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/status"
                        },
                        "restartPolicy": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/restartPolicy"
                        },
                        "env": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/env"
                        },
                        "settings": {
                          "$ref": "#/$defs/moduleSettings"
                        },
                        "imagePullPolicy": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/imagePullPolicy"
                        },
                        "startupOrder": {
                          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/startupOrder"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "$edgeHub": {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/1.2--azure-iot-edgehub-deployment-1.1.json#/properties/$edgeHub"
        }
      }
    }
  },
  "required": [
    "modulesContent"
  ],
  "$defs": {
    "moduleSettings": {
      "type": "object",
      "required": [
        "image"
      ],
      "properties": {
        "image": {
          "$ref": "https://catalog.lintel.tools/schemas/schemastore/azure-iot-edge-deployment-template/_shared/latest--azure-iot-edgeagent-deployment-1.1.json#/$defs/moduleSettings/properties/image"
        }
      },
      "patternProperties": {
        "^(createoptions|createOptions)[0-9]*$": {
          "$ref": "#/$defs/createOptions"
        }
      }
    },
    "createOptions": {
      "type": [
        "object",
        "string"
      ],
      "contentMediaType": "application/json"
    }
  },
  "id": "https://json.schemastore.org/azure-iot-edge-deployment-template-3.0.json"
}
