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:
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.
-
classmethod convert_with_links(action, expand=True)[source]
-
classmethod sample(expand=True)[source]
-
class watcher.api.controllers.v1.action.ActionCollection(**kwargs)[source]
Bases: watcher.api.controllers.v1.collection.Collection
API representation of a collection of actions.
-
static convert_with_links(actions, limit, url=None, expand=False, **kwargs)[source]
-
classmethod sample()[source]
-
class watcher.api.controllers.v1.action.ActionPatchType(**kw)[source]
Bases: watcher.api.controllers.v1.types.JsonPatchType
-
static mandatory_attrs()[source]
-
class watcher.api.controllers.v1.action.ActionsController[source]
Bases: pecan.rest.RestController
REST controller for Actions.
-
delete(*args, **kwargs)[source]
Delete a action.
Parameters: | action_uuid – UUID of a action. |
-
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. |
-
patch(*args, **kwargs)[source]
Update an existing action.
Parameters: |
- action_uuid – UUID of a action.
- patch – a json PATCH document to apply to this action.
|
-
post(*args, **kwargs)[source]
Create a new action.
Parameters: | action – a action within the request body. |