Repository :
http://git.fedorahosted.org/cgit/copr.git
On branch : master
---------------------------------------------------------------
commit 0c5633930a44a1507d572b424d9ef9beb987570c
Author: Valentin Gologuzov <vgologuz(a)redhat.com>
Date: Fri Nov 27 18:34:40 2015 +0100
[frontend] removed old api documentation, added link to the rest api documentation at
the ReadTheDocs.
---------------------------------------------------------------
frontend/coprs_frontend/coprs/templates/api.html | 524 +---------------------
1 files changed, 6 insertions(+), 518 deletions(-)
diff --git a/frontend/coprs_frontend/coprs/templates/api.html
b/frontend/coprs_frontend/coprs/templates/api.html
index 9944d0e..51fa4a1 100644
--- a/frontend/coprs_frontend/coprs/templates/api.html
+++ b/frontend/coprs_frontend/coprs/templates/api.html
@@ -19,7 +19,7 @@
<h1>Copr API</h1>
<h2>API Token</h2>
- <p>In order to access the API, you will need to provide an API token.
+ <p>In order to access the restricted parts of the API, you will need to provide
an API token.
This token is unique, specific to you and <span
style="font-weight:bold;">
should not be shared!</span>.
</p>
@@ -47,522 +47,10 @@ copr_url = {{ ('https://' +
config['PUBLIC_COPR_HOSTNAME'])| fix_url_https_front
<h2>The API</h2>
- <p>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.</p>
-
- <h3>List someone's projects</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/</pre>
- <div>or</div>
- <pre
style="font-size:120%">/api/coprs/?username="<username>"</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – The name of the user whose
projects you'd like
- to list</li>
- </ul>
-
- <h4>Result:</h4>
- <ul>
- <li><b>"repos"</b> – List of projects in
given format:
- <ul>
- <li><b>"yum_repos"</b> – Map of chroots
to yum repository
- URLs. Chroots are in format
-
"<release>-<version>-<architecture>"</li>
- <li><b>"additional_repos"</b> – List of
additional
- repositories that are required for this project</li>
- <li><b>"instructions"</b> –
Installation instructions
- provided by project's owner </li>
- <li><b>"name"</b> – Name of the
project</li>
- <li><b>"description"</b> – Description
provided by project's
- owner </li>
- </ul>
- </ul>
-
- <h4>Example call URL</h4>
- <pre
style="font-size:120%">https://copr.fedoraproject.org/api/co...
-
- <h4>Example results</h4>
- <pre>
- {
- "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"
- }
- ]
- }
- </pre>
-
- <h3>Detail of project</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<projectname>/detail/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – The name of the user whose
projects you'd like
- to show</li>
- <li><b>projectname</b> – The name of the
project</li>
-
- </ul>
-
- <h4>Result:</h4>
- <ul>
- <li><b>"detail"</b> – dictionary with
following keys:
- <ul>
- <li><b>"yum_repos"</b> – Map of chroots
to yum repository
- URLs. Chroots are in format
-
"<release>-<version>-<architecture>"</li>
- <li><b>"additional_repos"</b> – List of
additional
- repositories that are required for this project</li>
- <li><b>"instructions"</b> –
Installation instructions
- provided by project's owner </li>
- <li><b>"name"</b> – Name of the
project</li>
- <li><b>"description"</b> – Description
provided by project's
- owner </li>
- <li><b>"last_modified"</b> – Datetime
(in epoch format) of
- last successfull build.</li>
- </ul>
- </ul>
-
- <h4>Example call URL</h4>
- <pre
style="font-size:120%">https://copr.fedoraproject.org/api/co...
-
- <h4>Example results</h4>
- <pre>
- {
- "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",
- "last_modified": 1386695673
- }
- ]
- }
- </pre>
-
- <h3>Create new project</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/new/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – The name of the user whose
project should be
- created</li>
- </ul>
-
- <h4>Parameters sent by POST:</h4>
- <ul>
- <li><b>name</b> – The name of the project to be
created</li>
- <li><b>chroots</b> – Chroots to be used in the
project, specified as <span
style="font-style:italic">chrootname=y</span>
- (e.g.: <span
style="font-style:italic">fedora-rawhide-x86_64=y&fedora-20-x86_64=y</span>)</li>
- <li><b>repos</b> – A space separated list of
repositories
- that this new project should have access to</li>
- <li><b>initial_pkgs</b> – A space separated list of
initial
- packages to build in this new project</li>
- </ul>
-
- <h3>Delete an entire project</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<projectname>/delete/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – Your username </li>
- <li><b>projectname</b> – Name of the project you want
to delete.</li>
- </ul>
-
- <h4>Parameters sent by POST:</h4>
- <ul>
- <li><b>verify</b> – This needs to be
"yes"</li>
- </ul>
-
-
- <h3>Builds success summary (project monitor)</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<coprname>/monitor/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – Name of the user whose chroot
you'd like to know details of</li>
- <li><b>coprname</b> – Name of the copr whose chroot
you'd like to know details of</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>builds</b> –
- All builds in project.
- </li>
- <li><b>chroots</b> –
- Chroots used in the project
- </li>
- <li><b>packages</b> –
- Aggregated information about built packages.
- </li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
-{
- "builds": [
- {
- "id": 9578,
- "src_pkg":
"https://fedorapeople.org/~vgologuz/python-copr-client-1.43-1.git.0.f84518d.fc20.src.rpm",
- "pkg_version": "1.43",
- "state": "failed",
- "submitted_on": 1408462225,
- "started_on": 1408462318,
- "ended_on": 1408462701,
- "results":
"http://copr-be-dev.cloud.fedoraproject.org/results/vgologuz/copr/",
- "built_packages": [
- "python-copr-client 1.43",
- "python-copr-client-doc 1.43"
- ],
- }
- ],
- "chroots": ["epel-5-x86_64", "epel-7-x86_64",
"fedora-20-x86_64"],
- "packages": [
- {
- "pkg_name": "python-copr-client",
- "pkg_version": null, # not used anymore
- "results": {
- "epel-5-x86_64": {"build_id": 9578, "status":
"failed", "pkg_version": "1.2-1.fc20"],
- "epel-7-x86_64": {"build_id": 9578, "status":
"failed", "pkg_version": "1.2-1.fc20"],
- "fedora-20-x86_64": null # this chroot was never build,
- }
- }
- ]
-}
-
- </pre>
-
- <h3>Add new build</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<projectname>/new_build/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – The name of given
projects's owner</li>
- <li><b>projectname</b> – The name of the project in
which the package
- should be built</li>
- </ul>
-
- <h4>Parameters sent by POST:</h4>
- <ul>
- <li><b>pkgs</b> – Space separated list of package
URLs (SRPMs) to be built</li>
- <li><b>chroots</b> – (Optional) Chroots for this
particular build (in case you do not need all project's chroots), specified as
<span style="font-style:italic">chrootname=y</span>
- </ul>
-
- <h4>Example results</h4>
- <pre>
- {
- "output": "ok",
- "message": "Build was added to log4j.",
- "ids": [5]
- }
- </pre>
-
- <h3>Query build status</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/build_status/<build_id>/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>build_id</b> – Build ID returned by the
<span style="font-style:italic">new_build</span> call</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>status</b> – Status of the build, one of
- <ul>
- <li>canceled</li>
- <li>failed</li>
- <li>pending</li>
- <li>running</li>
- <li>skipped</li>
- <li>starting</li>
- <li>succeeded</li>
- <li>importing</li>
- </ul>
- </li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "status": "pending",
- "output": "ok"
- }
- </pre>
-
- <h3>Query build detail</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/build_detail/<build_id>/</pre>
- <pre
style="font-size:120%">/api/coprs/build/<build_id>/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>build_id</b> – Build ID returned by the
<span style="font-style:italic">new_build</span> call</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>status</b> – Status of the build, one of
- <ul>
- <li>canceled</li>
- <li>failed</li>
- <li>pending</li>
- <li>running</li>
- <li>skipped (This package has already been built
previously)</li>
- <li>starting</li>
- <li>succeeded</li>
- <li>importing</li>
- </ul>
- </li>
- <li><b>project</b> – Name of the project.</li>
- <li><b>owner</b> – Name of the owner.</li>
- <li><b>results</b>– URL with the results.</li>
- <li><b>built_pkgs</b>– List of built
packages.</li>
- <li><b>src_version</b>– Version of the source
package.</li>
- <li><b>chroots</b>– Chroots in which the package has
been build and their build states.</li>
- <li><b>submitted_on</b>– Datetime when the build was
submitted. (in epoch format) </li>
- <li><b>started_on</b>– Datetime when the build
process started. (in epoch format)</li>
- <li><b>ended_on</b>– Datetime when the build
finished. (in epoch format)</li>
- <li><b>src_pkg</b>– URL of the source rpm
package.</li>
- <li><b>submitted_by</b>– User who submitted the
build.</li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "status": "pending",
- "project": "myproject",
- "owner": "msuchy",
- "results":
"http://copr-be.cloud.fedoraproject.org/results/msuchy/myproject/",
- "built_pkgs": [
- "hello 2.8",
- "hello-gui 2.8",
- "super-lib 5.4"
- ],
- "src_version": "2.8",
- "chroots": {
- "fedora-20-i386": "succeeded",
- "fedora-20-x86_64": "succeeded"
- },
- "submitted_on": 1386695673,
- "started_on": 1386695985,
- "ended_on": 1386696854,
- "src_pkg":
"http://asamalik.fedorapeople.org/hello-2.8-1.fc20.src.rpm",
- "submitted_by": "asamalik",
- "output": "ok"
- }
- </pre>
-
- <h3>Cancel build</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/cancel_build/<build_id>/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>build_id</b> – Build ID returned by the
<span style="font-style:italic">new_build</span> call</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>status</b> – Status of the task.
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "status": "Build canceled",
- "output": "ok"
- }
- </pre>
-
- <h3>Copr Modification</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<coprname>/modify/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – Name of the user whose copr
you'd like to modify</li>
- <li><b>coprname</b> – Name of the copr you'd
you'd like to modify</li>
- </ul>
-
- <h4>Parameters sent by POST:</h4>
- <ul>
- <li><b>description</b> – Brief description of the
project (Optional)</li>
- <li><b>instructions</b> – Description of how your
project can be
- installed, etc. (Optional)</li>
- <li><b>repos</b> – URL to additional yum repos, which
can be used
- during build. Space separated. (Optional)</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>description</b> – Same as above</li>
- <li><b>instructions</b> – Same as above</li>
- <li><b>repos</b> – Same as above</li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "output": "ok",
- "repos": "foo",
- "description": "bar",
- "instructions": "baz"
- }
- </pre>
-
- <h3>Chroot Modification</h3>
-
- <p><span style="font-style:italic">Login
required</span></p>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<coprname>/modify/<chrootname>/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – Name of the user whose chroot
you'd like to modify</li>
- <li><b>coprname</b> – Name of the copr whose chroot
you'd like to modify</li>
- <li><b>chrootname</b> – Name of the chroot you'd
like to modify</li>
- </ul>
-
- <h4>Parameters sent by POST:</h4>
- <ul>
- <li><b>buildroot_pkgs</b> – Additional packages to be
always present in minimal
- buildroot</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>buildroot_pkgs</b> – Same as above</li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "output": "ok",
- "buildroot_pkgs": "scl-utils-build"
- }
- </pre>
-
- <h3>Chroot details</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/<username>/<coprname>/detail/<chrootname>/</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>username</b> – Name of the user whose chroot
you'd like to know details of</li>
- <li><b>coprname</b> – Name of the copr whose chroot
you'd like to know details of</li>
- <li><b>chrootname</b> – Name of the chroot you'd
like to know details of</li>
- </ul>
-
- <h4>Result</h4>
- <ul>
- <li><b>buildroot_pkgs</b> – Additional packages to be
always present in minimal
- buildroot</li>
- </ul>
-
- <h4>Example result</h4>
- <pre>
- {
- "output": "ok",
- "buildroot_pkgs": "scl-utils-build"
- }
- </pre>
-
- <h3>Search for project</h3>
-
- <h4>URL:</h4>
- <pre
style="font-size:120%">/api/coprs/search/<project>/</pre>
- <div>or</div>
- <pre
style="font-size:120%">/api/coprs/?search="<project>"</pre>
-
- <h4>URL parameters:</h4>
- <ul>
- <li><b>project</b> – The text of the project whose
you'd like
- to find</li>
- </ul>
-
- <h4>Result:</h4>
- <ul>
- <li><b>"repos"</b> – List of repos in given
format:
- <ul>
- <li><b>"username"</b> – Name of the
user</li>
- <li><b>"coprname"</b> – Name of the
copr</li>
- <li><b>"description"</b> – Description
of the copr</li>
- </ul>
- </ul>
-
- <h4>Example call URL</h4>
- <pre
style="font-size:120%">https://copr.fedoraproject.org/api/co...
-
- <h4>Example results</h4>
- <pre>
- {
- "output": "ok",
- "repos": [
- {
- "username": "ignatenkobrain",
- "coprname": "test",
- "description": "Tests"
- },
- "username": "ignatenkobrain",
- "coprname": "tests",
- "description": ""
- },
- {
- "username": "msuchy",
- "coprname": "tests",
- "description": "Copr testing repository, just for test various
builds."
- }
- ]
- }
- </pre>
-
+ <p> Api documentation is available at:
+ <a
href="http://copr-rest-api.readthedocs.org/en/latest/index.html"...
+
http://copr-rest-api.readthedocs.org/en/latest/index.html
+ </a>
+ </p>
</div>
{% endblock %}