models
Operations on a models
resource.
Overview
Name | models |
Type | Resource |
Id | databricks_workspace.machinelearning.models |
Fields
Name | Datatype |
---|---|
name | string |
description | string |
creation_timestamp | integer |
last_updated_timestamp | integer |
latest_versions | array |
tags | array |
user_id | string |
Methods
Name | Accessible by | Required Params | Description |
---|---|---|---|
getmodel | SELECT | name, deployment_name | Get the details of a model. This is a Databricks workspace version of the |
listmodels | SELECT | deployment_name | Lists all available registered models, up to the limit specified in |
searchmodels | SELECT | deployment_name | Search for registered models based on the specified |
createmodel | INSERT | deployment_name | Creates a new registered model with the name specified in the request body. |
deletemodel | DELETE | name, deployment_name | Deletes a registered model. |
updatemodel | UPDATE | deployment_name | Updates a registered model. |
renamemodel | EXEC | deployment_name | Renames a registered model. |
SELECT
examples
- models (listmodels)
- models (searchmodels)
- models (getmodel)
SELECT
name,
description,
creation_timestamp,
last_updated_timestamp,
latest_versions,
tags,
user_id
FROM databricks_workspace.machinelearning.models
WHERE deployment_name = '{{ deployment_name }}';
SELECT
name,
description,
creation_timestamp,
last_updated_timestamp,
latest_versions,
tags,
user_id
FROM databricks_workspace.machinelearning.models
WHERE deployment_name = '{{ deployment_name }}';
SELECT
name,
description,
creation_timestamp,
last_updated_timestamp,
latest_versions,
tags,
user_id
FROM databricks_workspace.machinelearning.models
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';
INSERT
example
Use the following StackQL query and manifest file to create a new models
resource.
- models
- Manifest
/*+ create */
INSERT INTO databricks_workspace.machinelearning.models (
deployment_name,
data__name,
data__tags,
data__description
)
SELECT
'{{ deployment_name }}',
'{{ name }}',
'{{ tags }}',
'{{ description }}'
;
- name: your_resource_model_name
props:
- name: name
value: string
- name: tags
value:
- key: string
value: string
- name: description
value: string
UPDATE
example
Updates a models
resource.
/*+ update */
-- replace field1, field2, etc. with the fields you want to update
UPDATE databricks_workspace.machinelearning.models
SET field1 = '{{ value1 }}',
field2 = '{{ value2 }}', ...
WHERE deployment_name = '{{ deployment_name }}';
DELETE
example
Deletes a models
resource.
/*+ delete */
DELETE FROM databricks_workspace.machinelearning.models
WHERE name = '{{ name }}' AND
deployment_name = '{{ deployment_name }}';