Hi. I am trying to set up a Demo on our GDCN site ...
# gooddata-cn
Hi. I am trying to set up a Demo on our GDCN site following the instructions on https: //github.com/gooddata/gooddata-public-demos. I have created a Redshift DB and uploaded "gooddemo" data there. Step 1 worked fine, returning the new data source.
Copy code
curl --request POST \
  --header "Authorization: Bearer $API_TOKEN" \
  --header 'Content-Type: application/vnd.gooddata.api+json' \
  --data @datasource_definition.json $ENDPOINT/api/v1/entities/dataSources

Step 2, however, did not work.
Copy code
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 advance
Hi Dongfeng. The guide available on the GitHub repository is not up-to-date. As of GoodData CN v.3.1.0, the Physical Data Model feature has been deprecated - which is why Step 2 fails with a 404 - the endpoint is no longer part of the API. What you can do, instead, is create the model without a PDM. I believe further down the guide, under Additional options, there is a step explaining how you can do so. Regarding the behavior
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
section is corrected, since it’s no longer in use.
Thanks, Francisco. I just used UI to create the LDM. Fortunately, I could still import the workspace analytic models and everything looks good. Thank you for the help.
I’m happy to hear it! It was my pleasure.