|
| 1 | +# GoodData Pipelines |
| 2 | + |
| 3 | +The `gooddata-pipelines` package provides a number of high level scripts to interact with and manage [GoodData](https://www.gooddata.com/). |
| 4 | + |
| 5 | +At the moment, the package allows you to automate these features: |
| 6 | + |
| 7 | +- Provisioning (creation, updtating and removal of resources) of |
| 8 | + - workspaces |
| 9 | + - users |
| 10 | + - user groups |
| 11 | + - user permissions |
| 12 | + - user data filters |
| 13 | + <!-- TODO: Backups, restores --> |
| 14 | + |
| 15 | +<!-- TODO: link to documentation --> |
| 16 | +<!-- See [DOCUMENTATION](https://www.gooddata.com/docs/python-sdk/1.43.0) for more details. --> |
| 17 | + |
| 18 | +## Requirements |
| 19 | + |
| 20 | +- GoodData Cloud or GoodData.CN installation |
| 21 | +- Python 3.10 or newer |
| 22 | + |
| 23 | +## Installation |
| 24 | + |
| 25 | +Run the following command to install the `gooddata-pipelines` package on your system: |
| 26 | + |
| 27 | + pip install gooddata-pipelines |
| 28 | + |
| 29 | +## Example |
| 30 | + |
| 31 | +This example illustrates how to use this package to manage GoodData Cloud workspaces. The provisioning script will ingest data which will be used as a source of truth to configure GoodData. The script will compare the source data with the current state of GoodData instance and will create, update and delete workspaces and user data filter settings to match the source data. |
| 32 | + |
| 33 | +```python |
| 34 | + |
| 35 | +# Import WorkspaceProvisioner and Workspace model. |
| 36 | +from gooddata_pipelines import Workspace, WorkspaceProvisioner |
| 37 | + |
| 38 | +# Gather the raw data to be used by the provisioner. |
| 39 | +raw_data: list[dict] = [ |
| 40 | + { |
| 41 | + "parent_id": "parent_workspace_id", |
| 42 | + "workspace_id": "workspace_id", |
| 43 | + "workspace_name": "Workspace Name", |
| 44 | + "workspace_data_filter_id": "wdf_id", |
| 45 | + "workspace_data_filter_values": ["value1", "value2"], |
| 46 | + } |
| 47 | +] |
| 48 | + |
| 49 | +# Convert raw data to Workspace objects. |
| 50 | +data = [Workspace(**item) for item in raw_data] |
| 51 | + |
| 52 | +# Create a WorkspaceProvisioner using your GoodData host name and token. |
| 53 | +host = "https://your-gooddata-host.com" |
| 54 | +token = "your_gooddata_token" |
| 55 | +provisioner = WorkspaceProvisioner.create(host=host, token=token) |
| 56 | + |
| 57 | +# Provision the workspaces |
| 58 | +provisioner.provision(data) |
| 59 | +``` |
| 60 | + |
| 61 | +## Bugs & Requests |
| 62 | + |
| 63 | +Please use the [GitHub issue tracker](https://github.com/gooddata/gooddata-python-sdk/issues) to submit bugs |
| 64 | +or request features. |
| 65 | + |
| 66 | +## Changelog |
| 67 | + |
| 68 | +See [Github releases](https://github.com/gooddata/gooddata-python-sdk/releases) for released versions |
| 69 | +and a list of changes. |
0 commit comments