-
Notifications
You must be signed in to change notification settings - Fork 441
OBS API
We document our API with the tool restility. There is one api.txt file in the following format.
= Heading Level 1
== Heading Level 2
GET /about
Get information about API.
XmlBody: about
XmlResult: about
Define a route with the HTTP verb in the front.
GET /about
Add some description text (indented by 2 spaces).
Description of the route.
Add an example XML (XmlResult) which is just to provide the user an example. This is just a file in the same directory as api.txt
called about.xml
in this case.
XmlResult: about
Add a XML schema file (XmlBody) in RelaxNG or XML Schema which is used for validating the XML received and sent. This is just a file in the same directory as api.txt
called about.rng
or about.xsd
.
XmlBody: about
Call make
in docs/api/
. HTML output, including an index file, will be generated in docs/api/html/
NOTE: This is an unopinionated summary of how we handle changes in the OBS API right now.
So far there has only been one API version, which has been carefully extended.
Generally speaking we try to avoid API changes. Though there are rare cases were we do them nonetheless. Here is a list of different types of API changes and how we handled them.
Routes in the /public
namespace are not considered part of the official API and can be changed in a more liberal way.
-
Adding new routes to the API
Not a problem since there are no existing API consumers relying on this route.
-
Removing routes
In a few cases we dropped existing routes. When we did this we deprecate them in the next OBS release and remove them in the second next one.
-
Adding new elements or attributes (as in XML elements) to existing API resources.
This happens rarely and we try to avoid it, since it's easily affecting existing API consumers. In the few cases where we did this we:
- Provided new releases for existing, supported OBS releases, to make older OBS versions compatible with the changed API.
- Ensured that current
osc
versions (as in osc packages available for SLE11 SPx, SLE12 SPx, openSUSE releases, etc.) can handle these changes.
-
Changing error codes
We don't change error codes. They should always stay the same. But adding additional error codes is possible.
In development environment, first you need to add the location of the API Docs HTML file in config/options.yml
:
apidocs_location: /obs/docs/api/html
After that, you will be able to see the page in ~/apidocs/index
.
Don't forget to run make every time you change something in api.txt to generate the up-to-date HTML file, as explained before.
- Development Environment Overview
- Development Environment Tips & Tricks
- Spec-Tips
- Code Style
- Rubocop
- Testing with VCR
- Authentication
- Authorization
- Autocomplete
- BS Requests
- Events
- ProjectLog
- Notifications
- Feature Toggles
- Build Results
- Attrib classes
- Flags
- The BackendPackage Cache
- Maintenance classes
- Cloud uploader
- Delayed Jobs
- Staging Workflow
- StatusHistory
- OBS API
- Owner Search
- Search
- Links
- Distributions
- Repository
- Data Migrations
- next_rails
- Ruby Update
- Rails Profiling
- Installing a local LDAP-server
- Remote Pairing Setup Guide
- Factory Dashboard
- osc
- Setup an OBS Development Environment on macOS
- Run OpenQA smoketest locally
- Responsive Guidelines
- Importing database dumps
- Problem Statement & Solution
- Kickoff New Stuff
- New Swagger API doc
- Documentation and Communication
- GitHub Actions
- How to Introduce Software Design Patterns
- Query Objects
- Services
- View Components
- RFC: Core Components
- RFC: Decorator Pattern
- RFC: Backend models