The watcher.api.controllers.v1.action
Module¶
An Action is what enables Watcher to transform the current state of a Cluster after an Audit.
An Action is an atomic task which changes the current state of a target Managed resource of the OpenStack Cluster such as:
- Live migration of an instance from one compute node to another compute node with Nova
- Changing the power level of a compute node (ACPI level, ...)
- Changing the current state of a compute node (enable or disable) with Nova
In most cases, an Action triggers some concrete commands on an existing OpenStack module (Nova, Neutron, Cinder, Ironic, etc.).
An Action has a life-cycle and its current state may be one of the following:
- PENDING : the Action has not been executed yet by the Watcher Applier
- ONGOING : the Action is currently being processed by the Watcher Applier
- SUCCEEDED : the Action has been executed successfully
- FAILED : an error occurred while trying to execute the Action
- DELETED : the Action is still stored in the Watcher database but is not returned any more through the Watcher APIs.
- CANCELLED : the Action was in PENDING or ONGOING state and was cancelled by the Administrator
Some default implementations are provided, but it is possible to develop new implementations which are dynamically loaded by Watcher at launch time.
-
class
watcher.api.controllers.v1.action.
Action
(**kwargs)[source]¶ Bases:
watcher.api.controllers.base.APIBase
API representation of a action.
This class enforces type checking and value constraints, and converts between the internal object model and the API representation of a action.
-
class
watcher.api.controllers.v1.action.
ActionCollection
(**kwargs)[source]¶ Bases:
watcher.api.controllers.v1.collection.Collection
API representation of a collection of actions.
-
class
watcher.api.controllers.v1.action.
ActionsController
[source]¶ Bases:
pecan.rest.RestController
REST controller for Actions.
-
detail
(*args, **kwargs)[source]¶ Retrieve a list of actions with detail.
Parameters: - marker – pagination marker for large data sets.
- limit – maximum number of resources to return in a single result.
- sort_key – column to sort results by. Default: id.
- sort_dir – direction to sort. “asc” or “desc”. Default: asc.
- action_plan_uuid – Optional UUID of an action plan, to get only actions for that action plan.
- audit_uuid – Optional UUID of an audit, to get only actions for that audit.
-
get_all
(*args, **kwargs)[source]¶ Retrieve a list of actions.
Parameters: - marker – pagination marker for large data sets.
- limit – maximum number of resources to return in a single result.
- sort_key – column to sort results by. Default: id.
- sort_dir – direction to sort. “asc” or “desc”. Default: asc.
- action_plan_uuid – Optional UUID of an action plan, to get only actions for that action plan.
- audit_uuid – Optional UUID of an audit, to get only actions for that audit.
-
get_one
(*args, **kwargs)[source]¶ Retrieve information about the given action.
Parameters: action_uuid – UUID of a action.
-