Search code examples
etlbusiness-intelligencegooddata

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.


Solution

  • 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'