[ckan-dev] Resource not being found via Datastore API
Alexandre Gomes
alegomes at gmail.com
Mon Feb 10 17:36:15 UTC 2014
The thing is I have a dataset with a resource with id
'c952e399-d856-4571-9cd5-9e24094a1960' as you can see in
http://postimg.org/image/4oz4cwkwx/
The resource can be located with Action API:
*$ curl
http://172.16.104.245/api/3/action/resource_show?id=c952e399-d856-4571-9cd5-9e24094a1960
<http://172.16.104.245/api/3/action/resource_show?id=c952e399-d856-4571-9cd5-9e24094a1960>*
{
"help": "...",
"success": true,
"result": {
"resource_group_id": "f5d9dbc4-a362-4939-b4bb-915c0cba4ab4",
"cache_last_updated": null,
"webstore_last_updated": null,
"datastore_active": false,
"id": "c952e399-d856-4571-9cd5-9e24094a1960",
"size": null,
"state": "active",
"last_modified": null,
"hash": "",
"description": "",
"format": "JSON",
"tracking_summary": {"total": 0,
"recent": 0},
"mimetype_inner": null,
"url_type": null,
"mimetype": null,
"cache_url": null,
"name": "Lista din\u00e2mica",
"created": "2014-02-10T14:51:29.022416",
"url": "http://www.example.org",
"webstore_url": null,
"position": 3,
"revision_id": "3cc36a35-0aeb-4a0c-b0a9-284c0c87582e",
"resource_type": null
}
}
...but not with Datastore API:
*$ curl
http://172.16.104.245/api/3/action/datastore_search?resource_id=c952e399-d856-4571-9cd5-9e24094a1960
<http://172.16.104.245/api/3/action/datastore_search?resource_id=c952e399-d856-4571-9cd5-9e24094a1960>*
{
"help": "Search a DataStore resource.(...)",
"success": false,
"error": {
"message": "Not found: Resource
\"c952e399-d856-4571-9cd5-9e24094a1960\" was not found.",
"__type": "Not Found Error"
}
}
...and datasetore_create doesn't work too.
*$ curl -X POST http://172.16.104.245/api/3/action/datastore_create
<http://172.16.104.245/api/3/action/datastore_create> -H "Authorization:
{946ac3c2-'f5ef-4e60-a4ee-efcc8b10a2ff'}" -d '{"resource_id":
"{'c952e399-d856-4571-9cd5-9e24094a1960'}", "fields": [ {"id": "a"}, {"id":
"b"} ], "records": [ { "a": 1, "b": "xyz"}, {"a": 2, "b": "zzz"} ]}'*
{"help": "Adds a new table to the DataStore.
(...)
", "success": false, "error": {"resource_id": ["Not found: Resource"],
"__type": "Validation Error"}}
Why?
[]s!
http://alegom.es
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/ckan-dev/attachments/20140210/b59422d6/attachment-0002.html>
More information about the ckan-dev
mailing list