catalog_workspace.

get_and_store_aac_workspace

get_and_store_aac_workspace(workspace_id: str, source_dir: Path)

Get declarative workspace from server, convert to AAC YAML files, and write to disk.

Parameters

nametypedescription
workspace_idstrWorkspace identification string e.g. "demo"
source_dirPathPath to the directory where AAC YAML files will be written.

Returns

None

Example

Clone a workspace layout as AAC YAML files:

from pathlib import Path
from gooddata_sdk import GoodDataSdk

host = "https://www.example.com"
token = "some_user_token"
sdk = GoodDataSdk.create(host, token)

# Clone workspace to AAC YAML files
sdk.catalog_workspace.get_and_store_aac_workspace(
    workspace_id="demo",
    source_dir=Path("analytics")
)

This creates typed subdirectories under the target path:

analytics/
    datasets/
        campaigns.yaml
        orders.yaml
    metrics/
        revenue.yaml
    visualisations/
        revenue_chart.yaml
    dashboards/
        overview.yaml