Skip to main content

registered_models

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

Overview

Nameregistered_models
TypeResource
Iddatabricks_workspace.unitycatalog.registered_models

Fields

The following fields are returned by SELECT queries:

Successfully retrieved the properties of the registered model

NameDatatypeDescription
idstring
namestring
metastore_idstring
catalog_namestring
full_namestring
schema_namestring
commentstring
created_atinteger
created_bystring
ownerstring
securable_kindstring
securable_typestring
storage_locationstring
updated_atinteger
updated_bystring

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectdeployment_nameGet a registered model.
listselectdeployment_nameList registered models. You can list registered models under a particular schema, or list all registered models in the current metastore.
createinsertdeployment_nameCreates a new registered model in Unity Catalog.
updateupdatedeployment_nameUpdates the specified registered model.
deletedeletedeployment_nameDeletes a registered model and all its model versions from the specified parent catalog and schema.

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

Get a registered model.

SELECT
id,
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
securable_kind,
securable_type,
storage_location,
updated_at,
updated_by
FROM databricks_workspace.unitycatalog.registered_models
WHERE deployment_name = '{{ deployment_name }}' -- required;

INSERT examples

Creates a new registered model in Unity Catalog.

INSERT INTO databricks_workspace.unitycatalog.registered_models (
data__catalog_name,
data__schema_name,
data__name,
data__storage_location,
data__comment,
deployment_name
)
SELECT
'{{ catalog_name }}',
'{{ schema_name }}',
'{{ name }}',
'{{ storage_location }}',
'{{ comment }}',
'{{ deployment_name }}'
RETURNING
id,
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
securable_kind,
securable_type,
storage_location,
updated_at,
updated_by
;

UPDATE examples

Updates the specified registered model.

UPDATE databricks_workspace.unitycatalog.registered_models
SET
data__owner = '{{ owner }}',
data__comment = '{{ comment }}',
data__new_name = '{{ new_name }}'
WHERE
deployment_name = '{{ deployment_name }}' --required
RETURNING
id,
name,
metastore_id,
catalog_name,
full_name,
schema_name,
comment,
created_at,
created_by,
owner,
securable_kind,
securable_type,
storage_location,
updated_at,
updated_by;

DELETE examples

Deletes a registered model and all its model versions from the specified parent catalog and schema.

DELETE FROM databricks_workspace.unitycatalog.registered_models
WHERE deployment_name = '{{ deployment_name }}' --required;