Querying an endpoint
Once the endpoint has finished updating:
endpoint.update(model_version, strategy, wait=True)
Users can make queries to it. This tutorial will explore several ways to do this, using the client and CLI.

Using the client

Given an endpoint (which has a model deployed to it), we can make queries as follows:
deployed_model = endpoint.get_deployed_model()
results = deployed_model.predict(test_data)
We can also make queries via cURL requests. An example request is given in the string representation of the endpoint object:
# This should print out similar to:
# path: <some-path>
# id: <some-id>
# curl: curl -X POST <prediction-url> -d '' -H "Content-Type: application/json"
# ...

Endpoint metadata

Endpoint query responses will contain metadata about the endpoint configuration in the response headers. For example:
$ curl -H "Access-token: a1b2c3d4-e5f6-a7b8-c9d0-e1f2a3b4c5d6" -X POST -d '""' -H "Content-Type: application/json" -i
HTTP/2 200
date: Tue, 02 Nov 2021 00:17:08 GMT
content-type: application/json,application/json
content-length: 90
verta-endpoint-owner-name: myuser_name
verta-endpoint-path: /my-endpoint
verta-model-name: my-model
verta-model-version: v2
These are the headers currently provided:
  • verta-endpoint-path: The URI path configured for the endpoint
  • verta-model-name: The registered model being executed by the queried endpoint
  • verta-model-version: The version of the registered model being executed by the queried endpoint
  • verta-endpoint-owner-name: The name of the owner of the endpoint
Copy link
On this page
Using the client
Endpoint metadata