This documentation is for the unstable version of GoodData, currrently in development.
For stable version, go to the latest stable version of this article.
For stable version, go to the latest stable version of this article.
catalog_data_source.
create_or_update_data_source
create_or_update_data_source(data_source: CatalogDataSource) -> UpsertOutcome
Pushes the Data Source to the GoodData environment.
Automatically decides, whether to create or update.
Parameters
| name | type | description |
|---|---|---|
| data_source | CatalogDataSource | Catalog Data Source object |
Returns
| type | description |
|---|---|
| UpsertOutcome | CREATED if the data source did not exist yet, UPDATED if it did. |
Example
# PostgreSQL example
sdk.catalog_data_source.create_or_update_data_source(
CatalogDataSourcePostgres(
id=data_source_id,
name=data_source_name,
db_specific_attributes=PostgresAttributes(
host=os.environ["POSTGRES_HOST"],
db_name=os.environ["POSTGRES_DBNAME"]
),
schema=os.environ["POSTGRES_SCHEMA"],
credentials=BasicCredentials(
username=os.environ["POSTGRES_USER"],
password=os.environ["POSTGRES_PASSWORD"],
),
)
)