{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/gmi-cloud/main/json-schema/gmi-cloud-container-config-schema.json",
  "title": "containerConfig",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gmi-cloud-cluster-engine-openapi.yml#/components/schemas/containerConfig",
  "properties": {
    "args": {
      "default": [],
      "description": "Optional container command arguments",
      "items": {
        "type": "string"
      },
      "type": "array",
      "x-go-type-skip-optional-pointer": true
    },
    "command": {
      "default": "",
      "description": "Optional container start command",
      "type": "string",
      "x-go-type-skip-optional-pointer": true
    },
    "envs": {
      "default": [],
      "items": {
        "$ref": "#/$defs/Env"
      },
      "minLength": 0,
      "type": "array"
    },
    "name": {
      "$ref": "#/$defs/name"
    },
    "ports": {
      "default": [],
      "items": {
        "$ref": "#/$defs/exposedPort"
      },
      "maxLength": 5,
      "minLength": 0,
      "type": "array",
      "x-go-type-skip-optional-pointer": true
    },
    "sshKeyIdList": {
      "$ref": "#/$defs/UuidList",
      "description": "The list of SSH key IDs to use in the container"
    },
    "templateId": {
      "description": "template id",
      "format": "uuid",
      "type": "string"
    }
  },
  "required": [
    "name",
    "templateId"
  ],
  "type": "object",
  "$defs": {
    "Env": {
      "properties": {
        "name": {
          "maxLength": 4096,
          "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$",
          "type": "string"
        },
        "value": {
          "default": "",
          "maxLength": 1048576,
          "type": "string"
        }
      },
      "required": [
        "name",
        "value"
      ]
    },
    "UuidList": {
      "items": {
        "format": "uuid",
        "type": "string"
      },
      "type": "array"
    },
    "exposedPort": {
      "properties": {
        "containerPort": {
          "maximum": 65534,
          "minimum": 0,
          "type": "integer"
        },
        "port": {
          "maximum": 65534,
          "minimum": 0,
          "type": "integer",
          "x-go-type-skip-optional-pointer": true
        },
        "protocol": {
          "enum": [
            "TCP",
            "UDP"
          ],
          "type": "string"
        }
      },
      "required": [
        "containerPort",
        "protocol"
      ]
    },
    "name": {
      "maxLength": 255,
      "pattern": "^([A-Za-z0-9][A-Za-z0-9_\\-. ]*)?[A-Za-z0-9]$",
      "type": "string"
    }
  }
}