chore: retire asset-engine (Prime 2026-10-17); kuma gains delete-by-name; FleetTools/bootstrap/catalog marked
This commit is contained in:
@@ -421,6 +421,25 @@ def cmd_add(args):
|
||||
k.__exit__()
|
||||
|
||||
|
||||
def cmd_delete(args):
|
||||
"""Remove ONE monitor by its exact name. `seed` never prunes (a missing row in
|
||||
monitors.yaml is not a delete), so retiring a service needs this as well as the
|
||||
yaml edit. Exits 1 if the name is not on the board."""
|
||||
k = connected_and_logged_in()
|
||||
try:
|
||||
mons = k.monitors_by_name()
|
||||
if args.name not in mons:
|
||||
print(f"no monitor named {args.name!r}", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
k.delete(mons[args.name]["id"])
|
||||
if args.name in k.monitors_by_name():
|
||||
print(f"delete of {args.name!r} did not take", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
print(f"deleted {args.name}")
|
||||
finally:
|
||||
k.__exit__()
|
||||
|
||||
|
||||
def main():
|
||||
p = argparse.ArgumentParser(prog="kuma", description=__doc__.split("\n")[0])
|
||||
sub = p.add_subparsers(dest="cmd", required=True)
|
||||
@@ -432,6 +451,7 @@ def main():
|
||||
a.add_argument("--type", default="http", choices=["http", "ping", "port"])
|
||||
a.add_argument("--port", type=int)
|
||||
a.set_defaults(fn=cmd_add)
|
||||
d = sub.add_parser("delete"); d.add_argument("name"); d.set_defaults(fn=cmd_delete)
|
||||
sub.add_parser("dedupe").set_defaults(fn=cmd_dedupe)
|
||||
sub.add_parser("channels").set_defaults(fn=cmd_channels)
|
||||
args = p.parse_args()
|
||||
|
||||
Reference in New Issue
Block a user