registered_models
Creates, updates, deletes, gets or lists a registered_models resource.
Overview
| Name | registered_models |
| Type | Resource |
| Id | databricks_workspace.catalog.registered_models |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the registered model |
metastore_id | string | The unique identifier of the metastore |
catalog_name | string | The name of the catalog where the schema and the registered model reside |
full_name | string | The three-level (fully qualified) name of the registered model |
schema_name | string | The name of the schema where the registered model resides |
aliases | array | |
browse_only | boolean | Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. |
comment | string | The comment attached to the registered model |
created_at | integer | Creation timestamp of the registered model in milliseconds since the Unix epoch |
created_by | string | The identifier of the user who created the registered model |
owner | string | The identifier of the user who owns the registered model |
storage_location | string | The storage location on the cloud under which model version data files are stored |
updated_at | integer | Last-update timestamp of the registered model in milliseconds since the Unix epoch |
updated_by | string | The identifier of the user who updated the registered model last time |
| Name | Datatype | Description |
|---|---|---|
name | string | The name of the registered model |
metastore_id | string | The unique identifier of the metastore |
catalog_name | string | The name of the catalog where the schema and the registered model reside |
full_name | string | The three-level (fully qualified) name of the registered model |
schema_name | string | The name of the schema where the registered model resides |
aliases | array | |
browse_only | boolean | Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request. |
comment | string | The comment attached to the registered model |
created_at | integer | Creation timestamp of the registered model in milliseconds since the Unix epoch |
created_by | string | The identifier of the user who created the registered model |
owner | string | The identifier of the user who owns the registered model |
storage_location | string | The storage location on the cloud under which model version data files are stored |
updated_at | integer | Last-update timestamp of the registered model in milliseconds since the Unix epoch |
updated_by | string | The identifier of the user who updated the registered model last time |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | full_name, deployment_name | include_aliases, include_browse | Get a registered model. |
list | select | deployment_name | catalog_name, include_browse, max_results, page_token, schema_name | List registered models. You can list registered models under a particular schema, or list all |
create | insert | deployment_name | Creates a new registered model in Unity Catalog. | |
update | update | full_name, deployment_name | Updates the specified registered model. | |
set_alias | replace | full_name, alias, deployment_name, version_num | Set an alias on the specified registered model. | |
delete_alias | delete | full_name, alias, deployment_name | Deletes a registered model alias. | |
delete | delete | full_name, deployment_name | Deletes 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.
| Name | Datatype | Description |
|---|---|---|
alias | string | The name of the alias |
deployment_name | string | The Databricks Workspace Deployment Name (default: dbc-abcd0123-a1bc) |
full_name | string | The three-level (fully qualified) name of the registered model |
catalog_name | string | The identifier of the catalog under which to list registered models. If specified, schema_name must be specified. |
include_aliases | boolean | Whether to include registered model aliases in the response |
include_browse | boolean | Whether to include registered models in the response for which the principal can only access selective metadata for |
max_results | integer | Max 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_token | string | Opaque token to send for the next page of results (pagination). |
schema_name | string | The identifier of the schema under which to list registered models. If specified, catalog_name must be specified. |
SELECT examples
- get
- list
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 }}'
;
List registered models. You can list registered models under a particular schema, or list all
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 deployment_name = '{{ deployment_name }}' -- required
AND catalog_name = '{{ catalog_name }}'
AND include_browse = '{{ include_browse }}'
AND max_results = '{{ max_results }}'
AND page_token = '{{ page_token }}'
AND schema_name = '{{ schema_name }}'
;
INSERT examples
- create
- Manifest
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
;
# Description fields are for documentation purposes
- name: registered_models
props:
- name: deployment_name
value: "{{ deployment_name }}"
description: Required parameter for the registered_models resource.
- name: aliases
description: |
List of aliases associated with the registered model
value:
- alias_name: "{{ alias_name }}"
catalog_name: "{{ catalog_name }}"
id: "{{ id }}"
model_name: "{{ model_name }}"
schema_name: "{{ schema_name }}"
version_num: {{ version_num }}
- name: browse_only
value: {{ browse_only }}
description: |
Indicates whether the principal is limited to retrieving metadata for the associated object through the BROWSE privilege when include_browse is enabled in the request.
- name: catalog_name
value: "{{ catalog_name }}"
description: |
The name of the catalog where the schema and the registered model reside
- name: comment
value: "{{ comment }}"
description: |
The comment attached to the registered model
- name: created_at
value: {{ created_at }}
description: |
Creation timestamp of the registered model in milliseconds since the Unix epoch
- name: created_by
value: "{{ created_by }}"
description: |
The identifier of the user who created the registered model
- name: full_name
value: "{{ full_name }}"
description: |
The three-level (fully qualified) name of the registered model
- name: metastore_id
value: "{{ metastore_id }}"
description: |
The unique identifier of the metastore
- name: name
value: "{{ name }}"
description: |
The name of the registered model
- name: owner
value: "{{ owner }}"
description: |
The identifier of the user who owns the registered model
- name: schema_name
value: "{{ schema_name }}"
description: |
The name of the schema where the registered model resides
- name: storage_location
value: "{{ storage_location }}"
description: |
The storage location on the cloud under which model version data files are stored
- name: updated_at
value: {{ updated_at }}
description: |
Last-update timestamp of the registered model in milliseconds since the Unix epoch
- name: updated_by
value: "{{ updated_by }}"
description: |
The identifier of the user who updated the registered model last time
UPDATE examples
- update
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_alias
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
- delete_alias
- delete
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
;
Deletes a registered model and all its model versions from the specified parent catalog and schema.
DELETE FROM databricks_workspace.catalog.registered_models
WHERE full_name = '{{ full_name }}' --required
AND deployment_name = '{{ deployment_name }}' --required
;