Compliance
A host’s instance may or not be in compliance. For example, if a package defined by an installed application is not present on the instance, the host is not in compliance. When a host is not in compliance, compliance errors are associated to it. In this case, its state is ERROR.
In order to bring a host in compliance again, methods available in application context resource might be used. For instance, if a file is not in compliance, its update might be triggered to bring host’s instance back in compliance.
Representation
The following elements are defined as part of a compliance error:
- application: The name of application whose resource is out of compliance.
- type: The type of resource. Possible values are:
- fileResource
- serviceResource
- packageResource
- name: The name of the resource.
- currentState: The current state of the resource. The state is dependent of resource type (see below).
- expectedState: The expected state of the resource. The state is dependent of resource type (see below).
Example
{
"application" : "WebServer",
"type" : "serviceResource",
"name" : "httpd",
"currentState" : {
"running" : false,
"enabled" : true
},
"expectedState" : {
"running" : true,
"enabled" : true
}
}
In above example, httpd service is not running, however it should.
File state
{
"modificationTime" : "...",
"creationTime" : "...",
"path" : "/etc/httpd/conf/httpd.conf",
"mode" : "644",
"owner" : "root",
"group" : "root",
"present" : true
}
Service state
{
"running" : false,
"enabled" : true
}
Package state
{
"installed" : true
}
Methods
Compliance errors are part of sub-collections of a host, below URLs are therefore relative.
Collection
compliance
- GET: returns the list of compliance errors.
- DELETE: deletes all compliance errors. Host’s state may be altered (i.e. go back to READY state).
File error
compliance/applications/{app_name}/files/{file_name}
- GET: returns an existing file compliance error.
- DELETE: deletes an existing file compliance error. Host’s state may be altered (i.e. go back to READY state).
Package error
compliance/applications/{app_name}/packages/{pkg_name}
- GET: returns an existing package compliance error.
- DELETE: deletes an existing package compliance error. Host’s state may be altered (i.e. go back to READY state).
Service error
compliance/applications/{app_name}/services/{svc_name}
- GET: returns an existing service compliance error.
- DELETE: deletes an existing service compliance error. Host’s state may be altered (i.e. go back to READY state).