Getting Started with GoodData Cloud
Connect Your Data
After creating your first workspace, you need to connect data to GoodData Cloud. In this course, we will use demo data that comes with the GoodData Cloud trial.
GoodData Cloud supports real-time data sources.
For demo purposes, we will be using a demo Snowflake database. The demo database uses the following physical schema of tables and their relationships:
Connecting the data source
Summary
To connect your data source:
-
Navigate to your Workspace and select the Data tab in the top navigation bar.
-
Click create model, as you will need to create a model for the data you are connecting.
-
Click on the + icon in the left navigation bar, next to the Data Sources.
-
Select Snowflake.
-
Fill in our Snowflake demo database credentials.
Account Name: gooddata
Username: gooddata_demo
Password: 4m62f7hSXAayAisZ
Database name: GOODDATA_DEMO_DATABASE
Warehouse: GOODDATA_DEMO_WAREHOUSE
Schema name: GOODDATA_DEMO_SCHEMA -
When the Scan Data Source dialog pops up, leave the settings as they are and click scan.
Good job! You now know how to connect a data source
Alternatively, you can perform the same action by making the following API call:
curl --request POST \
--header "Authorization: Bearer $API_TOKEN" \
--header 'Content-Type: application/vnd.gooddata.api+json' \
--data '{
"data": {
"attributes": {
"name": "GDC Good Demo Data source",
"url":
"jdbc:snowflake://gooddata.snowflakecomputing.com?warehouse=GOODDATA_DEMO_WAREHOUSE&db=GOODDATA_DEMO_DATABASE",
"schema": "GOODDATA_DEMO_SCHEMA",
"type": "SNOWFLAKE",
"username": "gooddata_demo",
"password": "<db Pass>"
},
"id": "gdc_ds_gooddemo",
"type": "dataSource"
}
}' $ENDPOINT/api/v1/entities/dataSources
Alternatively, you can perform the same action by running the following code:
from gooddata_sdk import (GoodDataSdk, CatalogDataSource)
# GoodData.CN host in the form of uri eg. "http://localhost:3000"
host = "http://localhost:3000"
# GoodData.CN user token
token = "some_user_token"
sdk = GoodDataSdk.create(host, token)
# Create (or update) data source using general interface - can be used for any type of data source
# If data source already exists, it is updated
sdk.catalog_data_source.create_or_update_data_source(
CatalogDataSource(
id="test",
name="Test2",
data_source_type="POSTGRESQL",
url="jdbc:postgresql://localhost:5432/demo",
schema="demo",
credentials=BasicCredentials(
username="demouser",
password="demopass",
),
enable_caching=False,
url_params=[("param", "value")]
)
)