catalog_workspace.

load_and_put_aac_workspace

load_and_put_aac_workspace(workspace_id: str, source_dir: Path)

Load AAC YAML files from source_dir, convert to declarative, and deploy to workspace.

Parameters

nametypedescription
workspace_idstrWorkspace identification string e.g. "demo"
source_dirPathPath to the directory containing AAC YAML files.

Returns

None

Example

Deploy AAC YAML files from a local directory to a workspace:

from pathlib import Path
from gooddata_sdk import GoodDataSdk

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

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

The AAC YAML directory can contain typed subdirectories:

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

Each YAML file has a type field that determines its kind:

type: metric
id: revenue
title: Revenue
maql: SELECT SUM({fact/amount})
format: "#,##0"