Connecting to GeoSpock database over HTTPS

You can connect to GeoSpock database over HTTPS and programmatically query your ingested data.

The examples in this documentation use cURL to send and receive requests to GeoSpock database; refer to the documentation for further guidance.

Submitting a query

Use the following request to submit a query:

curl -X POST -u <user>:<password> -H 'X-Presto-User: <presto_user>' -d '<query>' https://<hostname>:8446/v1/statement

Where:

  • <user> is your GeoSpock database username
  • <password> is the password for your GeoSpock database user acount
  • <presto_user> is the username you want to submit the query against
  • <hostname> is the hostname of the GeoSpock database; for example: sqlaccess.. So, for example, if your platform domain is geospock.example.com, set Database server to: sqlaccess.geospock.example.com
  • <query> is the SQL query you want to run

The response contains the status of your query, and the URI (nextUri) you should use for the next status update, for example:

https://<hostname>:8446/v1/statement/<query_id>/1

To get a status update for your query, use the following request:

curl -X GET -u <user>:<password> -H 'X-Presto-User: <presto_user>' https://<hostname>:8446/v1/statement/<query_id>/1

Once the query has completed, the data field of the response includes the query results.