Project Chroot

Projects Chroots allows to enable and disable target chroots and modify project settings dedicated for specific chroots.

Structure of the project chroot entity

{
    "comps": null,
    "comps_len": 0,
    "buildroot_pkgs": [
        "scl-build-utils",
        "foobar"
    ],
    "name": "fedora-22-i386",
    "comps_name": null
}

Project Chroot fields

Field Type Can edit? Description
name string no chroot name
buildroot_pkgs list of strings yes packages to be installed into the buildroot
comps string yes content of the comps.xml
comps_name string yes name of the uploaded comps file
comps_len int no size of the uploaded comps file (bytes)

List project chroots

GET /api_2/projects/(int: project_id)/chroots

Returns a list of project chroots

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
Status Codes:

Example request

GET /api_2/projects/2482/chroots HTTP/1.1
Host: copr.fedoraproject.org

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "chroots": [
    {
      "chroot": {
        "comps": null,
        "comps_len": 0,
        "buildroot_pkgs": [],
        "name": "fedora-21-x86_64",
        "comps_name": null
      },
      "_links": {
        "project": {
          "href": "/api_2/projects/2482"
        },
        "self": {
          "href": "/api_2/projects/2482/chroots/fedora-21-x86_64"
        }
      }
    },
    { }
  ],
  "_links": {
    "self": {
      "href": "/api_2/projects/2482/chroots"
    }
  }
}

Enable chroot for project

POST /api_2/projects/(int: project_id)/chroots

REQUIRE AUTH

Enables chroot for the Copr project. Available chroot names can be obtained from Mock Chroot resource.

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
Response Headers:
 
  • Location – contains URL to the enabled project chroot
Status Codes:

Example request:

POST  HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string
Accept: application/json

{
    "buildroot_pkgs": ["foo", "bar"],
    "name": "fedora-22-x86_64"
}

Response:

HTTP/1.1 201 CREATED
Location: /api_2/projects/2482/chroots/fedora-22-x86_64

Get project chroot details

GET /api_2/projects/(int: project_id)/chroots/(str: chroot_name)

Returns details about Copr project

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
  • chroot_name (str) – name of the project chroot
Status Codes:
  • 200 OK – no error
  • 404 Not Found – project not found or chroot isn’t enabled for the project

Example request

GET /api_2/projects/2482/chroots/fedora-22-x86_64 HTTP/1.1
Host: copr.fedoraproject.org
Accept: application/json

Response

HTTP/1.1 200 OK
Content-Type: application/json

{
  "chroot": {
    "comps": null,
    "comps_len": 0,
    "buildroot_pkgs": [
      "foo",
      "bar"
    ],
    "name": "fedora-22-x86_64",
    "comps_name": null
  },
  "_links": {
    "project": {
      "href": "/api_2/projects/2482"
    },
    "self": {
      "href": "/api_2/projects/2482/chroots/fedora-22-x86_64"
    }
  }
}

Disable chroot for project

DELETE /api_2/projects/(int: project_id)/chroots/(str: chroot_name)

REQUIRE AUTH

Disables chroot for the Copr project

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
  • chroot_name (str) – name of the project chroot
Status Codes:

Example request:

DELETE /api_2/projects/2482/chroots/fedora-22-x86_64  HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string

Response

HTTP/1.1 204 NO CONTENT

Modify project chroot

PUT /api_2/projects/(int: project_id)/chroots/(str: chroot_name)

REQUIRE AUTH

Updated project chroot settings

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
  • chroot_name (str) – name of the project chroot
Status Codes:

Example request:

PUT /api_2/projects/2482/chroots/fedora-22-x86_64  HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string

{
    "buildroot_pkgs": []
}

Response

HTTP/1.1 204 NO CONTENT