Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the Gooddata API to upload graphs?

I'm attempting to upload graphs made/edited in Cloud Connect to GoodData via the api. I have been trying to use this call: http://docs.gooddata.apiary.io/#cloudconnectprocesses

The actual call I'm making has the json {"process": {"path": "/uploads/Bonobos_v6-1.grf", "name": "Bonobos Prod"}}

However, when I try to run this, it fails with

{
    "error": {
        "errorClass": "com.gooddata.msf.processes.InvalidProcessException",
        "trace": "",
        "message": "Can not read from file \"/uploads/Bonobos_v6-1.grf\"",
        "component": "MSF",
        "errorId": "83090caa-31c9-4ce2-bb79-040d5c4d2421",
        "errorCode": "gdc1151",
        "parameters": []
    }
}

Is there a specific way of creating a "process" that then needs to get uploaded to the server? I've tried both zip files of multiple graphs and individual .grf files, but to no avail. I'm also assuming that the error does not mean that GoodData can't see the file, but that would certainly explain some things.

like image 421
jpavs Avatar asked Oct 02 '22 16:10

jpavs


2 Answers

First of all you have to check where is your project located(na1 or secure). If your project resides on na1 follow this procedure:

  1. zip your CloudConnect project (it doesn't matter whether you zip whole folder or just its content)
  2. upload zip file to webdav - na1-di.gooddata.com/uploads using curl curl -k -T zippedCcProject.zip https://my_login%40company.com:[email protected]/uploads/zippedCcProject.zip
  3. open browser and go to the processes rest resource https://na1.secure.gooddata.com/gdc/projects/{projectId}/dataload/processes/ and fill proper attributes (type=GRAPH, name=myCloudConnectProject, path=/uploads/zippedCcProject.zip) and hit 'create the process'
like image 56
mawek Avatar answered Oct 05 '22 12:10

mawek


Before calling this API you have to upload the packed all files in your CloudConnect project and PUT them on the server. Have you done this?

So the whole process will be:

  1. ZIP archive all files (i.e. workspace.prm) and folders (graphs,meta,trans,...) from CloudConnect Project folder (please do not add data folder if there is a bigger volume of data, store them in external location then)
  2. PUT them on the webdav server (example is na1-di.gooddata.com/uploads/...)
  3. Call the API to Deploy it (the path will be "/uploads/your-folder/name-of-the-archive")

Remember: If you have your Project on https://secure.gooddata.com your webdav server is https://secure-di.gooddata.com/uploads/ if your project is on the https://na1.gooddata.com you have to use https://na1-di.gooddata.com/uploads/

Let me know if this helps you. We need to clarify this info in API docs anyway.

Thanks!

like image 41
Jiri Tobolka Avatar answered Oct 05 '22 11:10

Jiri Tobolka