次の方法で共有


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:

  • total: int, default=10
  • allowed_methods: list, default=["HEAD", "GET", "POST", "PUT", "PATCH", "DELETE"]
  • status_forcelist: list, default=[429, 502, 503, 504]
  • backoff_factor: int, default=1
  • raise_on_status: bool, default=False
Default value: None
credential
<xref:sempy.fabric.TokenCredential>

The credential for token acquisition. Must be an instance of azure.core.credentials.TokenCredential. If None, the default credential will be used.

Default value: None

Methods

request

Request to the Fabric REST API.

request

Request to the Fabric REST API.

request(method: str, path_or_url: str, lro_wait: bool | None = False, lro_config: LroConfig | None = None, *args, **kwargs)

Parameters

Name Description
method
Required
str

HTTP method.

path_or_url
Required
str

The path or the url to the resource.

lro_wait

If True, waits for the long-running-operation to complete.

Default value: False
lro_config

Options to control LRO polling. See LroConfig.

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.