我正在尝试在我的CKAN实例中自动上传数据集和资源。我使用的是Ubuntu Linux 10.04 64位,我的CKAN实例版本是1.8。
我可以使用如下命令创建一个新的数据集:
$ curl http://ckan.installation.com/api/rest/dataset -H "Authorization:<my api key>" -d '{"name": "dataset-name", "title": "The Name of the Dataset"}'
{... JSON text recieved in response, including the id of the dataset ...}
现在,如何使用命令行在CKAN实例中创建和上传资源(如图像文件)?
谢谢!
发布于 2013-03-19 19:09:58
通过FileStore接口上传文件有点复杂。重用ckanclient's upload_file method会更好。一个简单的Python脚本就可以解决从命令行上传的问题。
或者,如果你觉得自己很勇敢,这是开始了解如何使用cURL上传文件的最佳起点。
https://stackoverflow.com/questions/14947468
复制