Create a distribution for an existing dataset via the Metastore API #3832
Replies: 5 comments
-
@Katsivelisp if you mean using the file upload then yes this will not work, but if you host your files on some other publicly accessible server (S3), or rsync your files to sites/default/files/data-files/... then you can use your site as the 'remote' server PATCH https://{your.domain}/api/1/metastore/schemas/dataset/items/{uuid-of-your-dataset}
|
Beta Was this translation helpful? Give feedback.
-
@Katsivelisp to add to this -- while distributions and datasets are stored as separate entities in DKAN and this is reflected in both of them existing as separate resources in the API, in real-life use there aren't a lot of reasons to create distributions on their own. Generally you will be best-served by treating distributions as part of the dataset entity. Make changes to the distribution array in the dataset and DKAN's referencing logic will take care of the distribution entities behind the scenes. |
Beta Was this translation helpful? Give feedback.
-
Sorry for not making it clear, but yeah. I wanted the new distribution to point to a remote URL, which is actually a Drupal Views CSV export of my own site. I will try the above solution and let you know. |
Beta Was this translation helpful? Give feedback.
-
Hi @Katsivelisp curious if you got anywhere with this. |
Beta Was this translation helpful? Give feedback.
-
Hello,
I am working with the DKAN (v2.11) API and I would like to automate things a little bit when it comes to distribution creation. Currently, it looks like the API supports creating (POST) new distributions and also updating datasets (PATCH). However, creating a distribution for a specific dataset does not seem to be supported. Neither is updating datasets to reference an existing distribution.
So, my question is: how can I use the API to create a distribution for an existing dataset?
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions