Dongfeng Lu
04/29/2024, 10:25 PMcurl --request POST \
--header "Authorization: Bearer $API_TOKEN" \
--header 'Content-Type: application/vnd.gooddata.api+json' \
--data @datasource_definition.json $ENDPOINT/api/v1/entities/dataSources
{"data":{"id":"gdc_ds_gooddemo","type":"dataSource","attributes":{"url":"jdbc:<redshift://xxx.amazonaws.com:5439/yyy>","username":"xxx","enableCaching":false,"name":"gdc_ds_gooddemo","type":"REDSHIFT","schema":"demo"}},"links":{"self":"<https://xxx.xxx/api/v1/entities/dataSources/gdc_ds_gooddemo>"}}
Step 2, however, did not work.
curl --request PUT \
--header "Authorization: Bearer $API_TOKEN" \
--header 'Content-Type: application/json' \
--data '@./gooddemo/dataSource/pdm.json' $ENDPOINT/api/v1/layout/dataSources/gdc_ds_gooddemo/physicalModel
{"detail":"No API path found that matches request '/api/v1/layout/dataSources/gdc_ds_gooddemo/physicalModel'.","status":404,"title":"Not Found","traceId":"5417c5ff641f732a"}
I looked the API reference https://www.gooddata.com/docs/cloud/api-and-sdk/api/api_reference_all/, and I found "/api/v1/layout/dataSources" with a PUT method. Is this the replacement for "/api/v1/layout/dataSources/gdc_ds_gooddemo/physicalModel"
Then https://www.gooddata.com/docs/cloud-native/3.7/connect-data/manage-data-sources/ seems to suggest that "/api/v1/layout/dataSources" is used to "create a backup of all data sources" and "restore all data sources". So if we have 3 datasources already defined, and I only specify one of them for this API with PUT method, will the other 2 datasources deleted or intact?
The examples in the above 2 pages about "/api/v1/layout/dataSources" does not seem to match. https://www.gooddata.com/docs/cloud-native/3.7/connect-data/manage-data-sources/ seems to suggest there is a "pdm" section in GET method, but https://www.gooddata.com/docs/cloud/api-and-sdk/api/api_reference_all/ does not in the expanded form, and I don't see it either when I ran it. So which one is correct?
Should PDM be automatically there as it is from database? Do we have to create manually as in Step 2? As I tried, and I can create a LDM and insights with UI after the Step 1, but I am not sure if Steps 3 and 4 works.
Thanks in advanceFrancisco Antunes
04/29/2024, 11:27 PM/api/v1/layout/dataSources/
endpoint, a PUT there will indeed overwrite it - so if you have 3 data sources defined there and PUT only 1 the other 2 will be lost.
As for the last point, it looks like an oversight; I will highlight it internally so that the pdm
section is corrected, since it’s no longer in use.Dongfeng Lu
05/01/2024, 5:48 PMFrancisco Antunes
05/01/2024, 5:50 PM