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

Ian Ward ian at excess.org
Tue Aug 23 01:51:12 UTC 2016


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> wrote:

> Hey
>
>
> I've installed ckan 2.5.2 via package install (live here
> 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://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
> 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. 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
>
> _______________________________________________
> ckan-dev mailing list
> ckan-dev at lists.okfn.org
> https://lists.okfn.org/mailman/listinfo/ckan-dev
> Unsubscribe: https://lists.okfn.org/mailman/options/ckan-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20160822/852e120d/attachment-0003.html>


More information about the ckan-dev mailing list