subutai-io / cdn

Gorjun is a golang replacement for Kurjun project.
Apache License 2.0
19 stars 13 forks source link

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

Open akarasulu opened 6 years ago

akarasulu commented 6 years ago

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.

dilshat commented 6 years ago

Gorjun supports tags only for templates.

akarasulu commented 6 years ago

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?

emli commented 6 years ago

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

akarasulu commented 6 years ago

@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
  2. show how i can get these files back from Gorjun by specifying name and tag value
emli commented 6 years ago

1)

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

akarasulu commented 6 years ago

How about by name and by version?

emli commented 6 years ago

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

akarasulu commented 6 years ago
  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?
dilshat commented 6 years ago
  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