0

I created a LDM using CloudConnect. How can I publish the LDM via the API by supplying the *.ldm file?

Publishing the LDM via CloudConnect isn't a scalable solution, so I'd like to programmatically do it.

EDIT: The project is brand new and doesn't have the LDM. The more I look at the documentation, I feel this is not possible and that I have to work with GoodData to create a template.

Aditya
  • 35
  • 1
  • 7

1 Answers1

2

If you already have LDM in your project you can use the Data Modeling API's (see https://developer.gooddata.com/article/data-modeling-api) endpoint /gdc/projects/{project-id}/model/view (see http://docs.gooddata.apiary.io/#get-%2Fgdc%2Fprojects%2F%7Bproject-id%7D%2Fmodel%2Fview) to get JSON describing you model. You can use this JSON for creating and updating model programmatically - when you change something in your JSON, resource /gdc/projects/{project-id}/model/diff (see http://docs.gooddata.apiary.io/#post-%2Fgdc%2Fprojects%2F%7Bproject-id%7D%2Fmodel%2Fdiff) will generate MAQL DDL commands for you.

Then you can use /gdc/md/{project-id}/ldm/manage2 resource (see http://docs.gooddata.apiary.io/#post-%2Fgdc%2Fmd%2F%7Bproject-id%7D%2Fldm%2Fmanage2) for executing them.

klob
  • 657
  • 6
  • 13
  • The LDM is not part of the project yet. I'm creating scripts for creating a project, uploading the LDM and creating a process. – Aditya Jul 14 '14 at 20:44
  • There is no direct way how to create the JSON from *.ldm file - it is done on the fly in CloudConnect while uploading model to the project. So you can either write the JSON yourself or upload the LDM for the first time, get the JSON and then use it for programmatically updating the model / generating others – klob Jul 15 '14 at 11:48