openSUSE API

Version: 0.1

Only authenticated users are allowed to access the API. Authentication is done by sending a Basic HTTP Authorisation header.

All names aren't allowed to contain spaces, slashes or colons.

Table of Contents

About

Host: api.opensuse.org

GET /about

Get information about API.

Result: Example Schema

User data

Host: api.opensuse.org

GET /person/<userid>

Arguments:

Read user data.

Result: Example Schema

PUT /person/<userid>

Arguments:

Write user data.

Body: Example Schema

Result: Example Schema

Sources

Host: api.opensuse.org

Projects

GET /source/

Read list of projects.

Result: Example Schema

GET /source/<project>/_meta

Arguments:

Read project meta file.

Result: Example Schema

PUT /source/<project>/_meta

Arguments:

Write project meta file.

Body: Example Schema

Result: Example Schema

DELETE /source/<project>

Arguments:

Deletes specified project. All packages of this project are deleted as if a DELETE request were issued for each package.

Parameters: force: If force = 1, the project is deleted even if repositories of other projects include a path to a repository from this project. The path in the other repository is replaced by one pointing to 'deleted/standard', preventing the build and publishing of the other repository.

Result: Example Schema

GET /source/<project>/_config

Arguments:

Read project configuration

Result: configuration as text/plain

PUT /source/<project>/_config

Arguments:

Change project configuration

Result: Example Schema

GET /source/<project>/_pattern

Arguments:

Get list of all patterns set up for this project

Result: Example Schema

GET /source/<project>/_pattern/<patternfile>

Arguments:

Get pattern

Result: pattern

PUT /source/<project>/_pattern/<patternfile>

Arguments:

Write pattern

Body: pattern

Result: Example Schema

DELETE /source/<project>/_pattern/<patternfile>

Arguments:

Remove pattern

Result: Example Schema

GET /source/<project>/_pubkey

Arguments:

Get project GPG key. If the project has no own key (default), it uses the first available one in the namespace hierarchy, ending at the global buildservice key.

Result: gpgkey

DELETE /source/<project>/_pubkey

Arguments:

Removes the current gpg key. Has no effect if no key is set.

Result: Example Schema

POST /source/<project>?cmd=createkey

Arguments:

Generate a new gpg key. If the project already has an own gpg key, the old key is discarded.0

Result: Example Schema

Packages

GET /source/<project>/<package>/_meta

Arguments:

Read project meta data.

Result: Example Schema

PUT /source/<project>/<package>/_meta

Arguments:

Write project meta data. Writing of the project meta data commits the packages contained in the project to the build backend.

Body: Example Schema

Result: Example Schema

DELETE /source/<project>/<package>

Arguments:

Deletes specified package including all source files

Result: Example Schema

GET /source/<project>/<package>/_history

Arguments:

Get package commit history

Result: revisionlist

POST /source/<project>/<package>?cmd=diff

Arguments:

Create a source diff

rev: revision of new package, optional oproject: old project, optional opackage: old package, optional orev: old revision, optional

Result: diff as text/plain

POST /source/<project>/<package>?cmd=branch

Arguments:

Create a source link from a package of an existing project to a new subproject of the requesters home project, if not specified elsewhere via the target_ parameters. The default target is home::branches:/

target_project: target project name, optional target_package: target package name, optional

Result: Example Schema

POST /source/<project>/<package>?cmd=branch

Arguments:

Create a source link from a package of an existing project to a new subproject of the requesters home project (home::branches:). A possible defined devel project in he package meta data gets ignored.

ignoredevel: bool, optional

Result: Example Schema

POST /source/<project>/<package>?cmd=createSpecFileTemplate

Arguments:

Create template for RPM SPEC file. Returns an error, if the SPEC file already exists.

Result: Example Schema

POST /source/<project>/<package>?cmd=commit

Arguments:

Commits package changes to buildservice

rev: revision, mandatory comment: comment, optional user: user, optional

Result: Example Schema

POST /source/<project>/<package>?deleteuploadrev

Arguments:

Removes all changes made to the upload revision and reverts to last revision

none

Result: Example Schema

Source files

GET /source/<project>/<package>

Arguments:

Get directory listing of all source files in the package

rev: package source revision, optional linkrev: linked revision, optional expand: expand links, optional lastworking: auto detect last working link revision, optional view: The "cpio" view will stream all files as cpio, optional extension: filter for file extension, optional

GET /source/<project>/<package>/<filename>

Arguments:

Read source file.

Result: Content of file

PUT /source/<project>/<package>/<filename>

Arguments:

Write source file.

rev: empty or upload revision, optional comment: comment, optional keeplink: bool, optional

Body: Content of file

Result: Example Schema

DELETE /source/<project>/<package>/<filename>

Arguments:

Delete source file.

Result: Example Schema

Attribute definition api

Host: api.opensuse.org

GET /attribute/

List all namespaces

Result: Example Schema

GET /attribute/<namespace>/

Arguments:

List all attributes under given namespace

Result: Example Schema

GET /attribute/<namespace>/_meta

Arguments:

shows namespace setup

Result: Example Schema

DELETE /attribute/<namespace>/_meta

Arguments:

Delete a attribute namespace and all attributes below

Result: Example Schema

PUT /attribute/<namespace>/_meta

Arguments:

change attribute namespace meta

Body: attribute namespace meta data

Result: Example Schema

GET /attribute/<namespace>/<name>/_meta

Arguments:

shows attribute setup

Result: Example Schema

DELETE /attribute/<namespace>/<name>/_meta

Arguments:

Delete a attribute and all its values in projects or packages

Result: Example Schema

PUT /attribute/<namespace>/<name>/_meta

Arguments:

change attribute meta

Body: attribute meta data

Result: Example Schema

Build Results

Host: api.opensuse.org

GET /build/

List all repositories

Result: Example Schema

GET /build/_workerstatus

Lists all running jobs, waiting jobs, status of the backend services and general statistics.

Result: worker status and

GET /build/<project>

Arguments:

List all repositories of the specified project

Result: Example Schema

GET /build/<project>/<repository>

Arguments:

List all architectures of the specified project repository

Result: Example Schema

GET /build/<project>/<repository/<arch>

Arguments:

List all packages used in this project repository for given architecture.

Result: Example Schema

Binaries

GET /build/<project>/<repository>/<arch>/<package>

Arguments:

Get list of binaries built by the sources of the given package

Result: binarylist

GET /build/<project>/<repository>/<arch>/<package>/<binaryname>

Arguments:

Get single binary from build results of given package

Result: binary file

GET /build/<project>/<repository>/<arch>/_builddepinfo?package="package_name"

Arguments:

Shows all build dependencies of a package, a change in any of them will trigger a build.

Result: build dependencies

GET /build/<project>/<repository>/<arch>/_jobhistory?package="package_name"

Arguments:

Get the build log of all finished builds in this repository, including time and trigger reason. Optional filtering for a package is possible.

Result: jobhistory

GET /build/<project>/<repository>/<arch>/_repository

Arguments:

Get list of binaries in given repository (binaries produced by all packages of the project)

Result: binarylist

POST /build/<project>/<repository>/<arch>/_repository?match=

Arguments:

Get list of binaries in given repository (binaries produced by all packages of the project), filtered by given match

Result: binarylist

GET /build/<project>/<repository>/<arch>/_repository/<binaryname>

Arguments:

Get single binary from the given repository

Result: binary file

Status

GET /build/<project>/_result

Arguments:

Return build results for the packages, architectures and repositories specified by the parameters. If no parameters are given, all results for the project are returned.

The view parameter specifies which sections are included in the results. view=summary includes the summary of the status values. view=status includes detailed status information. view=binarylist includes the list of generated binary files. If no view parameter is given, view=status is assumed. To combine views the parameter can be given multiple times.

package: package name, optional, multiple arch: architecture, optional, multiple repository: name of repository, optional, multiple view: summary | status | binarylist lastbuild: bool, optional

Result: Example

GET /build/<project>/<repository>/<arch>/<package>/_history

Arguments:

Get build history

Result: Example Schema

GET /build/<project>/<repository>/<arch>/<package>/_reason

Arguments:

Detailed reason, why the last build got triggered. This may be caused by a source change, meta change (binary package below changed) or release number sync. A user triggered build will show up as source change.

Result: build

GET /build/<project>/<repository>/<arch>/<package>/_status

Arguments:

Get build status of the specified project/package/repo/arch combination

Result: buildstatus

GET /build/<project>/<repository>/<arch>/<package>/_log

Arguments:

Get build log.

Result: Build log as text file.

Control

POST /build/<project>?cmd=rebuild

Arguments:

Triggers package rebuild for the repositories/architectures of the package specified by the parameters. If no parameters are given, all packages of the project are completely rebuilt.

Possible values for the code parameter are:

succeeded - build succeeded failed - build failed disabled - build is disabled in package config excluded - build is excluded in spec file scheduled - package is ready to be built building - package is building on a worker broken - package source is bad (i.e. no specfile) expansion error - build needs unavailable binary packages

package: package name, optional, multiple arch: architecture, optional, multiple repository: name of repository, optional, multiple code: build status code, optional, multiple

Result: Example Schema

POST /build/<project>?cmd=abortbuild

Arguments:

Kill all running builds, marking them as failed

see cmd=rebuild

POST /build/<project>?cmd=restartbuild

Arguments:

Restart all running builds

see cmd=rebuild

POST /build/<project>?cmd=wipe

Arguments:

Delete all binary packages from the packages

see cmd=rebuild

Local Build

GET /build/<project>/<repository>/<arch>/<package>/_buildinfo

Arguments:

Get build information for local building

Result: buildinfo

POST /build/<project>/<repository>/<arch>/<package>/_buildinfo

Arguments:

Get build info for local building using the POSTed specfile. can be "_repository", if the designated package does not yet exist on the server. Usefull for local build test before committing the initial package.

Body: specfile

Result: buildinfo

Repository Information

GET /build/<project>/<repository>/<arch>/_all/

Arguments:

Returns list of binaries contained in the specified repository

Result: Example

GET /build/<project>/<repository>/<arch>/_all/<binaryname>

Arguments:

Returns binary

Result: binary file

GET /build/<project>/<repository>/<arch>/_binarylist

Arguments:

Returns list of binaries contained in the specified repository

Result: Example

GET /build/<project>/<repository>/<arch>/_builddepinfo

Arguments:

Returns dependency information of packages in the specified repository. One or more packages can be specified with the 'package' parameter. By default dependencies for all packages are returned.

Result: builddepinfo

GET /build/<project>/<repository>/<arch>/_buildinfo

Arguments:

???

GET /build/<project>/<repository>/_buildconfig

Arguments:

???

Search

GET /search/project

Searches for project metadata using xpath. A xpath predicate has to be specified using the match parameter. The predicate will be used in this expression: /project[]. Only complete meta files will be returned.

match: xpath predicate, mandatory

Result: collection

GET /search/project/id

Searches for project metadata analogous to /search/project, only the root element is returned without any children.

match: xpath predicate, mandatory

Result: collection

GET /search/package

Searches for packate metadata using xpath. A xpath predicate has to be specified using the match parameter. The predicate will be used in this expression: /package[]. Only complete meta files will be returned.

match: xpath predicate, mandatory

Result: collection

GET /search/package/id

Searches for package metadata analogous to /search/package, only the root element is returned without any children.

match: xpath predicate, mandatory

Result: collection

GET /search/published/binary/id

Search for published binary packages

match: xpath predicate, mandatory

Result: collection

GET /search/published/pattern/id

Search for published patterns

match: xpath predicate, mandatory

Result: collection

Published binary package tree

GET /published

List of published projects

Result: Example Schema

GET /published/<project>

Arguments:

List of repositories of published projects

Result: Example Schema

GET /published/<project>/<repository>

Arguments:

List of published repositories for the given project/repo

Result: Example Schema

GET /published/<project>/<repository>/<arch>

Arguments:

List of published binaries for the given project/repo/arch

Result: Example Schema

GET /published/<project>/<repository>/<arch>/<binary>

Arguments:

Download published binary NOTE: use this only if you absolutely have to as it doesn't use the redirector

Result: binary

GET /published/<project>/<repository>/<arch>/<binary>?view=ymp

Arguments:

Generate an ymp pattern that includes the needed repositories to install the given binary

Result: ymp

Tags

GET /source/<project>/_tags

Arguments:

Get tags by project.

Result: Example Schema

GET /source/<project>/<package>/_tags

Arguments:

Get tags by package.

Result: Example Schema

GET /tag/<tag>/_projects

Arguments:

Get projects by tag(s). For selection by more than one tag use TagA::TagB for example.

Result: Example Schema

GET /tag/<tag>/_packages

Arguments:

Get packages by tag.

Result: Example Schema

GET /tag/<tag>/_all

Arguments:

Get projects and packages by tag.

Result: Example Schema

GET /user/<user>/tags/_projects

Arguments:

Get all projects including tags assigned by the user

Result: Example Schema

GET /user/<user>/tags/_packages

Arguments:

Get all packages including tags assigned by the user

Result: Example Schema

GET /user/<user>/tags/_tagcloud

Arguments:

distribution=linear | logarithmic | raw steps=[1..100] limit=[0..] (default = 100, 0 = no limit)

Get a tag cloud from the tags used by the user.

Result: Example Schema

GET /tag/_tagcloud

distribution=linear | logarithmic | raw steps=[1..100] limit=[0..] (default = 100, 0 = no limit)

Get a tag cloud including all tags.

Result: Example Schema

GET user/<user>/tags/<project>

Arguments:

Get tags by user and project.

Result: Example Schema

PUT user/<user>/tags/<project>

Arguments:

Write tags by user and project.

Body: Example Schema

Result: Example Schema

GET user/<user>/tags/<project>/<package>

Arguments:

Get tags by user and package.

PUT user/<user>/tags/<project>/<package>

Arguments:

Write tags by user and package.

Body: Example Schema

Result: Example Schema

Build Results (Legacy)

This section describes the obsolete API for build results. It will be replaced by the API available under /build.

RPMs

Host: api.opensuse.org

GET /rpm/<project>/<platform>/<package>/<arch>/<rpmname>

Arguments:

Get RPM.

Result: RPM

GET /rpm/<project>/<repo>/<arch>/<package>/history

Arguments:

Get build history

Result: Example Schema

GET /rpm/<project>/<repo>/<arch>/<package>/buildinfo

Arguments:

Get build information for local building

Result: buildinfo

POST /rpm/<project>/<repo>/<arch>/<package>/buildinfo

Arguments:

Get build info for local building using the POSTed specfile

Body: specfile

Result: buildinfo

GET /rpm/<project>/<repo>/<arch>/<package>/status

Arguments:

Get build status of the specified project/package/repo/arch combination

Result: buildstatus

Build Results

Host: api.opensuse.org

GET /result/<project>/<platform>/result

Arguments:

Read project summary result.

Result: Example Schema

GET /result/<project>/<platform>/<package>/result

Arguments:

Read package result.

Result: Example Schema

GET /result/<project>/<platform>/<package>/<arch>/log

Arguments:

Read build log.

Result: Build log as text file.

Statistics

Host: api.opensuse.org

GET /statistics/latest_added?limit=<limit>

Get a list of packages and projects (mixed) latest added to the build service. All entries are sorted by creation time.

Result: Example Schema

GET /statistics/added_timestamp/<project>/<package>

Arguments:

Get timestamp when project or package was added to the build service.

Result: Example Schema

GET /statistics/latest_updated?limit=<limit>

Get a list of packages and project that were last updated. All entries are sorted by the update timestamp.

Result: Example Schema

GET /statistics/updated_timestamp/<project>/<package>

Arguments:

Get timestamp when project or package was last updated.

Result: Example Schema

GET /statistics/activity/<project>/<package>

Arguments:

Get activity in % of project or package.

Result: Example Schema

GET /statistics/most_active?type=<type>&limit=<limit>

Get list of most active packages (type=packages) or projects (type=projects). Also returns count of updates since package was created when type=packages. Also returns count of packages that are in this project when type=projects.

Result: Example Schema

GET /statistics/highest_rated?limit=<limit>

Get list of highest rated projects and packages. Results are sorted by score. Only items with more than 3 ratings will show up in this list.

Result: Example Schema

GET /statistics/rating/<project>/<package>

Arguments:

Get rating of a specific project or package. Also returns what score the logged in user gave and how many ratings there are already for the specified object.

Result: Example Schema

PUT /statistics/rating/<project>/<package>

Arguments:

Rate this project / package.

Result: Example Schema

GET /statistics/download_counter?limit=<limit>

Get download counters for top downloaded files including to which project, package, repository and architecture they belong.

Result: Example Schema

GET /statistics/download_counter?group_by=<group_by>&limit=<limit>

Get summarized download counters for top downloaded projects, packages, repositories or architectures (by setting group_by parameter to project, package, repo or arch) including count of files that belong to the respective object.

Result: Example Schema

PUT /statistics/redirect_stats

Send download statistics from the openSUSE download redirector to the build service api, to update the download_counter database. User needs to have appropriate permissions.

Result: Example Schema

GET /statistics/newest_stats

Get the timestamp of the newest stats in build service. This is useful for the create_stats_xml.rb script. Using this value it can import only those statistics that changed from the last import of statistics. If there are no statistics yet, returns "1970-01-01T01:00:00+01:00"

Result: Example Schema

Status Messages

Host: api.opensuse.org

GET /status_message/?limit=<limit>

Get a list of status messages.

Result: Example Schema

PUT /status_message/

Send a new status message to the build service. User needs to have appropriate permissions.

Result: Example

Messages (for projects/packages)

Host: api.opensuse.org

GET /message/<id>

Arguments:

Get (one) message specified by id.

Result: Example Schema

GET /message/?limit=<limit>

Get a list of messages, independent of project or package. All entries are ordered by creation time (latest first).

Result: Example Schema

GET /message/?project=<project>

Get a list of messages for this package. All entries are ordered by creation time (latest first).

Result: Example Schema

GET /message/?project=<project>&package=<package>

Get a list of messages for this package. All entries are ordered by creation time (latest first).

Result: Example Schema

PUT /message/?project=<project>&package=<package>

Append message to the specified package (or project, if package parameter is omitted).

Result: Example Schema