Skip to content

Commit

Permalink
Bugfix Vespa Deletion Script (#3998)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx authored Feb 14, 2025
1 parent e9492ce commit b70db15
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion backend/scripts/debugging/onyx_vespa.py
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,7 @@ def main() -> None:
"update",
"delete",
"get_acls",
"delete-all-documents",
],
required=True,
help="Action to perform",
Expand All @@ -786,12 +787,19 @@ def main() -> None:
parser.add_argument(
"--fields", help="Fields to update, in JSON format (for update)"
)
parser.add_argument(
"--count",
type=int,
help="Maximum number of documents to delete (for delete-all-documents)",
)

args = parser.parse_args()
vespa_debug = VespaDebugging(args.tenant_id)

if args.action == "delete-all-documents":
vespa_debug.delete_documents_for_tenant(args.count)
if not args.tenant_id:
parser.error("--tenant-id is required for delete-all-documents action")
vespa_debug.delete_documents_for_tenant(count=args.count)
elif args.action == "config":
vespa_debug.print_config()
elif args.action == "connect":
Expand Down

0 comments on commit b70db15

Please sign in to comment.