From 6c2d11142eecd93ce59d7d1e922d4cf7ea80d4ae Mon Sep 17 00:00:00 2001 From: Hirad Date: Fri, 24 Jan 2025 13:06:54 +0330 Subject: [PATCH] add start and stop stack --- portainer/stacks.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/portainer/stacks.py b/portainer/stacks.py index 765b6d7..f82f28d 100644 --- a/portainer/stacks.py +++ b/portainer/stacks.py @@ -13,4 +13,12 @@ class StacksApi(ApiBase): def update_stack(self, webhook): url = f"{self.base_url}/stacks/webhooks/{webhook}" return self.request("POST", url) + + def start_stack(self, stack_id): + url = f"{self.base_url}/stacks/{stack_id}/start" + return self.request("POST", url) + + def stop_stack(self, stack_id): + url = f"{self.base_url}/stacks/{stack_id}/stop" + return self.request("POST", url) \ No newline at end of file