-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy pathfab_api_catalog.py
More file actions
47 lines (35 loc) · 1.64 KB
/
fab_api_catalog.py
File metadata and controls
47 lines (35 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""Catalog API client for searching Fabric items across workspaces.
API Reference: POST https://api.fabric.microsoft.com/v1/catalog/search
Required Scope: Catalog.Read.All
"""
from argparse import Namespace
from fabric_cli.client import fab_api_client as fabric_api
from fabric_cli.client.fab_api_types import ApiResponse
def search(args: Namespace, payload: dict) -> ApiResponse:
"""Search the Fabric catalog for items.
https://learn.microsoft.com/en-us/rest/api/fabric/core/catalog/search
Args:
args: Namespace with request configuration
payload: Dict with search request body:
- search (required): Text to search across displayName, description, workspaceName
- pageSize: Number of results per page
- continuationToken: Token for pagination
- filter: OData filter string, e.g., "Type eq 'Report' or Type eq 'Lakehouse'"
Returns:
ApiResponse with search results containing:
- value: List of ItemCatalogEntry objects
- continuationToken: Token for next page (if more results exist)
Note:
The following item types are NOT searchable via this API:
Dashboard
Note: Dataflow Gen1 and Gen2 are currently not searchable; only Dataflow Gen2
CI/CD items are returned (as type 'Dataflow').
Scorecards are returned as type 'Report'.
"""
args.uri = "catalog/search"
args.method = "post"
# raw_response=True so we handle pagination ourselves in fab_find
args.raw_response = True
return fabric_api.do_request(args, json=payload)