Skip to main content

easyfabric.fabric.rest_api

REST API utilities for interacting with Microsoft Fabric APIs.

requests

MSG_REST_ACCESS_TOKEN_MISSING

MSG_REST_CONFIG_AUTOHINT_FAIL

MSG_REST_KV_SECRET_FAIL

MSG_REST_NOTEBOOK_TOKEN_FAIL

MSG_REST_PRINCIPAL_TOKEN_FAIL

MSG_REST_SQL_ENDPOINT_NOT_FOUND

MSG_REST_SQL_REFRESH_SKIP

MSG_REST_SQL_REFRESH_TRIGGERED

MSG_REST_WORKSPACE_ID_MISSING

ConfigManager

initialize_config

refresh_sql_endpoint_metadata

def refresh_sql_endpoint_metadata(lakehouse_name: str = None,
layer: str = None,
workspace_id: str = None,
access_token: str = None,
config_manager: ConfigManager = None,
timeout_minutes: int = 15,
interactive_only: bool = False) -> dict

Refreshes the SQL Endpoint metadata for a given lakehouse.

Arguments:

  • lakehouse_name str, optional - Name of the lakehouse (display name). Mutually exclusive with layer; exactly one must be provided.
  • layer str, optional - Layer name (e.g. "bronze", "meta"). Resolved to the configured lakehouse via config_manager.get_lakehouse_by_layer(layer). Mutually exclusive with lakehouse_name.
  • ``2 str, optional - Workspace ID. If not provided, it will be retrieved from spark.conf or notebook context.
  • ``3 str, optional - Bearer token. If not provided, it will be retrieved using notebookutils or Service Principal from config_manager.
  • 4 _ConfigManager, optional_ - Configuration manager used to retrieve app credentials if access_token is not provided, and to resolve layerto a lakehouse name iflayer`` is given. Auto-initialized when needed.
  • ``9 int, optional - Timeout for the refresh in minutes. Defaults to 15.
  • ``0 bool, optional - If True, only runs the refresh if the notebook is running in interactive mode. Defaults to False.

Returns:

  • ``1 - The API response from the refresh request, or a skip message.

Raises:

  • 2 - If neither or both of lakehouse_name/layer`` are provided, or if workspace_id, access_token or credentials cannot be determined.
  • ``7 - If the API request fails.