cdn
cdn copied to clipboard
How to upload with a tag and reuse it later to download?
We added a feature to add tags (labels to files uploaded). I would like to document how this feature works. How do I upload a file to Gorjun providing a tag, and use that to retrieve it? Please show me the mechanics of this with curl calls.
My specific use case is to upload a version of a file and use the tag for the version. This way the file name in Gorjun stays the same while I can still access older versions of the file using this version tag.
Gorjun supports tags only for templates.
Gorjun supports tags only for templates.
-
Ok, can you please show how it can be used?
-
Why can't we use this on any artifact type?
You can check curl calls here https://github.com/subutai-io/gorjun/wiki/v1#kurjunresttemplatetag
@emli show me how in a command sequence with curl:
- I can upload 3 different files (different md5 etc) but using same name
- foo.tgz with tag 1.0
- foo.tgz with tag 1.1
- foo.tgz with tag 2.0
- show how i can get these files back from Gorjun by specifying name and tag value
-
curl -Ftags=1.0 -Ftoken=$TOKEN -Fid=982e3fc0-820f-48ee-a8c1-32254f80445a "$URL/template/tag"
-
curl -Ftags=1.1 -Ftoken=$TOKEN -Fid=2862aa2f-b10b-4368-84a9-e09f102f149e "$URL/template/tag"
-
curl -Ftags=2.0 -Ftoken=$TOKEN -Fid=ae7d01d7-61e5-45c1-b3ad-399f7488d66e "$URL/template/tag"
By the following links you can see tags. -
https://devcdn.subut.ai:8338/kurjun/rest/template/info?id=982e3fc0-820f-48ee-a8c1-32254f80445a
-
https://devcdn.subut.ai:8338/kurjun/rest/template/info?id=2862aa2f-b10b-4368-84a9-e09f102f149e
-
https://devcdn.subut.ai:8338/kurjun/rest/template/info?id=ae7d01d7-61e5-45c1-b3ad-399f7488d66e
- We can get files by name and id of template. By tag not implemented
How about by name and by version?
By name and by version also not implemented, currently implemented only by name and id
- I can query by name to get a list of ids right?
- Then I can select the id that has a version or tag I am looking for right?
- Then I can use that to download the artifact correct?
- Yes, for example this request https://cdn.subut.ai:8338/kurjun/rest/template/info?name=ubuntu returns ubuntu14 and ubuntu16
- Yes, response contains json array with version and tags if any
- Yes, download can be done then with this request https://cdn.subut.ai:8338/kurjun/rest/template/download?id=c0d9f79ca76a7eb7e9f0a4f8ed522585