Skip to main content

models

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

Overview

Namemodels
TypeResource
Iddatabricks_workspace.machinelearning.models

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestring
user_idstring
creation_timestampinteger
descriptionstring
last_updated_timestampinteger
latest_versionsarray
tagsarray

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
searchmodelsselectdeployment_nameSearch for registered models based on the specified
listmodelsselectdeployment_nameLists all available registered models, up to the limit specified in
getmodelselectdeployment_nameGet the details of a model. This is a Databricks workspace version of the
createmodelinsertdeployment_nameCreates a new registered model with the name specified in the request body.
updatemodelupdatedeployment_nameUpdates a registered model.
deletemodeldeletedeployment_nameDeletes a registered model.
renamemodelexecdeployment_nameRenames a registered model.

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)

SELECT examples

Search for registered models based on the specified

SELECT
name,
user_id,
creation_timestamp,
description,
last_updated_timestamp,
latest_versions,
tags
FROM databricks_workspace.machinelearning.models
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new registered model with the name specified in the request body.

INSERT INTO databricks_workspace.machinelearning.models (
data__name,
data__description,
data__tags,
deployment_name
)
SELECT
'{{ name }}',
'{{ description }}',
'{{ tags }}',
'{{ deployment_name }}'
RETURNING
registered_model
;

UPDATE examples

Updates a registered model.

UPDATE databricks_workspace.machinelearning.models
SET
data__name = '{{ name }}',
data__description = '{{ description }}'
WHERE
deployment_name = '{{ deployment_name }}' --required;

DELETE examples

Deletes a registered model.

DELETE FROM databricks_workspace.machinelearning.models
WHERE deployment_name = '{{ deployment_name }}' --required;

Lifecycle Methods

Renames a registered model.

EXEC databricks_workspace.machinelearning.models.renamemodel 
@deployment_name='{{ deployment_name }}' --required
@@json=
'{
"name": "{{ name }}",
"new_name": "{{ new_name }}"
}';