SingleStore Managed Service

Enabling the HTTP API

SingleStore’s HTTP APIs are accessible via a built-in HTTP server. The HTTP API is disabled by default. To enable the HTTP API on your Managed Service cluster, you can reach out to the SingleStore support team or file a support ticket. When the HTTP API is enabled, it will be hosted on a port that is different from the SingleStore port.

Testing the HTTP API

After HTTP API is enabled, you can call the GET /ping API request to verify that the HTTP service is running and connectable. To perform this action using cURL, invoke a GET request to the /ping endpoint with no parameters, as shown below.

curl http://svc-10444e3f-afeb-46be-b186-a8c64b99f726-dml.aws-ireland-1.svc.singlestore.com/ping

If the HTTP API service is available and is able to respond to requests, you will receive the following response along with a 200 OK status code, indicating a successful HTTP response.

pong

If an error occurs, you will receive one of the HTTP response status codes listed here along with the error description in the response body. For more information, refer to the HTTP API Endpoint Reference.

The GET /ping request can only verify whether the HTTP service is running and connectable. To verify that the database can receive queries, use the /exec and /query endpoints as shown below.

The following cURL command invokes a POST API request to the /query/rows endpoint. (Note that you need to replace root:password in the HTTP request with your SingleStore username:password string.)

curl -H "Content-Type: application/json" --data '{"sql": "select 1+1"}' http://svc-10444e3f-afeb-46be-b186-a8c64b99f726-dml.aws-ireland-1.svc.singlestore.com/api/v1/query/rows

If the API call is successful, you should see the following results along with a 200 OK status line.

{"results":[{"rows":[{"1+1":2
}]}]}

If an error occurs, you will receive one of the HTTP response status codes listed here along with the error description in the response body. For more information, refer to the HTTP API Endpoint Reference.

If you format the JSON output with a formatting tool, the results would appear as follows. (Recommended JSON formatting tools: jq, JSONLint)

{
  "results": [
    {
      "rows": [
        {
          "1+1": 2
        }
      ]
    }
  ]
}

Note: The GET /ping request should be used in automated health checks. To verify specific health metrics, use the /exec and /query endpoints.