Dutch Analytics - Xenia documentation

UbiOps provides an extensive API. Take a look at our API reference.

Make a model or pipeline request via the API

Making a request to a model or pipeline via the API follow a similar process. The following text applies to both model as pipeline requests.

Before making a request, a Model or Pipeline should already have been created in the platform.

You need to provide the project name, model name and version or pipeline name for which the request will be made. There are 2 types of requests: direct and batch requests.
A direct request takes a single data point and keeps a connection open, after which the result is returned immediately. A batch request can take up to 250 data points (models) or 100 data points (pipelines), for which each of them, a separate request_id is returned with which the results can be retrieved at a later time.

  • Direct request is used to send one data point to the model. Available for models with both structured as plain input.
  • Batch request allows to send multiple data points to the model. Available for models with both structured as plain input.

To be able to make a model request, a model file should have been uploaded for the model version, which means the model version should be in active state.

  • Direct request is used to send one data point to the pipeline. Available for pipelines with both structured as plain input.
  • Batch request allows to send multiple data points to the pipeline. Available for pipeline with both structured as plain input.

In case of models/pipelines with structured input, you need to provide a JSON dictionary with the input fields of the model/pipeline as keys and the data as values. In case of batch request, you need to provide a list of dictionaries containing the input fields of the model/pipeline as keys and the data as values.
In case of plain models, a string is required that will be sent as-is to the model. In case of batch request, a list of string input is required.

Making a batch request to a model in UbiOps

📘

Making blob requests

If your model takes in a blob as input, you have to provide the id of the blob in the input.

Retrieve the request results via the API

The result of a direct request is always immediate, meaning that the result is returned as soon as its computed. If your model was idle before the request, this can take a bit longer than when the model was still active.


When you make a batch request, the following response is returned per data point:

[
  {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "pending",
    "time_created": "2020-07-24T09:51:15.360Z"
  }
]

The status of the request is always pending upon initialization and will later change into processing, failed or completed.

After making the request, you can collect the result of the request with the request id returned upon making the request. You can either collect the result of a single request or the results of multiple requests.

For the results of one batch request, you can use the GET model requests method. For the results of one batch request, the GET pipeline requests method may be used.


The following actions are also permitted for batch requests:
-Retrieve multiple batch model and pipeline requests: Retrieve the results of multiple batch requests in one call. This method takes in a list of the request id's.
-Delete multiple batch model and pipeline requests: Delete the multiple batch requests in one call. This method takes in a list of the request id's. All batch requests that were not yet 'completed' or 'failed' are terminated.
-List all batch model and pipeline requests: Give an overview of all batch requests for a model or pipeline. Selection and sorting options are available.
-Delete a single batch model and pipeline request: Delete a single batch request and terminate it.

Updated 4 days ago

API


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.