diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f8ddf0ffe3..107eba58e4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -38,6 +38,9 @@ Added * Ensure `.pth` files in the st2 virtualenv get loaded by pack virtualenvs. #6183 Contributed by @cognifloyd +* Added a `get_result` method to the `ExecutionResourceManager` Class for st2client + Contributed by @skiedude + 3.8.1 - December 13, 2023 ------------------------- Fixed diff --git a/st2client/st2client/models/core.py b/st2client/st2client/models/core.py index e66e0e7800..633e57911f 100644 --- a/st2client/st2client/models/core.py +++ b/st2client/st2client/models/core.py @@ -547,6 +547,16 @@ def get_output(self, execution_id, output_type=None, **kwargs): return response.text + @add_auth_token_to_kwargs_from_env + def get_result(self, execution_id, **kwargs): + url = "/%s/%s/result" % (self.resource.get_url_path_name(), execution_id) + + response = self.client.get(url, **kwargs) + if response.status_code != http_client.OK: + self.handle_error(response) + + return response.text + @add_auth_token_to_kwargs_from_env def pause(self, execution_id, **kwargs): url = "/%s/%s" % (self.resource.get_url_path_name(), execution_id)