Endpoint¶
- class verta.endpoint.Endpoint(conn, conf, workspace, id)¶
Object representing an endpoint for deployment.
There should not be a need to instantiate this class directly; please use
Client.get_or_create_endpoint()
.New in version 0.19.0: The kafka_settings attribute.
- Variables:
id (int) – ID of this endpoint.
kafka_settings (
verta.endpoint.KafkaSettings
or None) – Kafka settings on this endpoint.path (str) – Path of this endpoint.
url (str) – Verta web app URL.
- create_access_token(token)¶
Create an access token for the endpoint.
- Parameters:
token (str) – Token to create.
- delete()¶
Delete this endpoint.
- get_access_token()¶
Get an arbitrary access token of the endpoint.
- Returns:
str or None
- get_access_tokens()¶
Return all existing tokens of the endpoint.
- Returns:
list of str
- get_current_build()¶
Retrieve the currently deployed build for this endpoint.
May return None if no build has been deployed to this endpoint.
- Returns:
Build
or None – A build object with an id and status.
- get_deployed_model(credentials=None)¶
Return an object for making predictions against the deployed model.
- Parameters:
credentials (
Credentials
, optional) – Authentication credentials to use with this deployed model. Credentials will be inferred from the environment if not explicitly provided.- Returns:
- Raises:
RuntimeError – If the model is not currently deployed.
- get_logs()¶
Get runtime logs of this endpoint.
- Returns:
list of str – Lines of this endpoint’s runtime logs.
- get_status()¶
Get status of the endpoint.
- Returns:
status (dict of str to {None, bool, float, int, str, list, dict})
- get_update_status()¶
Get update status on the endpoint.
- Returns:
update_status (dict of str to {None, bool, float, int, str, list, dict})
- property kafka_settings¶
Get the Kafka settings for this endpoint.
- property path¶
Get the HTTP path of this endpoint.
- update(model_reference, strategy=None, wait=False, resources=None, autoscaling=None, env_vars=None, kafka_settings=None)¶
Update the endpoint with a model logged in an Experiment Run or a Model Version.
New in version 0.19.0: The kafka_settings parameter.
- Parameters:
model_reference (
ExperimentRun
orRegisteredModelVersion
orBuild
) – An Experiment Run, Model Version with a model logged, or a Build.strategy (
update
, default DirectUpdateStrategy()) – Strategy (direct or canary) for updating the endpoint.wait (bool, default False) – Whether to wait for the endpoint to finish updating before returning.
resources (
Resources
, optional) – Resources allowed for the updated endpoint.autoscaling (
Autoscaling
, optional) – Autoscaling condition for the updated endpoint.env_vars (dict of str to str, optional) – Environment variables.
kafka_settings (
verta.endpoint.KafkaSettings
or False, optional) – Kafka settings. IfFalse
, clears this endpoint’s existing Kafka settings.
- Returns:
status (dict of str to {None, bool, float, int, str, list, dict})
- update_from_config(filepath, wait=False)¶
Update the endpoint via a YAML or JSON config file.
- Parameters:
- Returns:
status (dict of str to {None, bool, float, int, str, list, dict})
- Raises:
ValueError – If the file is not JSON or YAML.
- wait_for_build(polling_seconds=5, msg=None)¶
Poll the endpoint status API until a build completes successfully or with an error.