Miscellaneous Cluster Management API Endpoints

Status Endpoint

The status endpoint can be used to check whether the node can be reached and which version it is running. This is useful as a smoke test after an update or as a health check to be used with service discovery tools such as Consul.

Description Check whether node can be reached and current version.
MethodGET /api/v1/status
Response Datastatus
Authentication Requiredno
Return Codes
200 Request complete
400 Bad authentication
500 Request failed
Show:
shell
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/status \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Example Responses
Show:
shell
{"status":"ok","version":"1.8.2--build-11362--sha-173241677d"}

The returned JSON has the following structure:

Table:

FieldTypeDescription
statusstring The node status
versionstring The current version of LogScale that the node is running

Missing Segments

If you end up in a situation where you have lost data/segment files, you need to remove these from Global.

Description Returns list of all missing segments in CSV format.
MethodGET /api/v1/missing-segments
Response Datamissing-segments
Authentication Requiredyes
Return Codes
200 Request complete
400 Bad authentication
500 Request failed

The missing segments API will list all segments that no longer exist. The format is line-based and each line specifies one missing segment. This format matches the input format of the Delete Missing Segments API.

Show:
shell
curl -v -X GET $YOUR_LOGSCALE_URL/api/v1/missing-segments \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"
Example Responses
Show:
shell
FWEClWu82dW46QqpOWFrGcUO SknGDKCcOScTxvkEEAMsgCvX KYneZu6juzjdsHbfH3YWn7YS 'developer' '@host=test_host@source=test_source@type=kv@' 1451606400000 1451606400000

The returned JSON has the following structure:

Table:

FieldTypeDescription
SegmentIdstring The segment ID
datasourceIdstring The datasource ID
dataspaceIdstring The dataspace ID
endUnixTimeMsinteger The UNIX end time in milliseconds
repositoryNamestring The repository name
startUnixTimeMsinteger The UNIX start time in milliseconds
tagStringstring The tag string

Delete Missing Segments

Description Remove missing segments from the cluster.  
MethodPOST /api/v1/delete-missing-segments 
Request Datamissing-segments 
Authentication Requiredyes 
Query ArgumentsDescriptionData typeRequired?
deleteAll Force deletion of all missing segments in the cluster. booleanoptional
 Supported Values  
 falseDelete missing segments according to the list of segments. 
 trueDelete all missing segments; segment list not required. 
ignoreErrors Force deletion of the bucket storage configuration booleanoptional
 Supported Values  
 falseDeletes only if not used in an active configuration 
 trueIgnore errors when deleting missing segments 
Return Codes 
200 Request complete  
400 Bad authentication  
500 Request failed  

This API uses the POST HTTP method.

You can supply a list of segments to delete, the format is the same as the output from Missing Segments, but note that empty lines are disallowed. Strictly speaking, only the first three fields on each line are needed; the rest will be ignored. If errors occur during the deletion process, they will be aborted.

You can provide the query parameter ignoreErrors=true (defaults to false). When using this, errors during the deletion process will be ignored.

You can provide the query parameter deleteAll=true (defaults to false). When using this, providing a list of segments will not be needed. All missing segments in the cluster will be deleted. This is a one-shot "command" that will clean up the system.

Show:
shell
curl -v -X DELETE $YOUR_LOGSCALE_URL/api/v1/delete-missing-segments \
    -H "Authorization: Bearer $TOKEN" \
    -H "Content-Type: application/json"

Example - explicit list, fail on error:

shell
$ curl -s https://$YOUR_LOGSCALE_URL/api/v1/delete-missing-segments \
  -d'FWEClWu82dW46QqpOWFrGcUO SknGDKCcOScTxvkEEAMsgCvX KYneZu6juzjdsHbfH3YWn7YS' \
  'developer' '@host=test_host@source=test_source@type=kv@' '1451606400000 1451606400000'

Example - explicit list, ignore errors:

shell
$ curl -s 'https://$YOUR_LOGSCALE_URL/api/v1/delete-missing-segments?ignoreErrors=true' \
  -d'FWEClWu82dW46QqpOWFrGcUO SknGDKCcOScTxvkEEAMsgCvX KYneZu6juzjdsHbfH3YWn7YS' \
  'developer' '@host=test_host@source=test_source@type=kv@' 1451606400000 1451606400000'

Example - delete all, ignore errors:

shell
$ curl -s -XPOST 'https://$YOUR_LOGSCALE_URL/api/v1/delete-missing-segments?ignoreErrors=true&deleteAll=true'