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. Experimental: This class is experimental and may change in future versions.

Inheritance
sempy.fabric._client._rest_client.BaseRestClient
FabricRestClient

Constructor

FabricRestClient(token_provider: TokenProvider | None = None)

Parameters

Name Description
token_provider
<xref:sempy.fabric.TokenProvider>

Implementation of TokenProvider that can provide auth token for access to the PowerBI workspace. Will attempt to acquire token from its execution environment if not provided.

Default value: None

Methods

get_paged

GET request to the Fabric REST API that handles pagination.

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
str

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.

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
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_max_attempts
int

The maximum number of attempts to wait for the long-running-operation to complete.

Default value: 10
lro_operation_name
str

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.