Settings

A setting represents a particular value to set to a variable. In particular, template variables.

Settings may be associated to an organization, an environment, a host, a platform, a distribution, an application context, a distribution context, and a platform context.

Currently, 2 types of settings are supported:

  • simple settings that have a given value,
  • link settings that point to another simple or link setting and whose value is equal to pointed setting. A default value may be provided for the case pointed setting does not exist. If loops of link settings are created, settings will all take the same value which is the default value of one of the settings in the loop.

The value of a setting may be a string or a more complex object (array, dictionary, etc.) that can be represented using JSON.

Updating, deleting or removing a setting may trigger operations on host instances. The operations are described by application handlers.

Representation

The following elements are defined as part of a setting:

  • key: The name of target variable.
  • value: The value of simple setting or default value of link setting.
  • link: The path to another setting. This path is actually the URL to a setting entity but without protocol and host parts (see below for an example).

Example

Simple setting

{
    "key": "httpd_port",
    "value": "8080"
}

Link setting

{
    "key": "httpd_port",
    "link" : "organizations/TestOrg/environments/TestEnv/settings/httpd_port",
    "value": "8080"
}

Above setting points to httpd_port setting of environment ‘TestEnv’ in organization ‘TestOrg’ and has default value “8080”.

Complex value setting

{
    "key": "employees",
    "value": [
        {
            "name" : "Gérard Dethier",
            "function" : "Software engineer"
        }
    ]
}

Methods

Settings are part of a sub-collection, below URLs are therefore relative.

Collection

settings
  • GET: returns the list of settings.
  • POST: adds a new setting.

Entity

settings/{setting_key}
  • GET: returns the setting.
  • PUT: updates the setting.
  • DELETE: removes the setting.