Changes
When a host is in UPDATING state, operations are currently undergone to make the instance converge towards new host’s description. A change is a logical grouping of tasks. A host is in the state UPDATING as long as there is at least one change having at least one task pending. If a single task is in error, host’s state is ERROR.
Representation
The following elements are defined as part of a change:
- orderNum: A number allowing to sort changes in the order they actually where triggered.
- description: A human friendly description of this change.
- tasks: A list of tasks. A task is defined by following elements:
- orderNum: A number allowing to sort tasks in the order they actually where triggered.
- status: The current status of the task. Possible values are PENDING, OK and ERROR.
- description: A human friendly description of this task.
- error: If status has value ERROR, an error message.
Example
{
"orderNum" : 0,
"description" : "Install WebServer",
"tasks" : [
{
"orderNum" : 0,
"status" : "OK",
"description" : "add package httpd"
},
{
"orderNum" : 1,
"status" : "PENDING",
"description" : "restart service httpd"
}
]
}
Methods
Changes are part of sub-collections of a host, below URLs are therefore relative.
Collection
changes[?show_processed=[true|false]]
- GET: returns the list of changes. If show_processed is true, all changes are returned. Otherwise, only pending changes are returned (default behavior if show_processed is not set).
- DELETE: deletes all changes. Host’s state may be altered (i.e. go back to READY state).
Entity
changes/{order_num}
- GET: returns a change.
- DELETE: deletes a change. Host’s state may be altered (i.e. go back to READY state).