Add docs of update/replace *_FAILED resource for developer

After we implemented the blueprint
https://blueprints.launchpad.net/heat/+spec/custom-update-replace-for-failed-resources
it is good to add docs for developer about this.

Change-Id: I36ebe184497ecac0b8477d6778a0121dcb8ea406
This commit is contained in:
huangtianhua 2017-01-11 18:09:20 +08:00
parent e0f1a2c18c
commit 28e722edee
1 changed files with 10 additions and 0 deletions

View File

@ -479,6 +479,16 @@ that updates require the engine to delete and re-create the resource
have values of ``None``
:type prop_diff: collections.Mapping
*Note* Before calling ``handle_update`` we check whether need to replace
the resource, especially for resource in ``*_FAILED`` state, there is a
default implementation of ``needs_replace_failed`` in
``heat.engine.resource.Resource`` that simply returns ``True`` indicating
that updates require replacement. And we override the implementation for
``OS::Nova::Server``, ``OS::Cinder::Volume`` and all of neutron resources.
The base principle is that to check whether the resource exists underlying
and whether the real status is available. So override the method
``needs_replace_failed`` for your resource plug-ins if needed.
.. py:function:: check_update_complete(self, token)
If defined, will be called with the return value of ``handle_update``