Skip to content
emli edited this page Nov 3, 2017 · 34 revisions

/kurjun/rest/{template,apt,raw}/download

Methods:

  • GET

download endpoint allows a user to download an artifact from Gorjun.

There are 3 types of repositories:

  • template
  • apt
  • raw

Following fields can be used for filtering artifacts:

curl -k -s -Ffile=@/tmp/file.tgz -Ftoken=$TOKEN "$URL/raw/upload"

/kurjun/rest/{template,apt,raw}/upload

Methods:

  • POST

upload endpoint allows a user to upload an artifact to Gorjun.

There are 3 types of repositories:

  • template
  • apt
  • raw

Following fields are required:

  • file - is a data that should be uploaded;
  • token - user authentication token.

curl -k -s -Ffile=@/tmp/file.tgz -Ftoken=$TOKEN "$URL/raw/upload"

/kurjun/rest/{template,apt,raw}/info

Methods:

  • GET

info endpoint provides JSON formatted output about artifacts stored in Kurjun.

There are 3 types of repositories:

  • template
  • apt
  • raw

Filters for artifacts:

Auth:

  • token

Formatting:

  • page

/kurjun/rest/template/tag

Methods:

  • POST
  • DELETE

tag endpoint adds tags to the Kurjun template information.

Fields:

  • id - artifact identifier;
  • token - authentication token;
  • tags - list of tags.

Example:

curl -Ftags=aaa,bbb,ccc,qqq -Ftoken=$TOKEN -Fid=4ae98d783858397268f5a5c2edc1f547 "$URL/template/tag"

curl -X DELETE -Ftags=aaa,bbb,ccc,qqq -Ftoken=$TOKEN -Fid=4ae98d783858397268f5a5c2edc1f547 "$URL/template/tag"

/kurjun/rest/share

Methods:

  • POST
  • GET

share endpoint allows users to share repositories with each other.

There are 3 types of repositories:

  • template
  • apt
  • raw

POST

Following fields are required:

  • token - user authentication token.
  • id - repository id
  • add - add to list of users id's who can access the file
  • remove - remove form list of users id's who can access the file
  • repo - repository type

Example:

 {
  "token":"5e9f67d0ca627b581f9c9c26d301d11dae54ea2f44b9cde34c3fae50b3560fcd",
  "id":"23373ff9-10c9-4134-99a0-18c055dba39f", 
  "add": [ "alica" ],
   "remove": [],
   "repo":"raw"
 }

/tmp/share.json

{
  "token":"5e9f67d0ca627b581f9c9c26d301d11dae54ea2f44b9cde34c3fae50b3560fcd",
  "id":"23373ff9-10c9-4134-99a0-18c055dba39f", 
  "add": [ "alica" ],
   "remove": [],
   "repo":"raw"
}
#!/bin/bash

URL=http://127.0.0.1:8080

curl -k -s -Fjson="`cat /tmp/share.json`"  "$URL/kurjun/rest/share"

GET

Returns all users id's who have access to repository.

Following fields are required:

  • token - user authentication token.
  • id - repository id
  • repo - repository type
#!/bin/bash
URL=http://127.0.0.1:8080
ID="23373ff9-10c9-4134-99a0-18c055dba39f"
TOKEN=fabfc86778ce1a7a04b72280eff5efc49d6165beea226b1375f8a8b0e5991bb9
REPO=raw

curl -k "$URL/kurjun/rest/share?id=$ID&token=$TOKEN&repo=$REPO" -o /tmp/share

/kurjun/rest/quota

Methods:

  • POST
  • GET

quota endpoint allows users to set their quota. Default quota is 2GB. Only allowed users can set their quota. Allowed users are subutai and Hub.

POST

Following fields are required:

  • token - user authentication token.
  • user - username.
  • quota - size of quota in bytes