Build Service/Curl

From openSUSE

(Difference between revisions)
Revision as of 14:47, 20 November 2007
Lrupp (Talk | contribs)

� Previous diff
Revision as of 15:20, 20 November 2007
Lrupp (Talk | contribs)

Next diff →
Line 25: Line 25:
== DELETE request == == DELETE request ==
curl -u username:password -X DELETE http://some.host/any/path 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 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
 +
[[Category:Build Service]] [[Category:Build Service]]
[[de:Build Service/Curl]] [[de:Build Service/Curl]]

Revision as of 15:20, 20 November 2007

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 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