|
| 1 | +--- |
| 2 | +title: "load_and_put_aac_workspace" |
| 3 | +linkTitle: "load_and_put_aac_workspace" |
| 4 | +weight: 135 |
| 5 | +superheading: "catalog_workspace." |
| 6 | +api_ref: "CatalogWorkspaceService.load_and_put_aac_workspace" |
| 7 | +--- |
| 8 | + |
| 9 | +<!-- AUTO-GENERATED FROM DOCSTRING — do not edit above this line --> |
| 10 | + |
| 11 | +<div class="python-ref"> |
| 12 | +<p><code>load_and_put_aac_workspace(workspace_id: str, source_dir: Path)</code></p> |
| 13 | +<div class="python-ref-description"> |
| 14 | +<p>Load AAC YAML files from source_dir, convert to declarative, and deploy to workspace.</p> |
| 15 | +</div> |
| 16 | +<h4>Parameters</h4> |
| 17 | +<table class="gd-docs-parameters-block"> |
| 18 | +<thead> |
| 19 | +<tr> |
| 20 | +<th>name</th> |
| 21 | +<th>type</th> |
| 22 | +<th>description</th> |
| 23 | +</tr> |
| 24 | +</thead> |
| 25 | +<tbody> |
| 26 | +<tr> |
| 27 | +<th padding="0px">workspace_id |
| 28 | +<th padding="0px">str |
| 29 | +<th> |
| 30 | +Workspace identification string e.g. "demo" |
| 31 | +</tr> |
| 32 | +<tr> |
| 33 | +<th padding="0px">source_dir |
| 34 | +<th padding="0px">Path |
| 35 | +<th> |
| 36 | +Path to the directory containing AAC YAML files. |
| 37 | +</tr> |
| 38 | +</tbody> |
| 39 | +</table> |
| 40 | +<h4>Returns</h4> |
| 41 | +<i>None</i> |
| 42 | +</div> |
| 43 | + |
| 44 | +## Example |
| 45 | + |
| 46 | +Deploy AAC YAML files from a local directory to a workspace: |
| 47 | + |
| 48 | +```python |
| 49 | +from pathlib import Path |
| 50 | +from gooddata_sdk import GoodDataSdk |
| 51 | + |
| 52 | +host = "https://www.example.com" |
| 53 | +token = "some_user_token" |
| 54 | +sdk = GoodDataSdk.create(host, token) |
| 55 | + |
| 56 | +# Deploy AAC YAML files to workspace |
| 57 | +sdk.catalog_workspace.load_and_put_aac_workspace( |
| 58 | + workspace_id="demo", |
| 59 | + source_dir=Path("analytics") |
| 60 | +) |
| 61 | +``` |
| 62 | + |
| 63 | +The AAC YAML directory can contain typed subdirectories: |
| 64 | + |
| 65 | +``` |
| 66 | +analytics/ |
| 67 | + datasets/ |
| 68 | + campaigns.yaml |
| 69 | + orders.yaml |
| 70 | + metrics/ |
| 71 | + revenue.yaml |
| 72 | + visualisations/ |
| 73 | + revenue_chart.yaml |
| 74 | + dashboards/ |
| 75 | + overview.yaml |
| 76 | +``` |
| 77 | + |
| 78 | +Each YAML file has a `type` field that determines its kind: |
| 79 | + |
| 80 | +```yaml |
| 81 | +type: metric |
| 82 | +id: revenue |
| 83 | +title: Revenue |
| 84 | +maql: SELECT SUM({fact/amount}) |
| 85 | +format: "#,##0" |
| 86 | +``` |
0 commit comments