Platforms

A platform represents an underlying infrastructure on which a host can be provisioned. Settings and parameters may be associated to a platform, in particular for template rendering.

Representation

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

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

Example

{
    "name": "Hyp3",
    "description": "Hyp3 Hypervisor from Angleur",
    "version": 2,
    "organization": "Guardis Test",
    "driver": {
        "className": "com.guardis.cortex.server.driver.LibvirtDriver", 
        "name": "Libvirt", 
        "parameters": [
            {
                "description": "Url used by libvirt to connect to the platform.", 
                "key": "libvirt.connectUrl", 
                "name": "Connect Url", 
                "schema": {
                    "type": "string"
                }, 
                "value": "qemu:///system", 
                "version": 0
            }
        ]
    }, 
    "files": [
        {
            "delimiter": {
                "end": "}", 
                "start": "${"
            }, 
            "name": "libvirt.domain.fmt"
        }, 
        {
            "delimiter": {
                "end": "}", 
                "start": "${"
            }, 
            "name": "libvirt.disk.fmt"
        }
    ], 
    "parameters": [
        {
            "description": "Mac address for eth0 network adapter, will be generated if empty.", 
            "key": "vm_mac", 
            "name": "Eth0 Mac Address", 
            "schema": {
                "type": "string"
            }, 
            "version": 1
        }, 
        {
            "description": "Allocated memory, in MB", 
            "key": "vm_memory", 
            "name": "Memory", 
            "schema": {
                "type": "integer"
            }, 
            "value": 1024, 
            "version": 1
        }, 
        {
            "description": "Allocated disk size, in MB", 
            "key": "vm_capacity", 
            "name": "Disk size", 
            "schema": {
                "type": "integer"
            }, 
            "value": 3072, 
            "version": 1
        }, 
        {
            "description": "Allocated CPUs", 
            "key": "vm_nvirtcpus", 
            "name": "Number of CPUs", 
            "schema": {
                "type": "integer"
            }, 
            "value": 1, 
            "version": 1
        }, 
        {
            "description": "Bridge name for eth0 network adapter.", 
            "key": "vm_bridge", 
            "name": "Eth0 Bridge", 
            "schema": {
                "advanced": true, 
                "type": "string"
            }, 
            "version": 1
        }
    ], 
    "settings": [
        {
            "key": "vm_bridge", 
            "value": "br0", 
            "version": 0
        }, 
        {
            "key": "libvirt.connectUrl", 
            "value": "qemu://hyp3-devel.angleur.guardis.be/system", 
            "version": 0
        }
    ]
}

Methods

Collection

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

Entity

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

Other

/organizations/{org_name}/platforms/{plat_name}/_clone?name=new_name
  • PUT: clones an existing platform; created platform has provided name.

Sub-collections