API Get Metadata Registerd Models

vinhdv4
New Contributor

Hi all,

I has been call DBX API for get all metadata model
My user have no EXECUTE privileges on registered model, it only have USE CATALOG / USE SCHEMA  on parent catalog/schema
I still can get all metadata of Model

Here is my python code for call API:
___

import json
from databricks.sdk import WorkspaceClient
w = WorkspaceClient()
list_models = w.registered_models.list(
    catalog_name="system",
    schema_name="ai",
    include_browse=True)
i=0
for model in list_models:
    print(json.dumps(model.as_dict(), indent=4, ensure_ascii=False))
    i+=1
print(i)
___


But this documentation required EXECUTE privilege on the registered model (https://docs.databricks.com/api/workspace/registeredmodels/list)

Can anyone explain for me, please? T___T

nick_martinek
New Contributor

include_browse=True does not mean that USE CATALOG + USE SCHEMA are enough to list registered models.

What actually happens is:

With only USE CATALOG and USE SCHEMA:
include_browse=False → 0 models
include_browse=True → 0 models
After granting BROWSE on the catalog:
include_browse=False → 0 models
include_browse=True → models are returned

So include_browse=True includes models that are visible through the Unity Catalog BROWSE privilege, even when the principal does not have EXECUTE on the registered model.

In other words, EXECUTE is still required for normal access to the model, while BROWSE allows discovery / limited metadata visibility.

That explains why the API can return model metadata without EXECUTE when include_browse=True.

I hope that helps 🙂