cdn icon indicating copy to clipboard operation
cdn copied to clipboard

How to upload with a tag and reuse it later to download?

Open akarasulu opened this issue 7 years ago • 9 comments

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.

akarasulu avatar Dec 10 '17 18:12 akarasulu

Gorjun supports tags only for templates.

dilshat avatar Dec 11 '17 03:12 dilshat

Gorjun supports tags only for templates.

  1. Ok, can you please show how it can be used?

  2. Why can't we use this on any artifact type?

akarasulu avatar Dec 11 '17 05:12 akarasulu

You can check curl calls here https://github.com/subutai-io/gorjun/wiki/v1#kurjunresttemplatetag

emli avatar Dec 11 '17 06:12 emli

@emli show me how in a command sequence with curl:

  1. 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
  1. show how i can get these files back from Gorjun by specifying name and tag value

akarasulu avatar Dec 11 '17 06:12 akarasulu

  • 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

  1. We can get files by name and id of template. By tag not implemented

emli avatar Dec 11 '17 08:12 emli

How about by name and by version?

akarasulu avatar Dec 11 '17 14:12 akarasulu

By name and by version also not implemented, currently implemented only by name and id

emli avatar Dec 11 '17 16:12 emli

  1. I can query by name to get a list of ids right?
  2. Then I can select the id that has a version or tag I am looking for right?
  3. Then I can use that to download the artifact correct?

akarasulu avatar Dec 11 '17 17:12 akarasulu

  1. Yes, for example this request https://cdn.subut.ai:8338/kurjun/rest/template/info?name=ubuntu returns ubuntu14 and ubuntu16
  2. Yes, response contains json array with version and tags if any
  3. Yes, download can be done then with this request https://cdn.subut.ai:8338/kurjun/rest/template/download?id=c0d9f79ca76a7eb7e9f0a4f8ed522585

dilshat avatar Dec 12 '17 05:12 dilshat