wiki:UGREST-Packages
Last modified 2 years ago Last modified on 01/13/12 19:03:40

Packages

Once you get a repository created you can start managing packages. Packages can be created on their own or created as members of a repository

Base URL Path: /packages/


List All Available Packages

List all available packages

Path: /packages/

Method: GET

Parameters:

None

Authentication:

username/pass or Consumer Certificate

Filters:

None

Success: 200 OK
Sample Response:

[
    {
        "_id": "2c24a865-0089-4c1a-8cac-77146a5fe65f", 
        "_ns": "packages", 
        "arch": "noarch", 
        "buildhost": "jwm-devel.home", 
        "checksum": {
            "sha256": "7b6d84f97ec0e6917f7a4cc3f14e1db7c8df6d1c14dcc3c528de5ba73cd1fb74"
        }, 
        "description": "Test package.  Nothing to see here.", 
        "download_url": "https://localhost//pulp/repos/test_bandwidth_repo/pulp-large_1mb_test-packageC-0.1.1-1.fc14.noarch.rpm", 
        "epoch": "0", 
        "filename": "pulp-large_1mb_test-packageC-0.1.1-1.fc14.noarch.rpm", 
        "group": "Development/Libraries", 
        "id": "2c24a865-0089-4c1a-8cac-77146a5fe65f", 
        "license": "MIT", 
        "name": "pulp-large_1mb_test-packageC", 
        "provides": [
            "pulp-large_1mb_test-packageC", 
            "config(pulp-large_1mb_test-packageC)"
        ], 
        "release": "1.fc14", 
        "repo_defined": true, 
        "repoids": [
            "test_bandwidth"
        ], 
        "requires": [], 
        "size": 1051164, 
        "vendor": "", 
        "version": "0.1.1"
    }]

Error: None


Create

Create a new package

Path: /packages/

Method: PUT

Parameters:

  • name: package name
  • epoch: package epoch
  • version: package version
  • release: package release
  • arch: package architecture
  • description: package description
  • checksum_type: type of package checksum
  • checksum: package checksum
  • filename: package filename

Authentication:

username/pass

Filters:

None

Success: 201 Created
Sample Response:

{
    "_id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "_ns": "packages", 
    "arch": "i386", 
    "buildhost": "", 
    "checksum": {
        "sha256": "6f619869dd4b83c12460558d85d14590f638a72717824136baacf6538fa114bb"
    }, 
    "description": "Description for test_api_example_package_name_3109", 
    "download_url": null, 
    "epoch": "0", 
    "filename": "test_api_example_package_name_3109.rpm", 
    "group": "", 
    "id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "license": "", 
    "name": "test_api_example_package_name_3109", 
    "provides": [], 
    "release": "1", 
    "repo_defined": false, 
    "repoids": [], 
    "requires": [], 
    "size": null, 
    "vendor": null, 
    "version": "1"
}

Error: 409 Conflict if there is a package with the same: name, version, revision, epoch, arch, and checksum


Information by Package ID

Get package information, given a package id

Path: /packages/<package id>/

Method: GET

Parameters:

None

Authentication:

username/pass or Consumer Certificate

Filters:

None

Success: 200 OK
Sample Response:

{
    "_id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "_ns": "packages", 
    "arch": "i386", 
    "buildhost": "", 
    "checksum": {
        "sha256": "6f619869dd4b83c12460558d85d14590f638a72717824136baacf6538fa114bb"
    }, 
    "description": "Description for test_api_example_package_name_3109", 
    "download_url": null, 
    "epoch": "0", 
    "filename": "test_api_example_package_name_3109.rpm", 
    "group": "", 
    "id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "license": "", 
    "name": "test_api_example_package_name_3109", 
    "provides": [], 
    "release": "1", 
    "repo_defined": false, 
    "repoids": [], 
    "requires": [], 
    "size": null, 
    "vendor": null, 
    "version": "1"
}

Error: 404 Not Found if there is no such package


Information by Package NVREA

Get package information, given a package name, version, release, epoch, and arch

Status: complete

Path: /packages/<name>/<version>/<release>/<epoch>/<arch>/

Method: GET

Parameters:

None

Authentication:

username/pass or Consumer Certificate

Filters:

None

Success: 200 OK
Sample Reponse:

{
    "_id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "_ns": "packages", 
    "arch": "i386", 
    "buildhost": "", 
    "checksum": {
        "sha256": "6f619869dd4b83c12460558d85d14590f638a72717824136baacf6538fa114bb"
    }, 
    "description": "Description for test_api_example_package_name_3109", 
    "download_url": null, 
    "epoch": "0", 
    "filename": "test_api_example_package_name_3109.rpm", 
    "group": "", 
    "id": "7451b6fa-8c3e-41a8-a89a-3143b20c93d4", 
    "license": "", 
    "name": "test_api_example_package_name_3109", 
    "provides": [], 
    "release": "1", 
    "repo_defined": false, 
    "repoids": [], 
    "requires": [], 
    "size": null, 
    "vendor": null, 
    "version": "1"
}

Error: 404 Not Found if there is no such package


Delete a Package

Delete a single package

Status: complete

Path: /packages/<package id>/

Method: DELETE

Parameters:

None

Authentication:

username/pass

Filters:

None

Success: 200 OK

True

Error: 404 Not Found if there is no such package