Project

Project resource represents copr projects and operations with them.

Structure of the project entity

An example:

{
    "description": "A recent stable release of Ruby with Rails 3.2.8 and ... ",
    "disable_createrepo": false,
    "repos": [
      "http://copr-be.cloud.fedoraproject.org/results/msuchy/scl-utils/epel-6-$basearch/",
      "http://copr-be.cloud.fedoraproject.org/results/rhscl/httpd24/epel-6-$basearch/",
    ],
    "contact": null,
    "owner": "rhscl",
    "build_enable_net": true,
    "instructions": "",
    "homepage": null,
    "id": 479,
    "name": "ruby193"
}

Project fields

Field Type Can edit? Description
id number no unique identifier
owner string no username of the project owner
group string no
name of the group which owns the project, value is null for non-group projects
  • MAY be specified during a project creation to create a group managed project
name string no
name of the project
  • MUST be specified during a project creation
description string yes project description
instructions string yes installation instructions
homepage string(URL) yes project homepage URL
contact string(URL or email) yes contact with the project maintainer
disable_createrepo bool yes disables automatic repository metadata generation
build_enable_net bool yes set default value for new builds option enable_net
repos list of string yes list of additional repositories to be enabled during the build

List projects

GET /api_2/projects

Returns a list of Copr projects according to the given query parameters

Query Parameters:
 
  • search_query (str) – filter project using full-text search
  • owner (str) – select only projects owned by this user
  • group (str) – select only projects owned by this group
  • name (str) – select only projects with this name
  • offset (int) – offset number, default value is 0
  • limit (int) – limit number, default value is 100
Status Codes:

Example request:

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

Response:

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

{
  "_links": {
    "self": {
      "href": "/api_2/projects"
    }
  },
  "projects": [
    {
      "project": {
        "description": "Lightweight buildsystem - upstream releases. Usually build few days before it land in Fedora.",
        "disable_createrepo": false,
        "repos": [],
        "contact": null,
        "owner": "msuchy",
        "build_enable_net": false,
        "instructions": "See https://fedorahosted.org/copr/ for more details.",
        "homepage": null,
        "id": 1,
        "name": "copr"
      },
      "_links": {   }
    },
  ]
}

Create new project

POST /api_2/projects

REQUIRE AUTH

Creates new Copr project.

Additionally to what is described before in Project fields, the user could specify a field chroots, which contains a list of chroots to be enabled. Available chroot names could be obtained from Mock Chroot

Response Headers:
 
  • Location – contains URL to the newly created project entity
Status Codes:

Example request:

POST /api_2/projects HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string
Content-Type: application/json

{
    "disable_createrepo": false,
    "build_enable_net": true,
    "name": "foobar",
    "chroots": [
        "fedora-22-x86_64",
        "fedora-22-i386",
    ]
}

Response:

HTTP/1.1 201 CREATED
Location: /api_2/projects/<new project id>

Get project details

GET /api_2/projects/(int: project_id)

Returns details about given Copr project

Parameters:
  • project_id (int) – a unique identifier of the Copr project.
Query Parameters:
 
  • show_builds (bool) – include Build entities owned by this project in the result, default is False
  • show_chroots (bool) – include Project Chroot sub-resources in the result, default is False
Status Codes:

Example request

GET /api_2/projects/2482?show_chroots=True&show_builds=True HTTP/1.1
Host: copr.fedoraproject.org

Response

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

{
    "project": {
        "description": "A simple KDE respin",
        "disable_createrepo": false,
        "repos": [],
        "contact": null,
        "owner": "jmiahman",
        "build_enable_net": true,
        "instructions": "",
        "homepage": null,
        "id": 2482,
        "name": "Synergy-Linux"
    },
    "project_chroots": [
        {
            "chroot": {
                "comps": null,
                "comps_len": 0,
                "buildroot_pkgs": [],
                "name": "fedora-19-x86_64",
                "comps_name": null
            }
            "_links": {}
        },
        { }
    ],
    "project_builds": [
        {
            "_links": { },
            "build": {
                "enable_net": true,
                "source_metadata": {
                    "url": "http://miroslav.suchy.cz/copr/copr-ping-1-1.fc20.src.rpm"
                },
                "submitted_on": 1422379448,
                "repos": [],
                "results": "https://copr-be.cloud.fedoraproject.org/results/jmiahman/Synergy-Linux/",
                "started_on": 1422379466,
                "source_type": 1,
                "state": "succeeded",
                "source_json": "{\"url\": \"http://dl.kororaproject.org/pub/korora/releases/21/source/korora-welcome-21.6-1.fc21.src.rpm\"}",
                "ended_on": 1422379584,
                "timeout": 21600,
                "pkg_version": "21.6-1.fc21",
                "id": 69493,
                "submitter": "asamalik"
            }
        },
        {  }
    ],
    "_links": {
        "self": {
          "href": "/api_2/projects/2482?show_builds=True&show_chroots=True"
        },
        "chroots": {
          "href": "/api_2/projects/2482/chroots"
        },
        "builds": {
          "href": "/api_2/builds?project_id=2482"
        }
    }
}

Delete project

DELETE /api_2/projects/(int: project_id)

REQUIRE AUTH

Deletes Copr project

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

Example request:

DELETE /api_2/projects/1 HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string

Response

HTTP/1.1 204 NO CONTENT

Modify project

PUT /api_2/projects/(int: project_id)

REQUIRE AUTH

Updates Copr project.

Note

Project chroots can not be enabled or disabled here. Use Project Chroot resource for this purpose.

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

Example request:

PUT /api_2/projects/1 HTTP/1.1
Host: copr.fedoraproject.org
Authorization: Basic base64=encoded=string
Content-Type: application/json

{
    "disable_createrepo": true,
    "build_enable_net": false,
    "instructions": "foobar"
}

Response

HTTP/1.1 204 NO CONTENT