model_registry_webhooks
Creates, updates, deletes, gets or lists a model_registry_webhooks resource.
Overview
| Name | model_registry_webhooks |
| Type | Resource |
| Id | databricks_workspace.ml.model_registry_webhooks |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Webhook ID |
model_name | string | Name of the model whose events would trigger this webhook. |
creation_timestamp | integer | |
description | string | User-specified description for the webhook. |
events | array | Events 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_spec | object | |
job_spec | object | |
last_updated_timestamp | integer | Time of the object at last update, as a Unix timestamp in milliseconds. |
status | string | Enable 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | deployment_name | events, max_results, model_name, page_token | NOTE: This endpoint is in Public Preview. Lists all registry webhooks. |
create | insert | deployment_name, events | NOTE: This endpoint is in Public Preview. Creates a registry webhook. | |
update | update | deployment_name, id | NOTE: This endpoint is in Public Preview. Updates a registry webhook. | |
delete | exec | id, deployment_name | NOTE: This endpoint is in Public Preview. Deletes a registry webhook. | |
test | exec | deployment_name, id | NOTE: 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.
| Name | Datatype | Description |
|---|---|---|
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
id | string | Webhook ID required to delete a registry webhook. |
events | array | Events 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_results | integer | :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_name | string | |
page_token | string | Token indicating the page of artifact results to fetch |
SELECT examples
- list
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
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: model_registry_webhooks
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the model_registry_webhooks resource.
- name: events
value:
- "{{ events }}"
description: |
Events 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.
- name: description
value: "{{ description }}"
description: |
User-specified description for the webhook.
- name: http_url_spec
description: |
External HTTPS URL called on event trigger (by using a POST request).
value:
url: "{{ url }}"
authorization: "{{ authorization }}"
enable_ssl_verification: {{ enable_ssl_verification }}
secret: "{{ secret }}"
- name: job_spec
description: |
ID of the job that the webhook runs.
value:
job_id: "{{ job_id }}"
access_token: "{{ access_token }}"
workspace_url: "{{ workspace_url }}"
- name: model_name
value: "{{ model_name }}"
description: |
If model name is not specified, a registry-wide webhook is created that listens for the specified events across all versions of all registered models.
- name: status
value: "{{ status }}"
description: |
Enable or disable triggering the webhook, or put the webhook into test mode. The default is `ACTIVE`: * `ACTIVE`: Webhook is triggered when an associated event happens. * `DISABLED`: Webhook is not triggered. * `TEST_MODE`: Webhook can be triggered through the test endpoint, but is not triggered on a real event.
UPDATE examples
- update
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
- delete
- test
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
;
NOTE: This endpoint is in Public Preview. Tests a registry webhook.
EXEC databricks_workspace.ml.model_registry_webhooks.test
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"id": "{{ id }}",
"event": "{{ event }}"
}'
;