Maintenance¶
Create a new maintenance session. You can specify a list of ‘hosts’ to be maintained or have an empty list to indicate those should be self-discovered. You need to have an initial state for the workflow in ‘state’. ‘workflow’ indicates the name of a Python plug-in to be used in the maintenance.
Planned future functionality¶
‘download’ can contain a list of URLs from where the needed software changes are downloaded. It can also provide plug-ins to be used.
‘actions’ can contain a list of action plug-ins to be called before maintenance starts, on each host or after the maintenance.
Request¶
Name | In | Type | Description |
---|---|---|---|
hosts | body | list of strings | Hosts to be maintained. An empty list can indicate hosts are to be discovered. |
state | body | string | Maintenance workflow state. |
maintenance_at | body | string | Maintenance workflow start time. |
workflow | body | string | Maintenance workflow to be used. |
metadata | body | dictionary | Metadata; like hints to projects |
download (Optional) | body | list of dictionaries | List of needed SW upgrades New in version > 1 |
actions | body | list of dictionaries | List of action plug-ins. |
actions.plugin | body | string | plug-in name. Default workflow executes same type of plug-ins in an alphabetical order |
actions.type | body | integer | Type of the action plug-in. Default workflow supports:
|
actions.metadata | body | dictionary | Metadata; hints to plug-ins |
{
"hosts": ["overcloud-novacompute-1.opnfvlf.org",
"overcloud-novacompute-2.opnfvlf.org",
"overcloud-novacompute-3.opnfvlf.org"],
"state": "MAINTENANCE",
"maintenance_at": "2018-02-28 06:06:03",
"metadata": {"openstack_release": "Queens"},
"workflow": "default",
"download": ["https://my.sw.upgrades.com/SW1.tar.gz",
"https://my.sw.upgrades.com/ESW1.tar.gz",
"https://my.sw.upgrades.com/plugins1.tar.gz"],
"actions": [
{"plugin": "prepare", "type": "pre"},
{"plugin": "esw_upgrade", "type": "host", "metadata": {"upgrade": "ESW1"}},
{"plugin": "os_upgrade", "type": "host", "metadata": {"upgrade": "SW1"}},
{"plugin": "finalize", "type": "post"}]
}
Update existing maintenance session. This can be used to continue a failed session.
Request¶
Name | In | Type | Description |
---|---|---|---|
session_id (Optional) | path | string | Session ID New in version > 1 |
Get all ongoing maintenance sessions.
Get a maintenance session state.
Request¶
Name | In | Type | Description |
---|---|---|---|
session_id (Optional) | path | string | Session ID New in version > 1 |
Delete a maintenance session. Usually called after the session is successfully finished.
Success¶
Code | Reason |
---|---|
200 - OK |
Request was successful. |
Error¶
Code | Reason |
---|---|
404 - Not Found |
The requested resource could not be found. |
Future¶
On top of some expected changes mentioned above, it will also be handy to get detailed information about the steps run already in the maintenance session. This will be helpful when need to figure out any correcting actions to successfully finish a failed session. There is ongoing work to have everything kept in a database and that will be a key feature to enable these changes.