mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2026-05-04 18:49:50 +02:00
Compare commits
2 Commits
c5c5a5fafd
...
9986c1bc03
| Author | SHA1 | Date | |
|---|---|---|---|
| 9986c1bc03 | |||
| 18afddee86 |
+5
-5
@@ -1233,18 +1233,18 @@ class PortainerApi:
|
|||||||
)
|
)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def stop_stack(self, stack, endpoint_id):
|
def stop_stack(self, stack, endpoint_id):
|
||||||
|
|
||||||
"""Stop one stack or all stacks on an endpoint."""
|
"""Stop one stack or all stacks on an endpoint."""
|
||||||
print(f"Stopping stack {stack}")
|
# print(f"Stopping stack {stack}")
|
||||||
|
|
||||||
if endpoint_id is not None:
|
if endpoint_id is not None:
|
||||||
self.get_endpoint(endpoint_id)
|
self.get_endpoint(endpoint_id)
|
||||||
|
|
||||||
if stack is not None:
|
if stack is not None:
|
||||||
for s in stack:
|
for s in stack:
|
||||||
self.stack_ids.append(self._resolve_stack_id(s, endpoint_id))
|
self.stack_ids.append(self._resolve_stack_id(s, endpoint_id))
|
||||||
# print(self.stack_ids)
|
self.stack_ids = list(dict.fromkeys(self.stack_ids))
|
||||||
for stck in self.stack_ids:
|
for stck in self.stack_ids:
|
||||||
path = f"/stacks/{stck}/stop"
|
path = f"/stacks/{stck}/stop"
|
||||||
# print(path)
|
# print(path)
|
||||||
@@ -1283,8 +1283,8 @@ class PortainerApi:
|
|||||||
return "all"
|
return "all"
|
||||||
|
|
||||||
if not self._is_number(stack):
|
if not self._is_number(stack):
|
||||||
result = self.get_stack(stack, endpoint_id)
|
result = self.stacks_all[endpoint_id]['by_name'][stack]
|
||||||
return result["Id"]
|
return result
|
||||||
|
|
||||||
return int(stack)
|
return int(stack)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user