Skip to content

Service: Closing Index Reader

Nils Diewald edited this page Mar 9, 2023 · 6 revisions

** WARNING: This service is experimental and may change without any notice.

When a KorAP index is updated, the changes would not be taken into account until the index reader is reloaded (closed and re-opened). This service closes the index reader, and it will be automatically opened when the index is used next time. This service should be used only by system-admins. If the request is successful, HTTP Status 200 is returned.

This service requires admin authentication either by using Authorization header or including an admin token in the request body. At server starts-up, Kustvakt automatically generates an adminToken file at the root project folder, if it has not existed already.

Available in: lite and full version

Method: POST

Service URL: root/index/close

Parameters

Header Parameters

Name Required Description Value
Content-Type yes content type of the input data application/x-www-form-urlencoded
Authorization yes, if adminToken is not included in the request HTTP authentication with scheme: Bearer OAuth2 access token

Request body URL-encoded form parameters

Name Required Description Type
token yes The adminToken automatically generated by Kustvakt server in the root folder String

Examples

Request with admin token

Run the command on the root folder containing an adminToken file:

curl -v -H 'Content-Type: application/x-www-form-urlencoded' \
     -d @adminToken \
     http://localhost:8089/api/v1.0/index/close

or describe an adminToken explicitly in the command:

curl -v -H 'Content-Type: application/x-www-form-urlencoded'  \
     -d 'token=Rn8zb30nkqVlHd_Wxt2DpE' \
     http://localhost:8089/api/v1.0/index/close

Request with authorization header

curl -v -H 'Content-Type: application/x-www-form-urlencoded' \
     -H 'Authorization: Bearer f70p9lBCIufy_9LYEef2jQzJLlBMpc1egkv4dCBxcD3A' \
     -X POST \
     'http://localhost:8089/api/v1.0/index/close'

Advanced Setting

Developer Setting

Search services

Metadata services

Authentication and Authorization services

Client services

Super client services

Plugin services

User services

User group services

Virtual corpus services

Virtual corpus access services

Administrative services

Description services

Clone this wiki locally