model_registry_transitions
Creates, updates, deletes, gets or lists a model_registry_transitions resource.
Overview
| Name | model_registry_transitions |
| Type | Resource |
| Id | databricks_workspace.ml.model_registry_transitions |
Fields
The following fields are returned by SELECT queries:
- list
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the object. |
user_id | string | The username of the user that created the object. |
activity_type | string | Type of activity. Valid values are: * `APPLIED_TRANSITION`: User applied the corresponding stage<br />transition.<br /><br />* `REQUESTED_TRANSITION`: User requested the corresponding stage transition.<br /><br />* `CANCELLED_REQUEST`: User cancelled an existing transition request.<br /><br />* `APPROVED_REQUEST`: User approved the corresponding stage transition.<br /><br />* `REJECTED_REQUEST`: User rejected the coressponding stage transition.<br /><br />* `SYSTEM_TRANSITION`: For events performed as a side effect, such as archiving existing model<br />versions in a stage. (APPLIED_TRANSITION, APPROVED_REQUEST, CANCELLED_REQUEST, NEW_COMMENT, REJECTED_REQUEST, REQUESTED_TRANSITION, SYSTEM_TRANSITION) |
comment | string | User-provided comment associated with the activity, comment, or transition request. |
creation_timestamp | integer | Creation time of the object, as a Unix timestamp in milliseconds. |
from_stage | string | Source stage of the transition (if the activity is stage transition related). Valid values are: * `None`: The initial stage of a model version. * `Staging`: Staging or pre-production stage. * `Production`: Production stage. * `Archived`: Archived stage. |
last_updated_timestamp | integer | Time of the object at last update, as a Unix timestamp in milliseconds. |
system_comment | string | Comment made by system, for example explaining an activity of type `SYSTEM_TRANSITION`. It usually describes a side effect, such as a version being archived as part of another version's stage transition, and may not be returned for some activity types. |
to_stage | string | Target stage of the transition (if the activity is stage transition related). Valid values are: * `None`: The initial stage of a model version. * `Staging`: Staging or pre-production stage. * `Production`: Production stage. * `Archived`: Archived stage. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
list | select | name, version, deployment_name | Gets a list of all open stage transition requests for the model version. | |
create | insert | deployment_name, name, version, stage | Creates a model version stage transition request. | |
approve | exec | deployment_name, name, version, stage, archive_existing_versions | Approves a model version stage transition request. | |
delete | exec | name, version, stage, creator, deployment_name | comment | Cancels a model version stage transition request. |
reject | exec | deployment_name, name, version, stage | Rejects a model version stage transition request. | |
transition | exec | deployment_name, name, version, stage, archive_existing_versions | Transition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint] |
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 |
|---|---|---|
creator | string | Username of the user who created this request. Of the transition requests matching the specified details, only the one transition created by this user will be deleted. |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
name | string | Name of the model. |
stage | string | Target stage of the transition request. Valid values are: * None: The initial stage of a model version. * Staging: Staging or pre-production stage. * Production: Production stage. * Archived: Archived stage. |
version | string | Version of the model. |
comment | string | User-provided comment on the action. |
SELECT examples
- list
Gets a list of all open stage transition requests for the model version.
SELECT
id,
user_id,
activity_type,
comment,
creation_timestamp,
from_stage,
last_updated_timestamp,
system_comment,
to_stage
FROM databricks_workspace.ml.model_registry_transitions
WHERE name = '{{ name }}' -- required
AND version = '{{ version }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
;
INSERT examples
- create
- Manifest
Creates a model version stage transition request.
INSERT INTO databricks_workspace.ml.model_registry_transitions (
name,
version,
stage,
comment,
deployment_name
)
SELECT
'{{ name }}' /* required */,
'{{ version }}' /* required */,
'{{ stage }}' /* required */,
'{{ comment }}',
'{{ deployment_name }}'
RETURNING
request
;
# Description fields are for documentation purposes
- name: model_registry_transitions
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the model_registry_transitions resource.
- name: name
value: "{{ name }}"
description: |
Name of the model.
- name: version
value: "{{ version }}"
description: |
Version of the model.
- name: stage
value: "{{ stage }}"
description: |
Target stage of the transition. Valid values are: * `None`: The initial stage of a model version. * `Staging`: Staging or pre-production stage. * `Production`: Production stage. * `Archived`: Archived stage.
- name: comment
value: "{{ comment }}"
description: |
User-provided comment on the action.
Lifecycle Methods
- approve
- delete
- reject
- transition
Approves a model version stage transition request.
EXEC databricks_workspace.ml.model_registry_transitions.approve
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"name": "{{ name }}",
"version": "{{ version }}",
"stage": "{{ stage }}",
"archive_existing_versions": {{ archive_existing_versions }},
"comment": "{{ comment }}"
}'
;
Cancels a model version stage transition request.
EXEC databricks_workspace.ml.model_registry_transitions.delete
@name='{{ name }}' --required,
@version='{{ version }}' --required,
@stage='{{ stage }}' --required,
@creator='{{ creator }}' --required,
@deployment_name='{{ deployment_name }}' --required,
@comment='{{ comment }}'
;
Rejects a model version stage transition request.
EXEC databricks_workspace.ml.model_registry_transitions.reject
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"name": "{{ name }}",
"version": "{{ version }}",
"stage": "{{ stage }}",
"comment": "{{ comment }}"
}'
;
Transition a model version's stage. This is a Databricks workspace version of the [MLflow endpoint]
EXEC databricks_workspace.ml.model_registry_transitions.transition
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"name": "{{ name }}",
"version": "{{ version }}",
"stage": "{{ stage }}",
"archive_existing_versions": {{ archive_existing_versions }},
"comment": "{{ comment }}"
}'
;