Skip to main content

Model

View as Markdown

RegisteredModelInfo object

namestring

The name of the registered model

catalog_namestring

The name of the catalog where the schema and the registered model reside

schema_namestring

The name of the schema where the registered model resides

ownerstring

The identifier of the user who owns the registered model

commentstring

The comment attached to the registered model

Constraints: [ 1 .. 65536 ] characters

storage_locationstring

The storage location on the cloud under which model version data files are stored

metastore_idstring

The unique identifier of the metastore

full_namestring

The three-level (fully qualified) name of the registered model

created_atint64

Creation timestamp of the registered model in milliseconds since the Unix epoch

created_bystring

The identifier of the user who created the registered model

updated_atint64

Last-update timestamp of the registered model in milliseconds since the Unix epoch

updated_bystring

The identifier of the user who updated the registered model last time

aliasesarray of object

List of aliases associated with the registered model

Show child attributesHide child attributes
alias_namestring

Name of the alias, e.g. 'champion' or 'latest_stable'

version_numint64

Integer version number of the model version to which this alias points.

idstring

The unique identifier of the alias

model_namestring

The name of the parent registered model of the model version, relative to parent schema

catalog_namestring

The name of the catalog containing the model version

schema_namestring

The name of the schema containing the model version, relative to parent catalog

browse_onlyboolean

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.

Get GA

GET /api/2.1/unity-catalog/models/{full_name_arg}

Get a registered model.

The caller must be a metastore admin or an owner of (or have the EXECUTE privilege on) the registered model. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

API scopes: unity-catalog

Parameters

full_name_argstringRequiredpath

The three-level (fully qualified) name of the registered model

include_aliasesbooleanquery

Whether to include registered model aliases in the response

include_browsebooleanquery

Whether to include registered models in the response for which the principal can only access selective metadata for

Response

Returns the RegisteredModelInfo object.

List GA

GET /api/2.1/unity-catalog/models

List registered models. You can list registered models under a particular schema, or list all registered models in the current metastore.

The returned models are filtered based on the privileges of the calling user. For example, the metastore admin is able to list all the registered models. A regular user needs to be the owner or have the EXECUTE privilege on the registered model to receive the registered models in the response. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

There is no guarantee of a specific ordering of the elements in the response.

PAGINATION BEHAVIOR: The API is by default paginated, a page may contain zero results while still providing a next_page_token. Clients must continue reading pages until next_page_token is absent, which is the only indication that the end of results has been reached.

API scopes: unity-catalog

Parameters

catalog_namestringquery

The identifier of the catalog under which to list registered models. If specified, schema_name must be specified.

schema_namestringquery

The identifier of the schema under which to list registered models. If specified, catalog_name must be specified.

include_browsebooleanquery

Whether to include registered models in the response for which the principal can only access selective metadata for

max_resultsint64query

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;

Constraints: <= 100

page_tokenstringquery

Opaque token to send for the next page of results (pagination).

Response

Returns a list of RegisteredModelInfo objects.

Create GA

POST /api/2.1/unity-catalog/models

Creates a new registered model in Unity Catalog.

File storage for model versions in the registered model will be located in the default location which is specified by the parent schema, or the parent catalog, or the Metastore.

For registered model creation to succeed, the user must satisfy the following conditions:

  • The caller must be a metastore admin, or be the owner of the parent catalog and schema, or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.
  • The caller must have the CREATE MODEL or CREATE FUNCTION privilege on the parent schema.

API scopes: unity-catalog

Request body

namestring

The name of the registered model

catalog_namestring

The name of the catalog where the schema and the registered model reside

schema_namestring

The name of the schema where the registered model resides

ownerstring

The identifier of the user who owns the registered model

commentstring

The comment attached to the registered model

Constraints: [ 1 .. 65536 ] characters

storage_locationstring

The storage location on the cloud under which model version data files are stored

metastore_idstring

The unique identifier of the metastore

full_namestring

The three-level (fully qualified) name of the registered model

created_atint64

Creation timestamp of the registered model in milliseconds since the Unix epoch

created_bystring

The identifier of the user who created the registered model

updated_atint64

Last-update timestamp of the registered model in milliseconds since the Unix epoch

updated_bystring

The identifier of the user who updated the registered model last time

aliasesarray of object

List of aliases associated with the registered model

Show child attributesHide child attributes
alias_namestring

Name of the alias, e.g. 'champion' or 'latest_stable'

version_numint64

Integer version number of the model version to which this alias points.

idstring

The unique identifier of the alias

model_namestring

The name of the parent registered model of the model version, relative to parent schema

catalog_namestring

The name of the catalog containing the model version

schema_namestring

The name of the schema containing the model version, relative to parent catalog

browse_onlyboolean

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.

Response

Returns the RegisteredModelInfo object.

Update GA

PATCH /api/2.1/unity-catalog/models/{full_name_arg}

Updates the specified registered model.

The caller must be a metastore admin or an owner of the registered model. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

Currently only the name, the owner or the comment of the registered model can be updated.

API scopes: unity-catalog

Parameters

full_name_argstringRequiredpath

The three-level (fully qualified) name of the registered model

Request body

new_namestring

New name for the registered model.

namestring

The name of the registered model

catalog_namestring

The name of the catalog where the schema and the registered model reside

schema_namestring

The name of the schema where the registered model resides

ownerstring

The identifier of the user who owns the registered model

commentstring

The comment attached to the registered model

Constraints: [ 1 .. 65536 ] characters

storage_locationstring

The storage location on the cloud under which model version data files are stored

metastore_idstring

The unique identifier of the metastore

full_namestring

The three-level (fully qualified) name of the registered model

created_atint64

Creation timestamp of the registered model in milliseconds since the Unix epoch

created_bystring

The identifier of the user who created the registered model

updated_atint64

Last-update timestamp of the registered model in milliseconds since the Unix epoch

updated_bystring

The identifier of the user who updated the registered model last time

aliasesarray of object

List of aliases associated with the registered model

Show child attributesHide child attributes
alias_namestring

Name of the alias, e.g. 'champion' or 'latest_stable'

version_numint64

Integer version number of the model version to which this alias points.

idstring

The unique identifier of the alias

model_namestring

The name of the parent registered model of the model version, relative to parent schema

catalog_namestring

The name of the catalog containing the model version

schema_namestring

The name of the schema containing the model version, relative to parent catalog

browse_onlyboolean

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.

Response

Returns the RegisteredModelInfo object.

Delete GA

DELETE /api/2.1/unity-catalog/models/{full_name_arg}

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

The caller must be a metastore admin or an owner of the registered model. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

API scopes: unity-catalog

Parameters

full_name_argstringRequiredpath

The three-level (fully qualified) name of the registered model

Set Registered Model Alias GA

PUT /api/2.1/unity-catalog/models/{full_name_arg}/aliases/{alias_arg}

Set an alias on the specified registered model.

The caller must be a metastore admin or an owner of the registered model. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

API scopes: unity-catalog

Parameters

full_name_argstringRequiredpath

The three-level (fully qualified) name of the registered model

alias_argstringRequiredpath

The name of the alias

Request body

version_numint64Required

The version number of the model version to which the alias points

Response

alias_namestring

Name of the alias, e.g. 'champion' or 'latest_stable'

version_numint64

Integer version number of the model version to which this alias points.

idstring

The unique identifier of the alias

model_namestring

The name of the parent registered model of the model version, relative to parent schema

catalog_namestring

The name of the catalog containing the model version

schema_namestring

The name of the schema containing the model version, relative to parent catalog

Delete Registered Model Alias GA

DELETE /api/2.1/unity-catalog/models/{full_name_arg}/aliases/{alias_arg}

Deletes a registered model alias.

The caller must be a metastore admin or an owner of the registered model. For the latter case, the caller must also be the owner or have the USE_CATALOG privilege on the parent catalog and the USE_SCHEMA privilege on the parent schema.

API scopes: unity-catalog

Parameters

full_name_argstringRequiredpath

The three-level (fully qualified) name of the registered model

alias_argstringRequiredpath

The name of the alias