Coverage for src/tagmania/delete_snapshots.py: 0%
13 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-08-02 01:51 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-08-02 01:51 +0000
1import argparse
3from tagmania.iac_tools.clusterset import ClusterSet
6def main():
7 parser = argparse.ArgumentParser(
8 description="AWS cluster snapshot deletion.",
9 epilog='This tool relies on the "Cluster" and "Owner" tags on instances and '
10 "volumes. IAC automation puts this in place."
11 "This tool deletes all snapshots belonging to a cluster.",
12 )
13 parser.add_mutually_exclusive_group(required=True)
14 parser.add_argument(
15 "cluster",
16 help="the name CLUSTER of the cluster in question. This can be found by looking at any node "
17 'in the AWS console and looking for the "Cluster" tag.',
18 )
20 parser.add_argument("--profile", "-p", help="the AWS profile to use", default=None)
21 args = parser.parse_args()
23 ClusterSet(args.cluster, profile=args.profile)
24 print(f"Deleting snapshots for {args.cluster}")
26 # TODO: IMPLEMENT
27 print("Backup operation completed successfully!")
30if __name__ == "__main__":
31 main()