mirror of
https://gitlab.sectorq.eu/jaydee/portainer.git
synced 2025-12-14 02:34:53 +01:00
build
This commit is contained in:
10
portainer.py
10
portainer.py
@@ -13,10 +13,6 @@ import logging
|
||||
parser = argparse.ArgumentParser(description="Portainer helper - use env vars or pass credentials.")
|
||||
parser.add_argument("--base", "-b", default=os.getenv("PORTAINER_URL", "https://portainer.example.com"),
|
||||
help="Base URL for Portainer (ENV: PORTAINER_URL)")
|
||||
parser.add_argument("--user", "-u", default=os.getenv("PORTAINER_USER"),
|
||||
help="Portainer username (ENV: PORTAINER_USER)")
|
||||
parser.add_argument("--password", "-p", default=os.getenv("PORTAINER_PASS"),
|
||||
help="Portainer password (ENV: PORTAINER_PASS)")
|
||||
parser.add_argument("--endpoint-id", "-e", type=str, default="all", help="Endpoint ID to limit stack operations")
|
||||
parser.add_argument("--refresh-environment", "-R", action="store_true", help="List endpoints")
|
||||
parser.add_argument("--list-endpoints","-E", action="store_true", help="List endpoints")
|
||||
@@ -184,10 +180,10 @@ if __name__ == "__main__":
|
||||
sys.exit()
|
||||
|
||||
if args.refresh_status:
|
||||
if args.stack_id == "all":
|
||||
if args.stack== "all":
|
||||
print("Stopping all stacks...")
|
||||
stcks = get_stacks(base, token, endpoint_id=install_endpoint_id)
|
||||
stcks = por.get_stacks(base, token, endpoint_id=args.endpoint_id)
|
||||
# stcks = get_stack(base, sta, token, endpoint_id=install_endpoint_id)
|
||||
else:
|
||||
refresh_status(base, args.stack_id, token)
|
||||
por.refresh_status(base, args.stack_id, token)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user