policyweaver.core.api.fabric

policyweaver.core.api.fabric

class policyweaver.core.api.fabric.FabricAPI(workspace_id: str, weaver_type: str = None)

Bases: object

A class to interact with the Fabric API for managing data access policies. This class provides methods to put and list data access policies, and to retrieve workspace information. Attributes:

workspace_id (str): The unique identifier of the Fabric workspace. logger (logging.Logger): Logger instance for logging API interactions. token (str): Authentication token for accessing the Fabric API. rest_api_proxy (RestAPIProxy): Proxy for making REST API calls to the Fabric API.

get_workspace_name() str

Retrieves the display name of the Fabric workspace. Returns:

str: The display name of the Fabric workspace.

list_data_access_policy(item_id)

Retrieves the data access policy for a specific item in the Fabric workspace. Args:

item_id (str): The unique identifier of the item for which the access policy is being retrieved.

Returns:

dict: The data access policy for the specified item.

put_data_access_policy(item_id, access_policy)

Updates the data access policy for a specific item in the Fabric workspace. Args:

item_id (str): The unique identifier of the item for which the access policy is being updated. access_policy (dict): The access policy to be applied to the item.

Returns:

Response: The response from the Fabric API after attempting to update the access policy.