From 0ac4a80dada9a7fb9ee13d965c496b2b7341a4d5 Mon Sep 17 00:00:00 2001 From: huangtianhua Date: Tue, 18 Oct 2016 10:32:01 +0800 Subject: Return condition functions based on the filter param Add 'with_condition_func' filter param for API template-function-list, if the param set to true, the response will include the condition functions. Change-Id: Ia7b4da71ed5c3da105dd23917e4921a96e445026 Closes-Bug: #1625505 --- heatclient/v1/template_versions.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'heatclient/v1') diff --git a/heatclient/v1/template_versions.py b/heatclient/v1/template_versions.py index 0bfc0a1..325cc96 100644 --- a/heatclient/v1/template_versions.py +++ b/heatclient/v1/template_versions.py @@ -35,11 +35,19 @@ class TemplateVersionManager(base.BaseManager): """ return self._list('/template_versions', 'template_versions') - def get(self, template_version): + def get(self, template_version, **kwargs): """Get a list of functions for a specific resource_type. :param template_version: template version to get the functions for """ url_str = '/template_versions/%s/functions' % ( parse.quote(encodeutils.safe_encode(template_version), '')) + + params = {} + if 'with_condition_func' in kwargs: + with_condition_func = kwargs.pop('with_condition_func') + params.update({'with_condition_func': with_condition_func}) + if params: + url_str += '?%s' % parse.urlencode(params, True) + return self._list(url_str, 'template_functions') -- cgit v1.2.1