Distributions

A distribution represents an operating system that can be installed on a host. It groups elements required for the provisioning such as, for example, a kickstart template. Settings and parameters may be associated to a distribution, in particular for template rendering. .

Representation

The following elements are defined as part of a distribution representation:

  • name: The name of the distribution. Cannot be null. Must be unique organization-wide.
  • description: A human friendly description of the distribution.
  • version: A version number managed by the system. This value is read-only and is incremented on each changes to the resource.
  • organization: The name of the organization this distribution is part of. This field is read-only.
  • files: The templates associated to this distribution. This field is read-only.
  • settings: The settings associated to this distribution. This field is read-only.
  • parameters: The parameters of distribution’s files. This field is read-only.

Example

{
    "name": "co6-Hyp3",
    "description": "CentOS 6",
    "organization": "Guardis Test",
    "files": [
        {
            "delimiter": {
                "end": "}", 
                "start": "${"
            }, 
            "name": "co6.ks"
        }
    ], 
    "parameters": [
        {
            "description": "", 
            "key": "ks_rootpw_one", 
            "name": "Root password", 
            "schema": {
                "type": "string"
            }, 
            "value": "secret", 
            "version": 1
        }, 
        {
            "description": "", 
            "key": "enable_trunk", 
            "name": "Enable trunk", 
            "schema": {
                "type": "string"
            }, 
            "value": "true", 
            "version": 1
        }, 
        {
            "description": "", 
            "key": "amqp_server", 
            "name": "AMQP server", 
            "schema": {
                "type": "string"
            }, 
            "value": "mahogany.angleur.guardis.be", 
            "version": 1
        }, 
        {
            "description": "", 
            "key": "vm_arch", 
            "name": "Architecture", 
            "schema": {
                "type": "string"
            }, 
            "value": "x86_64", 
            "version": 1
        }, 
        {
            "description": "", 
            "key": "zone", 
            "name": "Zone", 
            "schema": {
                "type": "string"
            }, 
            "value": "angleur", 
            "version": 1
        }, 
        {
            "description": "", 
            "key": "vm_base_arch", 
            "name": "Base architecture", 
            "schema": {
                "type": "string"
            }, 
            "value": "x86_64", 
            "version": 1
        }
    ], 
    "settings": [
        {
            "key": "cmdline", 
            "value": "text ks=${_urls[\\"co6.ks\\"]}", 
            "version": 0
        }, 
        {
            "key": "initrd", 
            "value": "/var/lib/comodit/dist/centos/6/${vm_arch}/initrd.img", 
            "version": 0
        }, 
        {
            "key": "kernel", 
            "value": "/var/lib/comodit/dist/centos/6/${vm_arch}/vmlinuz", 
            "version": 0
        }
    ], 
    "version": 1
}

Methods

Collection

/api/organizations/{org_name}/distributions
  • GET: returns all the distributions defined in the organization.
  • POST: adds a new distribution to the organization.

Entity

/api/organizations/{org_name}/distributions/{dist_name}
  • GET: returns an existing distribution.
  • PUT: updates an existing distribution (read-only fields are ignored).
  • DELETE: deletes a distribution.

Other

/organizations/{org_name}/distributions/{dist_name}/_clone?name=new_name
  • PUT: clones an existing distribution; created distribution has provided name.

Sub-collections