From 1e126a8516ffcc565d38389da2b2d97e5d517d6f Mon Sep 17 00:00:00 2001 From: NikosVlagoidis Date: Sun, 1 Jul 2018 22:10:52 +0300 Subject: [PATCH 1/3] Add filter actions by tag This commit adds the ability to filter actions by a tag name. --- CHANGELOG.rst | 4 +++- st2api/st2api/controllers/v1/actions.py | 3 ++- st2common/st2common/openapi.yaml | 4 ++++ st2common/st2common/openapi.yaml.j2 | 4 ++++ 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7d711b1b1c..d47de40401 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,7 +6,9 @@ in development Added ~~~~~ - +* Add new ``?tags``, query params to ``/v1/actions`` API endpoint. These query parameter allow + users to filter out actions to receive based on the tag name . By default, when no + filter values are provided, all actions are returned. (new feature) #4219 * Orchestra - new StackStorm-native workflow engine. This is currently in **beta**. (new feature) * Added metrics for collecting performance and health information about the various ST2 services and functions. (new feature) #4004 #2974 diff --git a/st2api/st2api/controllers/v1/actions.py b/st2api/st2api/controllers/v1/actions.py index 592b70a037..040d73853c 100644 --- a/st2api/st2api/controllers/v1/actions.py +++ b/st2api/st2api/controllers/v1/actions.py @@ -60,7 +60,8 @@ class ActionsController(resource.ContentPackResourceController): access = Action supported_filters = { 'name': 'name', - 'pack': 'pack' + 'pack': 'pack', + 'tags': 'name' } query_options = { diff --git a/st2common/st2common/openapi.yaml b/st2common/st2common/openapi.yaml index 243960bfbe..5208ff0c3c 100644 --- a/st2common/st2common/openapi.yaml +++ b/st2common/st2common/openapi.yaml @@ -288,6 +288,10 @@ paths: in: query description: Action pack name filter type: string + - name: tags + in: query + description: Action tags name filter + type: string x-parameters: - name: user in: context diff --git a/st2common/st2common/openapi.yaml.j2 b/st2common/st2common/openapi.yaml.j2 index 791a257e7e..9c7cfe060d 100644 --- a/st2common/st2common/openapi.yaml.j2 +++ b/st2common/st2common/openapi.yaml.j2 @@ -284,6 +284,10 @@ paths: in: query description: Action pack name filter type: string + - name: tags + in: query + description: Action tags name filter + type: string x-parameters: - name: user in: context From df229e0f59e437958ee18e7efb407a41f23dad50 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 9 Jul 2018 11:32:00 +0200 Subject: [PATCH 2/3] Update CHANGELOG.rst --- CHANGELOG.rst | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 6ee0398b1e..a88e82570b 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,14 +4,19 @@ Changelog in development -------------- +Added +~~~~~ -2.8.0 - July 05, 2018 +* Add new ``?tags``, query param filter to the ``/v1/actions`` API endpoint. This query parameter + allows users to filter out actions based on the tag name . By default, when no filter values are + provided, all actions are returned. (new feature) #4219 + +2.8.0 - July 10, 2018 --------------------- Added ~~~~~ -* Add new ``?tags``, query params to ``/v1/actions`` API endpoint. These query parameter allow - users to filter out actions to receive based on the tag name . By default, when no + filter values are provided, all actions are returned. (new feature) #4219 * Orchestra - new StackStorm-native workflow engine. This is currently in **beta**. (new feature) * Added metrics for collecting performance and health information about the various ST2 services From 3132f6ad72ca9188093b1dc067808efcc19e3d66 Mon Sep 17 00:00:00 2001 From: Tomaz Muraus Date: Mon, 9 Jul 2018 12:13:06 +0200 Subject: [PATCH 3/3] Update CHANGELOG.rst --- CHANGELOG.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index eae5f9a7ae..7e89b716c8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -17,7 +17,6 @@ Added Added ~~~~~ - filter values are provided, all actions are returned. (new feature) #4219 * Orchestra - new StackStorm-native workflow engine. This is currently in **beta**. (new feature) * Added metrics for collecting performance and health information about the various ST2 services and functions. (new feature) #4004 #2974