Updating project setting (for bundle export) via rest api & python

Destyh
Destyh Partner, Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1 Partner

Hi guys, I am trying to include other datasets in the project bundle when creating a bundle using RESTapi with python. I understand that I would have to use requests.get from the endpoint: http://url/projects/project_key/settings/ and updating ['bundleExporterSettings']['exportOptions']['includedDatasetsData']. This returns a list object.

Lets say that I want to include a dataset:

dataset = { 'name' : 'sample_data.csv',
'type' : "Filesystem" }

Should I append this to the list from the get call and do a put back to the same endpoint? If so, how should one include the body in a request call?

e.g.: response = requests.put(req_url, headers=auth )

Let me know if I'm not clear enough or if more information is needed.


Edit: Tried passing the appended dictionary back to the endpoint using PUT and received and error:
'message': 'Could not parse a APIProjectSettings from request body'

Is this only possible using the python client and not from requests?

Answers

Setup Info
    Tags
      Help me…