FabricRestClient Class
REST client to access Fabric REST endpoints. Authentication tokens are automatically acquired from the execution environment.
All methods (get, post, ...) have an additional parameter lro_wait that can be set to True to wait for the long-running-operation to complete.
Note
This class is experimental and may be subject to change in future versions.
We recommend using only the functions listed below.
Use of any other functionality is discouraged and may lead to unexpected behavior.
Supported Functions
Resource
API
Example
Capacities
List Capacities
GET /v1/capacities
Workspaces
Create Workspace
POST /v1/workspaces
Workspaces
Delete Workspace
DELETE /v1/workspaces/{workspaceId}
Workspaces
Get Workspace
GET /v1/workspaces/{workspaceId}
Workspaces
List Workspace
GET /v1/workspaces
Items
List Items
GET /v1/workspaces/{workspaceId}/items
Items
Create Items
POST /v1/workspaces/{workspaceId}/items
Items
Delete Items
DELETE /v1/workspaces/{workspaceId}/items/{itemId}
Items
Get Items
GET /v1/workspaces/{workspaceId}/items/{itemId}
Long Running Operations
Get Operation Result
GET /v1/operations/{operationId}/result
Long Running Operations
Get Operation State
GET /v1/operations/{operationId}
PREVIEW* Folders
Create Folder
POST /v1/workspaces/{workspaceId}/folders
PREVIEW* Folders
Delete Folder
DELETE /v1/workspaces/{workspaceId}/folders/{folderId}
PREVIEW* Folders
Get Folder
GET /v1/workspaces/{workspaceId}/folders/{folderId}
PREVIEW* Folders
List Folder
GET /v1/workspaces/{workspaceId}/folders
PREVIEW* Folders
Move Folder
POST /v1/workspaces/{workspaceId}/folders/{folderId}/move
PREVIEW* Folders
Update Folder
PATCH /v1/workspaces/{workspaceId}/folders/{folderId}
Note
Resources labeled as PREVIEW are subject to change and may be updated or modified in future releases.
Constructor
FabricRestClient(token_provider: TokenProvider | None = None, retry_config: Dict | None = None, credential: TokenCredential | None = None)
Parameters
| Name | Description |
|---|---|
|
token_provider
|
<xref:sempy.fabric.TokenProvider>
DEPRECATED The 'token_provider' parameter is deprecated and will be removed in a future version. Please use 'credential' parameter with azure.core.credentials.TokenCredential implementations instead. Default value: None
|
|
retry_config
|
Configuration for the retry strategy. The following keys are filled with default values if not provided:
Default value: None
|
|
credential
|
<xref:sempy.fabric.TokenCredential>
The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, defaults to fabric.analytics.environment.credentials.FabricAnalyticsTokenCredentials. Default value: None
|
Methods
| get_paged |
GET request to the Fabric REST API that handles pagination. |
| get_paged_iterator |
GET request to the Fabric REST API that handles pagination with iteration. |
| request |
Request to the Fabric REST API. |
get_paged
GET request to the Fabric REST API that handles pagination.
get_paged(path_or_url: str, headers: Dict | None = None, *args, **kwargs) -> list
Parameters
| Name | Description |
|---|---|
|
path_or_url
Required
|
The relative path to the resource or the full url. If it's relative, the base URL is automatically prepended. |
|
headers
|
Headers to be included in the request. Default value: None
|
|
*args
Required
|
Arguments passed to the request method. |
|
**kwargs
Required
|
Arguments passed to the request method. |
Returns
| Type | Description |
|---|---|
|
The list of rows from the response. |
get_paged_iterator
GET request to the Fabric REST API that handles pagination with iteration.
get_paged_iterator(path_or_url: str, *args, **kwargs) -> Iterator[Any]
Parameters
| Name | Description |
|---|---|
|
path_or_url
Required
|
The relative path to the resource or the full url. If it's relative, the base URL is automatically prepended. |
|
*args
Required
|
Arguments passed to the request method. |
|
**kwargs
Required
|
Arguments passed to the request method. |
request
Request to the Fabric REST API.
request(method: str, path_or_url: str, lro_wait: bool | None = False, lro_max_attempts: int = 10, lro_operation_name: str | None = None, *args, **kwargs)
Parameters
| Name | Description |
|---|---|
|
method
Required
|
HTTP method. |
|
path_or_url
Required
|
The path or the url to the resource. |
|
lro_wait
|
If True, waits for the long-running-operation to complete. Default value: False
|
|
lro_max_attempts
|
The maximum number of attempts to wait for the long-running-operation to complete. Default value: 10
|
|
lro_operation_name
|
The name of the operation to wait for displayed via TQDM. Default value: None
|
|
*args
Required
|
Arguments passed to the request method. |
|
**kwargs
Required
|
Arguments passed to the request method. |
Returns
| Type | Description |
|---|---|
|
The response from the REST API. |