Pipeline can be use for debugging or production. If use for production, we recommend to document the expected parameters for each pipeline or do a wrapper endpoint

Pros:

  • Flexibility: Each pipeline can be compose of different stages, each stage with it's own configuration and reading different parameters
  • Hot Updates: Pipelines can be added/updated without restarting the server, when you call for a pipeline, it will check if a new version is available and load the latest
  • Errors Reported By Stage: If a stage throw an error, that error will be exposed in the response, under the name of the failed stage

Cons:

  • Needs Deep Knowledge: Since the stages of each pipeline, can expect different parameters, only the one who built it knows what expects

A solution for the Needs Deep Knowledge con, is to create wrapper endpoint, as it is the case of the Search Endpoint

Execute Pipeline

Use this endpoint to execute a specific pipeline with the provided parameters. It is a generic pipeline endpoint where you can choose the pipeline and pass the necessary parameters for execution. This endpoint is ideal for testing purposes.


It is recommended to create an endpoint wrapper for the pipeline with all parameters documented.

Path Parameters

ParameterTypeDescription
pipeline_namestringThe name of the pipeline to execute

Query Parameters

ParameterTypeDescription
excludearrayA list of keys to exclude from the final response.
includearrayA list of keys to include in the final response. If a key is not included, it will be omitted.

Body Parameters

ParameterTypeDescription
(parameters)objectBody parameters to be fed into the pipeline. The parameters vary depending on the specific pipeline. The creator of the pipeline is responsible for documenting these parameters.

Example

POST /es/api/v1/pipeline/execute/{pipeline_name}

{
  "param1": "value1",
  "param2": "value2"
}

Response

Successful Response [200]

{
  "stage1": "Something",
  "stage2": { ... }
}

Validation Error [422]

{
  "detail": [
    {
      "loc": ["body", "param1"],
      "msg": "Field required",
      "type": "value_error.missing"
    }
  ]
}

Execute UI Pipeline

 Use this endpoint to get the UI configuration of a specific pipeline. You can choose the pipeline by specifying the pipeline name. This endpoint is ideal for testing purposes.

Path Parameters

ParameterTypeDescription
pipeline_namestringThe name of the pipeline to execute

Query Parameters

ParameterTypeDescription
excludearrayA list of keys to exclude from the final response.
includearrayA list of keys to include in the final response. If a key is not included, it will be omitted.

Body Parameters

ParameterTypeDescription
(parameters)objectBody parameters to be fed into the pipeline. The parameters vary depending on the specific pipeline. The creator of the pipeline is responsible for documenting these parameters.


Example

POST /es/api/v1/pipeline/ui/{pipeline_name}

{
  "param1": "value1",
  "param2": "value2"
}

Response

Successful Response [200]

{
  "stage1": "Something",
  "stage2": { ... }
}

Validation Error [422]

{
  "detail": [
    {
      "loc": ["body", "param1"],
      "msg": "Field required",
      "type": "value_error.missing"
    }
  ]
}

Available Pipeline

Use this endpoint to get a list of all available pipelines.

Parameters

This endpoint does not require any parameters.


Example

GET /es/api/v1/pipeline

Response

Successful Response [200]

{
  "pipelines": [
    "search_metadata",
    "typeahead",
    "search"
  ]
}

Pipeline Stages

Use this endpoint to get the configuration of a pipeline, including the list of stages

Path Parameters

ParameterTypeDescription
pipeline_namestringThe name of the pipeline to execute

Example

GET /es/api/v1/pipeline/{pipeline_name}

Response

Successful Response [200]

{
  "enable": true,
  "stages": [
    {
      "type": "Stage",
      "enable": true,
      "name": "stage1"
    },
    {
      "type": "Stage",
      "enable": true,
      "name": "stage2"
    }, 
    {
      "type": "Stage",
      "enable": true,
      "name": "stage3"
    }, 
    {
      "type": "Stage",
      "enable": true,
      "name": "stage4"
    }
  ]
}

Validation Error [422]

{
  "detail": [
    {
      "loc": [
        "string",
        0
      ],
      "msg": "string",
      "type": "string"
    }
  ]
}