Skip to content
This repository has been archived by the owner on Dec 24, 2019. It is now read-only.

Latest commit

 

History

History
57 lines (38 loc) · 1.62 KB

indices_api.rst

File metadata and controls

57 lines (38 loc) · 1.62 KB

Index APIs

The Index API is used to manage individual indices.

Put Index API

The Create Index API is used to manually create an index in Cockatrice. The most basic usage is the following:

PUT /indices/<INDEX_NAME>?sync=<SYNC>&output=<OUTPUT>
---
schema:
  id:
    field_type: id
    args:
      unique: true
      stored: true
...
  • <INDEX_NAME>: The index name.
  • <SYNC>: Specifies whether to execute the command synchronously or asynchronously. If True is specified, command will execute synchronously. Default is False, command will execute asynchronously.
  • <OUTPUT>: The output format. json or yaml. Default is json.
  • Request Body: JSON or YAML formatted schema definition.

Get Index API

The Get Index API allows to retrieve information about the index. The most basic usage is the following:

GET /indices/<INDEX_NAME>?output=<OUTPUT>
  • <INDEX_NAME>: The index name.
  • <OUTPUT>: The output format. json or yaml. Default is json.

Delete Index API

The Delete Index API allows to delete an existing index. The most basic usage is the following:

DELETE /indices/<INDEX_NAME>?sync=<SYNC>&output=<OUTPUT>
  • <INDEX_NAME>: The index name.
  • <SYNC>: Specifies whether to execute the command synchronously or asynchronously. If True is specified, command will execute synchronously. Default is False, command will execute asynchronously.
  • <OUTPUT>: The output format. json or yaml. Default is json.