cinder.volume.flows.api.manage_existing module

class EntryCreateTask(db)

Bases: cinder.flow_utils.CinderTask

Creates an entry for the given volume creation in the database.

Reversion strategy: remove the volume_id created from the database.

default_provides = {'volume', 'volume_properties'}
execute(context, **kwargs)

Creates a database entry for the given inputs and returns details.

Accesses the database and creates a new entry for the to be created volume using the given volume properties which are extracted from the input kwargs.

revert(context, result, optional_args=None, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

class ManageCastTask(scheduler_rpcapi, db)

Bases: cinder.flow_utils.CinderTask

Performs a volume manage cast to the scheduler and the volume manager.

This which will signal a transition of the api workflow to another child and/or related workflow.

execute(context, volume, **kwargs)

Activate a given atom which will perform some operation and return.

This method can be used to perform an action on a given set of input requirements (passed in via *args and **kwargs) to accomplish some type of operation. This operation may provide some named outputs/results as a result of it executing for later reverting (or for other atoms to depend on).

NOTE(harlowja): the result (if any) that is returned should be persistable so that it can be passed back into this atom if reverting is triggered (especially in the case where reverting happens in a different python process or on a remote machine) and so that the result can be transmitted to other atoms (which may be local or remote).

Parameters
  • args – positional arguments that atom requires to execute.

  • kwargs – any keyword arguments that atom requires to execute.

revert(context, result, flow_failures, volume, **kwargs)

Revert this atom.

This method should undo any side-effects caused by previous execution of the atom using the result of the execute() method and information on the failure which triggered reversion of the flow the atom is contained in (if applicable).

Parameters
  • args – positional arguments that the atom required to execute.

  • kwargs – any keyword arguments that the atom required to execute; the special key 'result' will contain the execute() result (if any) and the **kwargs key 'flow_failures' will contain any failure information.

get_flow(scheduler_rpcapi, db_api, create_what)

Constructs and returns the api entrypoint flow.

This flow will do the following:

  1. Inject keys & values for dependent tasks.

  2. Extracts and validates the input keys & values.

  3. Creates the database entry.

  4. Casts to volume manager and scheduler for further processing.