Clarify snapshot deletion methods

There are two similar and confused things presented in code:
'handle_delete_snapshot' and 'handle_snapshot_delete'. In this patch
documenatation is updated to clarify current differences between this
two features.

Change-Id: I88997df97956cc36b071f116dd678df109e0f2de
This commit is contained in:
Sergey Kraynev 2014-10-13 10:07:35 -04:00
parent dab36df3db
commit 0b6cdec5d3

View File

@ -451,12 +451,21 @@ Delete
:return: a token containing sufficient data to verify the operations status :return: a token containing sufficient data to verify the operations status
:raise: any ``Exception`` if the delete operation failed :raise: any ``Exception`` if the delete operation failed
.. py:function:: handle_delete_snapshot(self, initial_state) .. py:function:: handle_delete_snapshot(self, snapshot)
Delete resource snapshot.
:param snapshot: dictionary describing current snapshot.
:return: a token containing sufficient data to verify the operations status
:raise: any ``Exception`` if the delete operation failed
.. py:function:: handle_snapshot_delete(self, state)
Called instead of ``handle_delete`` when the deletion policy is SNAPSHOT. Called instead of ``handle_delete`` when the deletion policy is SNAPSHOT.
Create backup of resource and then delete resource.
:param initial_state: the (action, status) tuple of the resource as of :param state: the (action, status) tuple of the resource to make sure that
the start of this method backup may be created for the current resource
:return: a token containing sufficient data to verify the operations status :return: a token containing sufficient data to verify the operations status
:raise: any ``Exception`` if the delete operation failed :raise: any ``Exception`` if the delete operation failed
@ -464,12 +473,23 @@ Delete
Verify the delete operation completed successfully. Verify the delete operation completed successfully.
:param token: the return value of ``handle_delete`` used to verify the :param token: the return value of ``handle_delete`` or
status of the operation ``handle_snapshot_delete`` (for deletion policy - Snapshot)
used to verify the status of the operation
:return: ``True`` if the delete operation completed and the physical resource :return: ``True`` if the delete operation completed and the physical resource
is deleted; ``False`` otherwise. is deleted; ``False`` otherwise.
:raise: any ``Exception`` if the delete operation failed. :raise: any ``Exception`` if the delete operation failed.
.. py:function:: check_delete_snapshot_complete(self, token)
Verify the delete snapshot operation completed successfully.
:param token: the return value of ``handle_delete_snapshot`` used
to verify the status of the operation
:return: ``True`` if the delete operation completed and the snapshot
is deleted; ``False`` otherwise.
:raise: any ``Exception`` if the delete operation failed.
Registering Resource Plug-ins Registering Resource Plug-ins
+++++++++++++++++++++++++++++ +++++++++++++++++++++++++++++
To make your plug-in available for use in stack templates, the plug-in must To make your plug-in available for use in stack templates, the plug-in must