Connecting to GeoSpock database over HTTP
You can connect to GeoSpock database over HTTP 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
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
<user>is your GeoSpock database username
<password>is the password for your GeoSpock database user account
<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:
To get a status update for your query, use the following request:
curl -X GET -u <user>:<password> -H 'X-Presto-User: <presto_user>' <nextUri>
Once the query has completed, the data field of the response includes the query results.