appliance_schema_0.8.0.yaml

Path: lib/boxgrinder-core/schemas/appliance_schema_0.8.0.yaml
Last Update: Tue May 17 15:13:12 +0000 2011

0.8.x schema version: 0.8.0 type: map mapping:

  "name":
    type: str
    length: { min: 1 }
    required: yes
  "summary":
    type: str
    length: { min: 1 }
  "version":
    type: int
  "release":
    type: int
  "os":
    type: map
    mapping:
      "name":
        type: str
        length: { min: 1 }
        required: yes
      "version":
        type: text
        required: yes
      "password":
        type: str
  "hardware":
    type: map
    name: Hardware
    mapping:
      "cpus":
        type: int
        range: { min: 1, max: 4 }
      "memory":
        type: int
        range: { min: 1 }
      "partitions":
        type: map
        mapping:
          "=": #No way of providing validation regex for wildcard name.
            type: map
            mapping:
              "size":
                type: number
                range: { min: 0.01 }
              "type":
                type: str
                enum: [ext3, ext4]
  "appliances":
    type: seq
    sequence:
      - type: str
        pattern: /^[^\/]+$/ #dont support path resolution yet
        length: { min: 1 }
  "packages":
    type: map
    mapping:
      "includes": &pkg
        type: seq
        sequence:
          - type: str
            pattern: /^[\w\-+.@\043]+$/ #fedora packaging standard http://bit.ly/h0JN9u (plus a few more, disallow symbols/spaces)
            length: { min: 1 }
      "excludes": *pkg
  "repos":
    type: seq
    sequence:
      - type: map
        mapping:
          "name":
            type: str
            pattern: /^[\w\-+.#]+$/
            length: { min: 1 }
            required: yes
          "baseurl": &pkg-mirror
            type: str
            pattern: /(^((http|https|ftp):)(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$|^file:\/\/.+$)/ #customised rfc3986 standard regexp for URIs
          "mirrorlist": *pkg-mirror
          "ephemeral":
            type: bool
  "post":
    type: map
    mapping:
      "=":
        type: seq
        sequence:
          - type: str
            length: { min: 1 }
  "variables":
    type: map
    mapping:
      "=": # wibble: value
        type: str
        length: { min: 1 }

[Validate]