# Zero-OS Hub API documentation version 1.0

### /repositories

#### /repositories get

get

List all repositories (users) found

#### get /repositories

List all repositories (users) found

## HTTP status code 200

### Body

Media type: application/json

Type: array of Repository

Items: Repository

- official: required (string)
- name: required (string)

### /flist

#### /flist get

get

List all flist found, sorted alphabetically

#### get /flist

List all flist found, sorted alphabetically

## HTTP status code 200

### Body

Media type: application/json

Type: array of string

Example:

    [
      "ahamdy/js9_ubuntu1.flist",
      "chaddad/js9f.flist",
      "gig-official-apps/ardb-forestdb.flist",
      "gig-official-apps/ardb-lmdb.flist",
      "xtremx/ubuntu_caddy.flist",
      "zaibon/flist.flist"
      ...
    ]

#### /flist/{username} get

get

Get available flist for a specific user

#### get /flist/{username}

Get available flist for a specific user

### URI Parameters

- username: required (string)

## HTTP status code 200

### Body

Media type: application/json

Type: object

Properties

- name: required (string)
- updated: required (integer)
- size: required (string)
- type: required (one of regular, symlink)
- target: required (string)

  in case it is a symlink, target of the link

Example:

    {
      {"updated": 1507149609, "type": "regular", "size": "84.41 KB", "name": "0-orchestrator-1.1.0-alpha-7.flist"},
      {"updated": 1493109577, "type": "regular", "size": "9.79 KB", "name": "ardb-forestdb.flist"},
      {"updated": 1507137785, "type": "regular", "size": "4.75 KB", "name": "ardb-lmdb.flist"},
      {"updated": 1505824570, "type": "symlink", "size": "--", "name": "linked.flist", "target": "ardb-lmdb.flist"}
      ...
    }

## HTTP status code 404

User (repository) not found

#### /flist/{username}/{flist} get

get

Get information about a specific flist

#### get /flist/{username}/{flist}

Get information about a specific flist

### URI Parameters

- username: required (string)
- flist: required (string)

## HTTP status code 200

### Body

Media type: application/json

Type: object

Properties

- content: required (array of Entry)

  Items: Entry

  - path: required (string)
  - size: required (integer)
- regular: required (integer)
- directory: required (integer)
- symlink: required (integer)
- special: required (integer)

Example:

    {
      'content': [
        {"path": "/var/lib/dpkg/alternatives/view", "size": 130},
        {"path": "/var/lib/dpkg/triggers", "size": 0},
        {"path": "/var/lib/dpkg/triggers/File", "size": 130},
        {"path": "/var/lib/dpkg/triggers/resolvconf-enable-updates", "size": 130},
        {"path": "/var/lib/dpkg/triggers/Lock", "size": 130},
        {"path": "/var/lib/dpkg/triggers/ldconfig", "size": 130},
        {"path": "/var/lib/dpkg/triggers/Unincorp", "size": 130},
        {"path": "/var/lib/dpkg/triggers/update-initramfs", "size": 130},
        ...
      ],
      'regular': 5,
      'directory': 3,
      'symlink': 4,
      'special': 2
    }

## HTTP status code 404

### Body

Media type: application/json

Type: object

Example:

    {
      "message": "source not found",
      "status": "error"
    }

#### /flist/me/upload post

post

Upload a .tar.gz file and insert it to the hub

#### post /flist/me/upload

Upload a .tar.gz file and insert it to the hub

Secured by cookies

Cookie authentification

### Body

Media type: multipart/form-data

Type: object

Properties

- file: required (file)

  The file to be uploaded

## HTTP status code 200

File renamed

## HTTP status code 401

Not authentificated

## HTTP status code 404

File not found

# Secured by cookies

### Headers

- cookies: required (string)

#### /flist/me/merge post

post

Merge multiple flist together

#### post /flist/me/merge

Merge multiple flist together

Secured by cookies

Cookie authentification

## HTTP status code 200

Files merged

## HTTP status code 401

Not authentificated

## HTTP status code 404

Flist not found

# Secured by cookies

### Headers

- cookies: required (string)

#### /flist/me/{flist} delete get

delete

Delete one of your flist

get

See '/flist/{user}/{flist}' GET endpoint

#### delete /flist/me/{flist}

Delete one of your flist

Secured by cookies

Cookie authentification

### URI Parameters

- flist: required (string)

## HTTP status code 200

File deleted

## HTTP status code 401

Not authentificated

## HTTP status code 404

File not found

# Secured by cookies

### Headers

- cookies: required (string)

#### get /flist/me/{flist}

See '/flist/{user}/{flist}' GET endpoint

Secured by cookies

Cookie authentification

### URI Parameters

- flist: required (string)

## HTTP status code 200

### Body

Media type: application/json

Type: object

Properties

- content: required (array of Entry)

  Items: Entry

  - path: required (string)
  - size: required (integer)
- regular: required (integer)
- directory: required (integer)
- symlink: required (integer)
- special: required (integer)

Example:

    {
      'content': [
        {"path": "/var/lib/dpkg/alternatives/view", "size": 130},
        {"path": "/var/lib/dpkg/triggers", "size": 0},
        {"path": "/var/lib/dpkg/triggers/File", "size": 130},
        {"path": "/var/lib/dpkg/triggers/resolvconf-enable-updates", "size": 130},
        {"path": "/var/lib/dpkg/triggers/Lock", "size": 130},
        {"path": "/var/lib/dpkg/triggers/ldconfig", "size": 130},
        {"path": "/var/lib/dpkg/triggers/Unincorp", "size": 130},
        {"path": "/var/lib/dpkg/triggers/update-initramfs", "size": 130},
        ...
      ],
      'regular': 5,
      'directory': 3,
      'symlink': 4,
      'special': 2
    }

## HTTP status code 404

### Body

Media type: application/json

Type: object

Example:

    {
      "message": "source not found",
      "status": "error"
    }

# Secured by cookies

### Headers

- cookies: required (string)

#### /flist/me/{flist}/rename/{target} get

get

Rename one of your flist

#### get /flist/me/{flist}/rename/{target}

Rename one of your flist

Secured by cookies

Cookie authentification

### URI Parameters

- flist: required (string)
- target: required (string)

## HTTP status code 200

File renamed

## HTTP status code 401

Not authentificated

## HTTP status code 404

Source file not found

# Secured by cookies

### Headers

- cookies: required (string)

#### /flist/me/{flist}/link/{linkname} get

get

Create a flist link (symlink) updatable

#### get /flist/me/{flist}/link/{linkname}

Create a flist link (symlink) updatable

Secured by cookies

Cookie authentification

### URI Parameters

- flist: required (string)
- linkname: required (string)

## HTTP status code 200

Link created

## HTTP status code 401

Not authentificated

## HTTP status code 404

Source file not found

# Secured by cookies

### Headers

- cookies: required (string)