[ckan-dev] ckanapi bulk_update_* does not behave as expected

Wiebke Toussaint wiebke.toussaint at uct.ac.za
Tue Aug 23 09:47:30 UTC 2016


Thanks a lot! I managed to update individual datasets by setting private=true.


The bulk actions still don't do anything (also tried bulk_update_delete and datasets remain on site). I see that one of the parameters they call for is org_id (int). I've tried setting this to my organisation name and id, both of which are strings. Could this be the problem? Not sure what the integer is that's required as the value.


I've installed the hierarchy extension. Though unlikely, that may be an issue?


Thanks for assisting,

Wiebke

________________________________
From: ckan-dev <ckan-dev-bounces at lists.okfn.org> on behalf of Ian Ward <ian at excess.org>
Sent: 23 August 2016 03:51:12 AM
To: CKAN Development Discussions
Subject: Re: [ckan-dev] ckanapi bulk_update_* does not behave as expected

The ckanapi CLI hides success envelopes returned in CKAN's API response because the first thing that a user would do is strip that off. The bulk_update_* actions don't currently return anything, so 'null' is the correct response.

You can create a private dataset by setting private=true (either as a string or a proper JSON true value).

Ian

On Mon, Aug 22, 2016 at 11:55 AM, Wiebke Toussaint <wiebke.toussaint at uct.ac.za<mailto:wiebke.toussaint at uct.ac.za>> wrote:

Hey


I've installed ckan 2.5.2 via package install (live here http://energydata.uct.ac.za<http://energydata.uct.ac.za/>) and have successfully used API commands to get and post datasets. However, I have not been able to create a private dataset (could not find the parameter relating to 'visibility'). I'm thus trying to do a bulk update from public to private (and vice versa) with the following CLI command:


ckanapi action bulk_update_private datasets=my_dataset org_id=my_org_id -r http://energydata.uct.ac.za -a myapikey


I keep receiving a 'null' response, instead of the anticipated 'success'. A similar issue seems to be recorded here: https://github.com/ckan/ckan/issues/2662

[https://avatars3.githubusercontent.com/u/3489241?v=3&s=400]<https://github.com/ckan/ckan/issues/2662>

bulk_update_* doesn't do anything * Issue #2662 * ckan/ckan<https://github.com/ckan/ckan/issues/2662>
github.com<http://github.com>
Running: >>> r = requests.post('http://localhost:5000/api/3/action/bulk_update_private', json={'datasets':['a-dataset'], 'org_id': 'another-organization'}, headers={'Authorization':apikey}) >>> r...

Can anybody point me in the right direction of where I'm going wrong? Does the problem lie with the API or with me using it incorrectly? Is there a parameter I'm missing?


Kind regards,

Wiebke


Disclaimer - University of Cape Town This e-mail is subject to UCT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111<tel:%2B27%2021%20650%209111>. If this e-mail is not related to the business of UCT, it is sent by the sender in an individual capacity. Please report security incidents or abuse via csirt at uct.ac.za<mailto:csirt at uct.ac.za>

_______________________________________________
ckan-dev mailing list
ckan-dev at lists.okfn.org<mailto:ckan-dev at lists.okfn.org>
https://lists.okfn.org/mailman/listinfo/ckan-dev
Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev


Disclaimer - University of Cape Town This e-mail is subject to UCT policies and e-mail disclaimer published on our website at http://www.uct.ac.za/about/policies/emaildisclaimer/ or obtainable from +27 21 650 9111. If this e-mail is not related to the business of UCT, it is sent by the sender in an individual capacity. Please report security incidents or abuse via csirt at uct.ac.za
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160823/50f3ff19/attachment-0003.html>


More information about the ckan-dev mailing list