catalog_workspace_content.

store_analytics_model_to_disk

store_analytics_model_to_disk(workspace_id: str, path: Path = Path.cwd(), exclude: Optional[list[str]] = None, sort: bool = False)

Stores analytics model for a given workspace in directory hierarchy.This method does not tie the declarative analytics model to the workspace and organization, thus it is recommended for migration between workspaces. If you want to backup analytics model between workspaces or organizations, use store_analytics_model_to_disk.

The directory structure below shows the output for the path set to Path("analytics_model_location").

analytics_model_location
            └── analytics_model
                    ├── analytical_dashboards
                    │       └── analytical_dashboard.yaml
                    ├── dashboard_plugins
                    │       └── dashboard_plugin.yaml
                    ├── filter_contexts
                    │       └── filter_context.yaml
                    ├── metrics
                    │       └── metric.yaml
                    └── visualization_objects
                            └── visualization_object.yaml

Parameters

nametypedescription
workspace_idstrWorkspace identification string e.g. "demo"
pathOptional[Path]Path to the root of the layout directory. Defaults to Path.cwd().
excludeOptional[list[str]]Defines properties which should not be included in the result. E.g.: ["ACTIVITY_INFO"] – refers to createdBy, etc. Default is None.
sortboolFlag if the output should be sorted before storing to disk. Default is False.

Returns

None

Example

# Store the analytics model to disk
sdk.catalog_workspace_content.store_analytics_model_to_disk(
        workspace_id="123",
        path=Path.cwd()
)