Hosts

A host describes a physical or virtual machine on which one distribution is deployed and applications can be installed. The host can be provisioned using a platform. When a host is provisioning or provisioned, an instance is attached to it. Settings may be associated to a host, in particular for template rendering.

When a distribution (respectively a platform) is associated to a host, a distribution context (respectively a platform context) is created. Similarly, an application context is associated to each installed application. These contexts enable to configure distribution, platform and applications by associating settings to them.

It is possible to monitor actions performed on the host (installing a package, restarting a service, etc.) through changes sub-collection. In addition, a host’s instance may comply or not to its definition, a compliance sub-collection is available in order to check this.

Representation

The following elements are defined as part of a host’s representation:

  • name: The name of the host. Cannot be null. Must be unique environment-wide.
  • description: A human friendly description of the host.
  • 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 to which this host belongs. This field is read-only.
  • environment: The name of the environment to which this host belongs. This field is read-only.
  • platform: The name of the platform to use in order to provision the host. This field is read-only.
  • distribution: The name of the distribution to install/installed on the host. This field is read-only.
  • applications: A list of application names to install/installed on the host. This field is read-only.
  • settings: A list of settings defined for this host. This field is read-only.
  • state: The state of the host. This field is read-only. There are 5 states:
    • DEFINED The host is defined inside ComodIT but has not yet been provisioned.
    • PROVISIONING The host is provisioning (an instance is being created, distribution is then installed and, finally, the ComodIT Agent is configured).
    • READY Host has been successfully provisioned and complies with defined state.
    • UPDATING Host is converging towards its defined state, see changes.
    • ERROR Host has diverged and/or does not comply with defined state, see changes and compliance.

Example

{
    "name": "test-host-on-Hyp3",
    "description": "Test host using distribution co6-Hyp3 on platform Hyp3",
    "version": 9,
    "organization": "Guardis Test",
    "environment": "Test Environment",
    "platform": "Hyp3", 
    "distribution": "co6-Hyp3",
    "applications": [
        "GuardisRepos", 
        "WebServer", 
        "SimpleWebPage"
    ],
    "settings": [], 
    "state": "DEFINED"
}

Methods

Collection

/organizations/{org_name}/environments/{env_name}/hosts
  • GET: returns all the hosts of the environment.
  • POST: adds a new host to the environment.

Entity

/organizations/{org_name}/environments/{env_name}/hosts/{host_name}
  • GET: returns an existing host.
  • PUT: updates an existing host (read-only fields are ignored).
  • DELETE: deletes a host.

Other

Host cloning

/organizations/{org_name}environments/{env_name}/hosts/{host_name}/_clone
  • PUT: clones an existing host

Post-install actions

/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/setup.json
  • GET: provides post-install actions. This URL is queried by the ComodIT Agent at the end of provisioning.

Audit

/organizations/{org_name}/environments/{env_name}/hosts/{host_name}/audit
  • GET: provides all audit logs for this host.

Sub-collections