Skip to main content

registered_models

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

Overview

Nameregistered_models
TypeResource
Iddatabricks_workspace.catalog.registered_models

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe name of the registered model
metastore_idstringThe unique identifier of the metastore
catalog_namestringThe name of the catalog where the schema and the registered model reside
full_namestringThe three-level (fully qualified) name of the registered model
schema_namestringThe name of the schema where the registered model resides
aliasesarray
browse_onlybooleanIndicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.
commentstringThe comment attached to the registered model
created_atintegerCreation timestamp of the registered model in milliseconds since the Unix epoch
created_bystringThe identifier of the user who created the registered model
ownerstringThe identifier of the user who owns the registered model
storage_locationstringThe storage location on the cloud under which model version data files are stored
updated_atintegerLast-update timestamp of the registered model in milliseconds since the Unix epoch
updated_bystringThe identifier of the user who updated the registered model last time

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectfull_name, deployment_nameinclude_aliases, include_browseGet a registered model.
listselectdeployment_namecatalog_name, include_browse, max_results, page_token, schema_nameList registered models. You can list registered models under a particular schema, or list all
createinsertdeployment_nameCreates a new registered model in Unity Catalog.
updateupdatefull_name, deployment_nameUpdates the specified registered model.
set_aliasreplacefull_name, alias, deployment_name, version_numSet an alias on the specified registered model.
delete_aliasdeletefull_name, alias, deployment_nameDeletes a registered model alias.
deletedeletefull_name, deployment_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
aliasstringThe name of the alias
deployment_namestringThe Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc)
full_namestringThe three-level (fully qualified) name of the registered model
catalog_namestringThe identifier of the catalog under which to list registered models. If specified, schema_name must be specified.
include_aliasesbooleanWhether to include registered model aliases in the response
include_browsebooleanWhether to include registered models in the response for which the principal can only access selective metadata for
max_resultsintegerMax number of registered models to return. If both catalog and schema are specified: - when max_results is not specified, the page length is set to a server configured value (10000, as of 4/2/2024). - when set to a value greater than 0, the page length is the minimum of this value and a server configured value (10000, as of 4/2/2024); - when set to 0, the page length is set to a server configured value (10000, as of 4/2/2024); - when set to a value less than 0, an invalid parameter error is returned; If neither schema nor catalog is specified: - when max_results is not specified, the page length is set to a server configured value (100, as of 4/2/2024). - when set to a value greater than 0, the page length is the minimum of this value and a server configured value (1000, as of 4/2/2024); - when set to 0, the page length is set to a server configured value (100, as of 4/2/2024); - when set to a value less than 0, an invalid parameter error is returned;
page_tokenstringOpaque token to send for the next page of results (pagination).
schema_namestringThe identifier of the schema under which to list registered models. If specified, catalog_name must be specified.

SELECT examples

Get a registered model.

SELECT
name,
metastore_id,
catalog_name,
full_name,
schema_name,
aliases,
browse_only,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by
FROM databricks_workspace.catalog.registered_models
WHERE full_name = '{{ full_name }}' -- required
AND deployment_name = '{{ deployment_name }}' -- required
AND include_aliases = '{{ include_aliases }}'
AND include_browse = '{{ include_browse }}'
;

INSERT examples

Creates a new registered model in Unity Catalog.

INSERT INTO databricks_workspace.catalog.registered_models (
aliases,
browse_only,
catalog_name,
comment,
created_at,
created_by,
full_name,
metastore_id,
name,
owner,
schema_name,
storage_location,
updated_at,
updated_by,
deployment_name
)
SELECT
'{{ aliases }}',
{{ browse_only }},
'{{ catalog_name }}',
'{{ comment }}',
{{ created_at }},
'{{ created_by }}',
'{{ full_name }}',
'{{ metastore_id }}',
'{{ name }}',
'{{ owner }}',
'{{ schema_name }}',
'{{ storage_location }}',
{{ updated_at }},
'{{ updated_by }}',
'{{ deployment_name }}'
RETURNING
name,
metastore_id,
catalog_name,
full_name,
schema_name,
aliases,
browse_only,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by
;

UPDATE examples

Updates the specified registered model.

UPDATE databricks_workspace.catalog.registered_models
SET
aliases = '{{ aliases }}',
browse_only = {{ browse_only }},
catalog_name = '{{ catalog_name }}',
comment = '{{ comment }}',
created_at = {{ created_at }},
created_by = '{{ created_by }}',
metastore_id = '{{ metastore_id }}',
name = '{{ name }}',
new_name = '{{ new_name }}',
owner = '{{ owner }}',
schema_name = '{{ schema_name }}',
storage_location = '{{ storage_location }}',
updated_at = {{ updated_at }},
updated_by = '{{ updated_by }}'
WHERE
full_name = '{{ full_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
RETURNING
name,
metastore_id,
catalog_name,
full_name,
schema_name,
aliases,
browse_only,
comment,
created_at,
created_by,
owner,
storage_location,
updated_at,
updated_by;

REPLACE examples

Set an alias on the specified registered model.

REPLACE databricks_workspace.catalog.registered_models
SET
version_num = {{ version_num }}
WHERE
full_name = '{{ full_name }}' --required
AND alias = '{{ alias }}' --required
AND deployment_name = '{{ deployment_name }}' --required
AND version_num = '{{ version_num }}' --required
RETURNING
id,
alias_name,
catalog_name,
model_name,
schema_name,
version_num;

DELETE examples

Deletes a registered model alias.

DELETE FROM databricks_workspace.catalog.registered_models
WHERE full_name = '{{ full_name }}' --required
AND alias = '{{ alias }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;