Build Service/Curl

From openSUSE

Contents

How to use curl for build service development


Note, the commandline client osc has a way to issue generic commands. So you may not need to resort to curl.
See osc help req.

Curl is a command line tool to transfer data from or to a server, using one of the supported protocols (HTTP, HTTPS, FTP, FTPS, TFTP, DICT, TELNET, LDAP or FILE).

The command is designed to work without user interaction.

It can help testing the openSUSE build service API a lot while development.


Here are the most commonly used commands:


GET request

curl -u username:password -X GET http://some.host/any/path

PUT request

curl -u username:password -X PUT -T /path/to/file/to/put http://some.host/any/path

POST request

curl -u username:password -X POST -T /path/to/file/to/post http://some.host/any/path

DELETE request

curl -u username:password -X DELETE http://some.host/any/path

Examples for openSUSE build service

Delete a pattern file

curl  -u username:password -X DELETE  https://api.opensuse.org/source/<project>/_pattern/<patternfile>

Get metadata for a single package

curl  -u username:password -X GET https://api.opensuse.org/source/<project>/<package>/_meta

Get a specific version of a source file

curl -u username:password  -X GET  https://api.opensuse.org/source/<project>/<package>/<filename>?rev=<your_revision>

Get a list of i586 binaries build in a project

curl  -u username:password -X GET https://api.opensuse.org/build/<project>/i586/_binarylist

Get a list of published i586 binaries for a project =

curl  -u username:password -X GET https://api.opensuse.org/published/<project>/openSUSE_10.3/i586