[ckan-dev] Filestore API - error

Matthew Fullerton matt.fullerton at gmail.com
Fri Jan 13 11:44:18 UTC 2017


Hi Pedro,

On 13 January 2017 at 12:25, Pedro Ferro <pedro.ferro at gmail.com> wrote:

> Thank you all for the help but still can't understand how to do it. (you
> guys have to have patience to put up with a basic non IT guy...)
>
> I'm running CKAN 2.5.3 in a VM.
> At the VM, Ckan is running under 127.0.0.1:5000
> Outside the VM, CKAN is running 10.0.70.130:5000
>
>
>
> two kinds of doubts:
>
> --> what you meen "supply a "url" property" ?
>  I did this but didn't work:
>
> curl -H'Authorization: c72f0189-dae9-4606-9e3d-debf5b560268' "
>> http://localhost:5000/api/action/resource_create" --form
>> upload=@/tmp/distrito_conc_escolaridade.geojson --form
>> package_id='desemprego' --form url='http://localhost:5000'
>>
>
>
>
>>
>
> --> supply package_id
> thought that the  package_id was the name of the new dataset we are
> uploading
>
> but I also tried with the id that appears in the url when edit a existent
> dataset and got an error to
>
> curl -H'Authorization: c72f0189-dae9-4606-9e3d-debf5b560268' "
>> http://localhost:5000/api/action/resource_create" --form
>> upload=@/tmp/distrito_conc_escolaridade.geojson --form
>> package_id='4c0d8df1-84d6-492d-af81-ba87f1568389'--form  url= '
>> http://localhost:5000'
>>
>
>
> {"help": "http://10.0.70.130:5000/api/3/action/help_show?name=resourc
>> e_create", "success": false, "error": {"url": ["Valor em falta"],
>> "__type": "Validation Error"}}curl: (6) Could not resolve host: url=
>> <!DOCTYPE html>
>>
>
Maybe you're almost there. Add a space between that package id sting and
the --form part and remove the space between the = sign and the url value.
The package id you are using might work, but you can/should also use the
simplified name (i.e. name, not title) that CKAN gives the dataset (the
"parent" for this resource, that you are adding - packages or datasets
contain resources which hold the actual data). I.e. 'castilla-y-leon' for
http://demo.ckan.org/dataset/castilla-y-leon.

I.e., something like this, but you need to replace it with your package ID
(name):
curl -H 'Authorization: c72f0189-dae9-4606-9e3d-debf5b560268' "
http://localhost:5000/api/action/resource_create" --form
upload=@/tmp/distrito_conc_escolaridade.geojson --form
package_id='package-name' --form  url='http://localhost:5000'

Best,
Matt


> ....
>
>
>
>
> thanks
> Pedro
>
> 2017-01-12 18:41 GMT+00:00  <ckan-dev-request at lists.okfn.org>:
>
>
>>
>> >
>> > On Thu, Jan 12, 2017 at 11:15 AM, Matthew Fullerton
>> > <matt.fullerton at gmail.com> wrote:
>> >> Hi Pedro,
>> >> you need to supply a "url" property as well as package_id. The API
>> reference
>> >> for resource_create also states this, although I'm very curious to see
>> what
>> >> happens to the URL you provide, assuming the file upload works.
>> >>
>> >> -Matt
>> >>
>> >>
>>
>
>
> _______________________________________________
> 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/20170113/3a635e74/attachment-0003.html>


More information about the ckan-dev mailing list