From aee7ca1ca2369b6dfcc2ac2f2d9e8aa283778694 Mon Sep 17 00:00:00 2001 From: David Bastos Date: Thu, 25 Sep 2025 06:59:43 -0300 Subject: [PATCH] Exposing the API to collect all apps Adding the api that returns all apps from the database to the client to be used in the 21-k8s-app-upgrade script in order to correctly log the current update/revert state of the apps. Test Plan: PASS: build-pkgs && build-image PASS: Fresh install AIO-SX PASS: Platform upgrade stx-10 to master PASS: Platform rollback from master to stx-10 PASS: The api returns a list of apps loaded into the database as expected. Partial-bug: 2121827 Change-Id: I1e1d6e653e7bc0f0a529413b7c31996dff7d95ef Signed-off-by: David Bastos --- sysinv/cgts-client/cgts-client/cgtsclient/v1/kube_app.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sysinv/cgts-client/cgts-client/cgtsclient/v1/kube_app.py b/sysinv/cgts-client/cgts-client/cgtsclient/v1/kube_app.py index b9273ddba2..ee287dac93 100644 --- a/sysinv/cgts-client/cgts-client/cgtsclient/v1/kube_app.py +++ b/sysinv/cgts-client/cgts-client/cgtsclient/v1/kube_app.py @@ -15,6 +15,10 @@ class KubeAppManager(base.Manager): _, body = self.api.json_request('POST', f"{self.path}evaluate_apps_reapply/", body=triggers) return body + def get_all_apps(self): + _, response = self.api.json_request('GET', f"{self.path}apps/") + return response.get('apps', []) + def update_all(self): return self.api.json_request('POST', f"{self.path}apps/update_all/")