-
Notifications
You must be signed in to change notification settings - Fork 3
Service: Virtual Corpus List (System Admin)
Lists virtual corpora by creator and type. This service is limited for system admins. If type is not specified, retrieves virtual corpora of all types. If createdBy is not specified, retrieves virtual corpora of all users.
This service requires admin authentication either by using the 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: full version
Method: POST
Service URL: root/admin/vc/list
Header Parameter
Name | Required | Authentication scheme | Value |
---|---|---|---|
Authorization | yes | Bearer | OAuth2 access token |
Basic (for testing only) | username and password encoded in Base64 | ||
Content-Type | yes | content type of the input data | application/x-www-form-urlencoded |
Query Parameters
Name | Required | Description | Type | Value |
---|---|---|---|---|
createdBy | no | virtual corpus creator | String | a username |
type | no | virtual corpus type | VirtualCorpusType | SYSTEM, PROJECT, PRIVATE, PUBLISHED |
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/admin/vc/list'
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/admin/vc/list'
Request with cURL
curl -v -H 'Content-Type: application/x-www-form-urlencoded' \
-H 'Authorization: Bearer f70p9lBCIufy_9LYEef2jQzJLlBMpc1egkv4dCBxcD3A'
-X POST \
'http://localhost:8089/api/v1.0/admin/vc/list?createdBy=dory&type=PROJECT'
Request with Basic authentication (for testing only)
curl -H 'Authorization: Basic YWRtaW46cGFzc3dvcmQ=' \
-X POST \
'http://localhost:8089/api/v1.0/admin/vc/list?createdBy=dory&type=PROJECT'
Output example:
[{
"id": 2,
"name": "group-vc",
"type": "project",
"status": "experimental",
"description": "test vc",
"requiredAccess": "PUB",
"createdBy": "dory",
"numberOfDoc": 4,
"numberOfParagraphs": 283,
"numberOfSentences": 14027,
"numberOfTokens": 386440,
"koralQuery": "{"collection": { "@type": "koral:docGroup", "operands":
[ { "@type": "koral:doc", "key": "corpusSigle", "match": "match:eq",
"value": "GOE" }, { "@type": "koral:doc", "key": "creationDate",
"match": "match:leq", "type": "type:date", "value": "1810" } ],
"operation": "operation:and" }}"
}]
- Importing Kustvakt to Eclipse
- Installing Lombok
- Setting annotation processors
- Setting test environment
- HTTP Basic Authentication
- OAuth2 authorization scopes
- OAuth2 authorization request
- OAuth2 token request
- OAuth2 token revocation
- OAuth2 client registration
- OAuth2 client info
- OAuth2 client deregistration
- OAuth2 client secret reset
- Plugin registration
- Plugin list (marketplace)
- Plugin installation
- Plugin uninstallation
- Installed plugin list
- VC creation and update
- VC deletion
- VC list
- VC info
- VC KoralQuery
- VC statistics
- VC statistics with KoralQuery