Skip to main content

model_registry_webhooks

Creates, updates, deletes, gets or lists a model_registry_webhooks resource.

Overview

Namemodel_registry_webhooks
TypeResource
Iddatabricks_workspace.ml.model_registry_webhooks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringWebhook ID
model_namestringName of the model whose events would trigger this webhook.
creation_timestampinteger
descriptionstringUser-specified description for the webhook.
eventsarrayEvents that can trigger a registry webhook: * `MODEL_VERSION_CREATED`: A new model version was created for the associated model. * `MODEL_VERSION_TRANSITIONED_STAGE`: A model version’s stage was changed. * `TRANSITION_REQUEST_CREATED`: A user requested a model version’s stage be transitioned. * `COMMENT_CREATED`: A user wrote a comment on a registered model. * `REGISTERED_MODEL_CREATED`: A new registered model was created. This event type can only be specified for a registry-wide webhook, which can be created by not specifying a model name in the create request. * `MODEL_VERSION_TAG_SET`: A user set a tag on the model version. * `MODEL_VERSION_TRANSITIONED_TO_STAGING`: A model version was transitioned to staging. * `MODEL_VERSION_TRANSITIONED_TO_PRODUCTION`: A model version was transitioned to production. * `MODEL_VERSION_TRANSITIONED_TO_ARCHIVED`: A model version was archived. * `TRANSITION_REQUEST_TO_STAGING_CREATED`: A user requested a model version be transitioned to staging. * `TRANSITION_REQUEST_TO_PRODUCTION_CREATED`: A user requested a model version be transitioned to production. * `TRANSITION_REQUEST_TO_ARCHIVED_CREATED`: A user requested a model version be archived.
http_url_specobject
job_specobject
last_updated_timestampintegerTime of the object at last update, as a Unix timestamp in milliseconds.
statusstringEnable or disable triggering the webhook, or put the webhook into test mode. The default is<br />`ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens.<br /><br />* `DISABLED`: Webhook is not triggered.<br /><br />* `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a<br />real event. (ACTIVE, DISABLED, TEST_MODE)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
listselectdeployment_nameevents, max_results, model_name, page_tokenNOTE: This endpoint is in Public Preview. Lists all registry webhooks.
createinsertdeployment_name, eventsNOTE: This endpoint is in Public Preview. Creates a registry webhook.
updateupdatedeployment_name, idNOTE: This endpoint is in Public Preview. Updates a registry webhook.
deleteexecid, deployment_nameNOTE: This endpoint is in Public Preview. Deletes a registry webhook.
testexecdeployment_name, idNOTE: This endpoint is in Public Preview. Tests a registry webhook.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
idstringWebhook ID required to delete a registry webhook.
eventsarrayEvents that trigger the webhook. * MODEL_VERSION_CREATED: A new model version was created for the associated model. * MODEL_VERSION_TRANSITIONED_STAGE: A model version’s stage was changed. * TRANSITION_REQUEST_CREATED: A user requested a model version’s stage be transitioned. * COMMENT_CREATED: A user wrote a comment on a registered model. * REGISTERED_MODEL_CREATED: A new registered model was created. This event type can only be specified for a registry-wide webhook, which can be created by not specifying a model name in the create request. * MODEL_VERSION_TAG_SET: A user set a tag on the model version. * MODEL_VERSION_TRANSITIONED_TO_STAGING: A model version was transitioned to staging. * MODEL_VERSION_TRANSITIONED_TO_PRODUCTION: A model version was transitioned to production. * MODEL_VERSION_TRANSITIONED_TO_ARCHIVED: A model version was archived. * TRANSITION_REQUEST_TO_STAGING_CREATED: A user requested a model version be transitioned to staging. * TRANSITION_REQUEST_TO_PRODUCTION_CREATED: A user requested a model version be transitioned to production. * TRANSITION_REQUEST_TO_ARCHIVED_CREATED: A user requested a model version be archived. If events is specified, any webhook with one or more of the specified trigger events is included in the output. If events is not specified, webhooks of all event types are included in the output.
max_resultsinteger:param model_name: str (optional) Registered model name If not specified, all webhooks associated with the specified events are listed, regardless of their associated model.
model_namestring
page_tokenstringToken indicating the page of artifact results to fetch

SELECT examples

NOTE: This endpoint is in Public Preview. Lists all registry webhooks.

SELECT
id,
model_name,
creation_timestamp,
description,
events,
http_url_spec,
job_spec,
last_updated_timestamp,
status
FROM databricks_workspace.ml.model_registry_webhooks
WHERE deployment_name = '{{ deployment_name }}' -- required
AND events = '{{ events }}'
AND max_results = '{{ max_results }}'
AND model_name = '{{ model_name }}'
AND page_token = '{{ page_token }}'
;

INSERT examples

NOTE: This endpoint is in Public Preview. Creates a registry webhook.

INSERT INTO databricks_workspace.ml.model_registry_webhooks (
events,
description,
http_url_spec,
job_spec,
model_name,
status,
deployment_name
)
SELECT
'{{ events }}' /* required */,
'{{ description }}',
'{{ http_url_spec }}',
'{{ job_spec }}',
'{{ model_name }}',
'{{ status }}',
'{{ deployment_name }}'
RETURNING
webhook
;

UPDATE examples

NOTE: This endpoint is in Public Preview. Updates a registry webhook.

UPDATE databricks_workspace.ml.model_registry_webhooks
SET
id = '{{ id }}',
description = '{{ description }}',
events = '{{ events }}',
http_url_spec = '{{ http_url_spec }}',
job_spec = '{{ job_spec }}',
status = '{{ status }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
AND id = '{{ id }}' --required
RETURNING
webhook;

Lifecycle Methods

NOTE: This endpoint is in Public Preview. Deletes a registry webhook.

EXEC databricks_workspace.ml.model_registry_webhooks.delete 
@id='{{ id }}' --required,
@deployment_name='{{ deployment_name }}' --required
;