Harbors

Run Harbor Query

Changed on

Submits a query against the Harbor backing connection for asynchronous execution.

Use a scoped credential bound to this Harbor. The query runs only against the Harbor's backing connection; you cannot select another connection on this route. Send a unique X-Polytomic-Activity-Request-ID UUID with each submission. The X-Polytomic-Harbor-Session header is optional; if you send one, it must be valid for this Harbor.

The response contains a query ID and an initial created status. Poll GET /api/queries/{id} with that ID until the status is done, failed, or unknown. Follow the result endpoint's pagination links for additional rows. Results are temporary; check expires on the completed query.

post/api/harbors/{harbor_id}/query

Request

  • Base URL
    https://app.polytomic.com
  • Auth
    • HTTP bearer
    • or HTTP basic

Path parameters

harbor_idstring uuid required

Unique identifier of the Harbor whose backing connection runs the query

Example:248df4b7-aa70-47b8-a036-33ac447e668d

Headers

X-Polytomic-Versionstring
X-Polytomic-Harbor-Sessionstring

Harbor session token; when supplied, the session must be active and bound to this credential and Harbor.

X-Polytomic-Activity-Request-IDstring

New nonzero UUID for each request, required for scoped credentials; a reused value is rejected.

Request body

querystring required

SQL query to execute against the Harbor backing connection

Example request

{
  "query": "SELECT 1 AS n"
}

Response

OK

Example response

{
  "data": {
    "count": 10,
    "expires": "2021-01-01T00:00:00Z",
    "fields": [
      "name",
      "age"
    ],
    "id": "43d893ef-322b-47da-badb-3cf10d13a556"
  }
}

Changes

    • breaking

      the response's property type changed from object to no type for status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • warning

      removed the optional property / from the response with the status

    • info

      added to the response property allOf list for the response status

    • breaking

      the / response's property type changed from string to no type for status

    • info

      added to the / response property allOf list for the response status

    • info

      removed the created enum value from the / response property for the response status

    • info

      removed the done enum value from the / response property for the response status

    • info

      removed the failed enum value from the / response property for the response status

    • info

      removed the running enum value from the / response property for the response status

    • info

      removed the unknown enum value from the / response property for the response status