{% extends "layout.html" %} {% block title %}API for Coprs{% endblock %} {% block header %}API for the Coprs Build System{% endblock %} {% block body %} {% if error %}
Error: {{ error }}
{% endif %}In order to access the API, you will need to provide an API token. This token is unique, specific to you and should not be shared!.
The API token is valid for {{ config['API_TOKEN_EXPIRATION'] }} days after it has been generated.
{% if g.user %}Your information (you can directly paste this into ~/.config/copr):
[copr-cli] login = {{ g.user.api_login }} username = {{ g.user.name }} token = {{ g.user.api_token }} copr_url = http://copr.fedoraproject.org # expiration date: {{ g.user.api_token_expiration }}{% else %}
You need to be logged in to see your API token.
{% endif %}To make an API call to Copr, make a request to URL corresponding to given call (URLs are listed below). Parameters are denoted by angle brackets. Result is represented as JSON map with "output": "ok" key-value pair on success or "output": "notok" on failure. The rest of the map represents result of the call and is described below for individual calls.
/api/coprs/<username>/
/api/coprs/?username="<username>"
https://copr.fedoraproject.org/api/coprs/jdaniels/
{ "output": "ok", "repos": [ { "yum_repos": { "fedora-19-i686": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-i686/" "fedora-19-x86_64": "https://copr-be.cloud.fedoraproject.org/results/jdaniels/log4j/fedora-19-x86_64/" }, "additional_repos": "", "instructions": "", "name": "log4j", "description": "Java logging package" } ] }
Login required
/api/copr/<username>/new/
Login required
/api/copr/<username>/<coprname>/new_build/
{ "output": "ok", "message": "Build was added to log4j.", "id": 5 }
Login required
/api/copr/build_status/<build_id>/
{ "status": "pending", "output": "ok" }