API

/upstream

GET

Returns a list of all the upstreams

{
  "centos-6.0-os-x86_64": "http://localhost/upstream/centos-6.0-os-x86_64"
}

POST

Creates a new upstream

Request Body

{
  "name": "centos-6.0-os-x86_64",
  "path": "poop",
  "type": "yum",
}

Response

  • 201 Created
{
  "uri": "http://localhost/upstream/NAME"
}

Responds with the URI of where the upstream can be fetched.

Acceptable types are:

  • yum
  • apt
  • dir

/upstream/NAME

GET

Returns the upstream

Request

{
  "name": "centos-6.0-os-x86_64",
  "path": "poop",
  "type": "yum",
  "created_at": "2012-03-15T17:45Z"
  "updated_at": "2012-03-15T17:45Z"
}

PUT

Updates or creates the upstream. If the upstream already exists, it will trigger a re-sync.

Request

{
  "name": "centos-6.0-os-x86_64",
  "path": "poop",
  "type": "yum"
}

Response

  • 201 Created on creation.
  • 202 Accepted if we are just re-syncing.
{
  "name": "centos-6.0-os-x86_64",
  "path": "poop",
  "type": "yum",
  "updated_at": "2012-03-15T17:45Z"
}

DELETE

Removes the upstream. Request has no body.

Response

  • 200 OK

/upstream/NAME/packages

GET

Returns a list of all the packages in this upstream.

Response

  • 200 OK
{
  "08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5": {
    "name": "at",
    "filename": "at-3.1.10-42.el6.i686.rpm",
    "shasum": "...",
    "version": "3.1.0"
  }
}

/repo

GET

Returns a list of all the repos.

{
  "centos-6.0-os-x86_64-dev": "http://localhost/repo/centos-6.0-os-x86_64-dev"
}

POST

Creates a new repo

Request Body

{
  "name": "centos-6.0-os-x86_64-dev",
  "type": "yum"
}

Response

  • 201 Created
{
  "uri": "http://localhost/repo/NAME"
}

Responds with the URI of where the repo can be fetched.

Acceptable types are:

  • yum
  • apt
  • dir

/repo/NAME

GET

Returns the repo

Request

{
  "name": "centos-6.0-os-x86_64-dev",
  "type": "yum",
  "updated_at": "2012-03-15T17:45Z"
}

PUT

Updates or creates the repo.

Request

{
  "name": "centos-6.0-os-x86_64-dev",
  "path": "poop",
  "type": "yum"
}

Response

  • 201 OK on creation.
{
  "name": "centos-6.0-os-x86_64-dev",
  "type": "yum",
  "updated_at": "2012-03-15T17:45Z"
}

DELETE

Removes the repo. Request has no body.

Response

  • 200 OK

/repo/NAME/packages

GET

Get the list of packages in this repo

Response

  • 200 OK
{
  "08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5": {
    "name": "at",
    "filename": "at-3.1.10-42.el6.i686.rpm",
    "shasum": "...",
    "version": "3.1.0"
  }
}

PUT

Set the list of packages in this repo. We take two kinds of request bodies:

Request

Set the list manually

{
  "08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5": true
}

Sync with an upstream or other repo

{
  "sync": {
    "name": "centos-6.0-os-x86_64",
    "type": "upstream"
  }
}

Response

  • 200 OK

/package

GET

A list of all the packages.

Response

  • 200 OK
{
  "08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5": "http://localhost/package/08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5",
  "09cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5": "http://localhost/package/09cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5"
}

/package/SHASUM

GET

The information we have about the package

Response

  • 200 OK
{
    "name": "at",
    "filename": "at-3.1.10-42.el6.i686.rpm",
    "shasum": "08cb7b6e5af66461f7c7c3c66e6a7b75cb152c567d8560eda9f8f2b68bcee1e5",
    "version": "3.1.0",
    "upstreams": {
      "centos-6.0-os-x86_64": "http://localhost/upstream/centos-6.0-os-x86_64"
    },
    "repos": {
      "centos-6.0-os-x86_64-dev": "http://localhost/repo/centos-6.0-os-x86_64-dev"
    }
  }
}

Table Of Contents

Previous topic

Installation

This Page