summaryrefslogtreecommitdiff
path: root/heatclient/v1/resources.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-02-26 17:44:01 +0000
committerGerrit Code Review <review@openstack.org>2016-02-26 17:44:01 +0000
commitd151fcde11bec8451fc5dc361113ddbc966d39d6 (patch)
tree516d7e47b1bfa9ec976d4d578238b33004dcc89d /heatclient/v1/resources.py
parentd00903ad9389a45ede398663f7c18337bbbda4d8 (diff)
parentad48215db10246fa9d210529b107dc5e0f6008ad (diff)
downloadpython-heatclient-d151fcde11bec8451fc5dc361113ddbc966d39d6.tar.gz
Merge "Add heat client support for Resource set health"
Diffstat (limited to 'heatclient/v1/resources.py')
-rw-r--r--heatclient/v1/resources.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/heatclient/v1/resources.py b/heatclient/v1/resources.py
index 1e908a4..b55017d 100644
--- a/heatclient/v1/resources.py
+++ b/heatclient/v1/resources.py
@@ -117,6 +117,27 @@ class ResourceManager(stacks.StackChildManager):
body = utils.get_response_body(resp)
return body
+ def mark_unhealthy(self, stack_id, resource_name,
+ mark_unhealthy, resource_status_reason):
+ """Mark a resource as healthy or unhealthy.
+
+ :param stack_id: ID of stack containing the resource
+ :param resource_name: ID of resource
+ :param mark_unhealthy: Mark resource unhealthy if set to True
+ :param resource_status_reason: Reason for resource status change.
+ """
+ stack_id = self._resolve_stack_id(stack_id)
+ url_str = '/stacks/%s/resources/%s' % (
+ parse.quote(stack_id, ''),
+ parse.quote(encodeutils.safe_encode(resource_name), ''))
+ resp = self.client.patch(
+ url_str,
+ data={"mark_unhealthy": mark_unhealthy,
+ "resource_status_reason": resource_status_reason})
+
+ body = utils.get_response_body(resp)
+ return body
+
def generate_template(self, resource_name):
"""Deprecated in favor of generate_template in ResourceTypeManager."""