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
1 changed files with 32 additions and 12 deletions

View File

@ -451,12 +451,21 @@ Delete
:return: a token containing sufficient data to verify the operations status
: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.
Create backup of resource and then delete resource.
:param initial_state: the (action, status) tuple of the resource as of
the start of this method
:param state: the (action, status) tuple of the resource to make sure that
backup may be created for the current resource
:return: a token containing sufficient data to verify the operations status
:raise: any ``Exception`` if the delete operation failed
@ -464,12 +473,23 @@ Delete
Verify the delete operation completed successfully.
:param token: the return value of ``handle_delete`` used to verify the
status of the operation
:param token: the return value of ``handle_delete`` or
``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
is deleted; ``False`` otherwise.
: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
+++++++++++++++++++++++++++++
To make your plug-in available for use in stack templates, the plug-in must