Qserv - how to delete a table via REST API

Hi

Looking to delete an empty table in an unpublished database

Ingest: 11.1.2.3. Delete a database or a table - Data Management - Confluence (lsstcorp.org)

Suggest something along the lines of

curl http://localhost:8080/ingest/database/test101/Object -X DELETE -H “Content-Type: application/json” -d ‘{“auth_key”:"###"}’

but this is returning 404 not found. So likely not getting the syntax right.

The REST services are running eg

curl http://localhost:8080/ingest/database/
=>
{“databases”:[{“family”:“layout_340_3”,“is_published”:0,“name”:“cosmoDC2_v1_1_4_image”},{“family”:“layout_340_3”,“is_published”:1,“name”:“dp01_dc2_catalogs”},{“family”:“layout_340_3”,“is_published”:0,“name”:“test101”}],“error”:"",“error_ext”:{},“success”:1}

Thanks
Mike

Dear Mike,

thank you for the report! There was a bug in my documentation. The correct name of the resource is:

/ingest/table/<database-name>/<table-name>

I have fixed the documentation.

Regards,
Igor

Dear Igor

Thanks, that’s got rid of the 404 error I now get other errors but I think something (qserv?) has gone offline.

Cheers
Mike

The error I got is

curl http://localhost:8080/ingest/table/test101/Object -X DELETE -H "Content-Type: application/json" -d '{"auth_key":"####"}'

after a few seconds

{“error”:“operation failed due to: Constructor failed mysql(-999 Error connecting to mysql with config:[host=qserv-czar, port=3306, user=root, password=XXXXXX, db=qservCssData, socket=]) [in function verify at core/modules/sql/SqlTransactionScope.cc:42]”,“error_ext”:{},“success”:0}[root@qserv-repl-ctl-0 qserv]#
]

EDIT

Turns out the above error was due to some services being unavailable at that time.

It’s connecting now and working with

{"error":"the director table can't be deleted from the un-published catalog w/o deleting the whole database.","error_ext":{},"success":0}

which is fair enough :slight_smile: