canmove, Confirmed users
6,439
edits
(→API) |
(→API) |
||
Line 63: | Line 63: | ||
= API = | = API = | ||
Both the build machine client and the web administration API will make use of the REST interface described below. A 500 response is possible for any method, so not listed for all of them. | Both the build machine client and the web administration API will make use of the REST interface described below. A 500 response is possible for any method, so not listed for all of them. Most error responses (4xx and 5xx) will have an 'errmsg' entity in their response. The body of all responses will be a JSON object as described for each resource below. | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
Line 70: | Line 70: | ||
! Arguments | ! Arguments | ||
! width=40% | Description | ! width=40% | Description | ||
! | ! Response status | ||
! Response body | |||
|- | |- | ||
| rowspan=2 | /releases | | rowspan=2 | /releases | ||
Line 77: | Line 78: | ||
| rowspan=2 | Retrieves all release names | | rowspan=2 | Retrieves all release names | ||
| 200 - Releases returned | | 200 - Releases returned | ||
| JSON object whose keys are names of releases and values are an object with the following data: product, version and release data | |||
|- | |- | ||
| 204 - No releases | | 204 - No releases | ||
| | |||
|- | |- | ||
| rowspan=2 | /releases/[name] | | rowspan=2 | /releases/[name] | ||
Line 85: | Line 88: | ||
| rowspan=2 | Retrieve the release identified by "name" | | rowspan=2 | Retrieve the release identified by "name" | ||
| 200 - Release returned | | 200 - Release returned | ||
| JSON object with the following data: product, version, release data | |||
|- | |- | ||
| 404 - Release doesn't exist | | 404 - Release doesn't exist | ||
| | |||
|- | |- | ||
| rowspan=3 | /releases/[name] | | rowspan=3 | /releases/[name] | ||
Line 93: | Line 98: | ||
| rowspan=3 | Update the release with the supplied JSON data. If non-existent, it is created. Be careful when using this for existing releases that already have builds added to them -- the JSON blob given here overrides all data for the release, not just platform independent data. | | rowspan=3 | Update the release with the supplied JSON data. If non-existent, it is created. Be careful when using this for existing releases that already have builds added to them -- the JSON blob given here overrides all data for the release, not just platform independent data. | ||
| 200 - Release modified | | 200 - Release modified | ||
| | |||
|- | |- | ||
| 201 - Release created | | 201 - Release created | ||
| | |||
|- | |- | ||
| 400 - The details value is malformed or NULL | | 400 - The details value is malformed or NULL | ||
| errmsg | |||
|- | |- | ||
| rowspan=2 | /releases/[name] | | rowspan=2 | /releases/[name] | ||
Line 103: | Line 111: | ||
| rowspan=2 | Delete the release | | rowspan=2 | Delete the release | ||
| 200 - Release deleted | | 200 - Release deleted | ||
| | |||
|- | |- | ||
| 404 - Release does not exist | | 404 - Release does not exist | ||
| errmsg | |||
|- | |- | ||
| rowspan=3 | /releases/[name]/builds | | rowspan=3 | /releases/[name]/builds | ||
Line 111: | Line 121: | ||
| rowspan=3 | Retrieve all builds from a release | | rowspan=3 | Retrieve all builds from a release | ||
| 200 - Builds returned | | 200 - Builds returned | ||
| JSON object with build data - top-level keys are platforms | |||
|- | |- | ||
| 204 - No builds | | 204 - No builds | ||
| | |||
|- | |- | ||
| 404 - Release does not exist | | 404 - Release does not exist | ||
| errmsg | |||
|- | |- | ||
| rowspan=2 | /releases/[name]/builds/[platform]/[locale] | | rowspan=2 | /releases/[name]/builds/[platform]/[locale] | ||
Line 121: | Line 134: | ||
| rowspan=2 | Retrieve a specific build from a release | | rowspan=2 | Retrieve a specific build from a release | ||
| 200 - Build returned | | 200 - Build returned | ||
| JSON object with build data | |||
|- | |- | ||
| 404 - Release, platform, or locale doesn't exist | | 404 - Release, platform, or locale doesn't exist | ||
| errmsg | |||
|- | |- | ||
| rowspan=3 |/releases/[name]/builds/[platform]/[locale] | | rowspan=3 |/releases/[name]/builds/[platform]/[locale] | ||
Line 129: | Line 144: | ||
| rowspan=3 | Update the build with the supplied JSON data. If any of the named release, platform, or locale don't exist, they will be created. If the specific build already exists, it will be overwritten with the supplied information. | | rowspan=3 | Update the build with the supplied JSON data. If any of the named release, platform, or locale don't exist, they will be created. If the specific build already exists, it will be overwritten with the supplied information. | ||
| 200 - Build modified | | 200 - Build modified | ||
| | |||
|- | |- | ||
| 201 - Build created | | 201 - Build created | ||
| | |||
|- | |- | ||
| 400 - The details value is malformed or NULL. | | 400 - The details value is malformed or NULL. | ||
| errmsg | |||
|- | |- | ||
| rowspan=2 | /releases/[name]/builds/[platform]/[locale] | | rowspan=2 | /releases/[name]/builds/[platform]/[locale] | ||
Line 139: | Line 157: | ||
| rowspan=2 | Delete the build | | rowspan=2 | Delete the build | ||
| 200 - Release deleted | | 200 - Release deleted | ||
| | |||
|- | |- | ||
| 404 - Build doesn't exist | | 404 - Build doesn't exist | ||
| | |||
|- | |- | ||
| rowspan=5 | /releases/log | | rowspan=5 | /releases/log | ||
Line 147: | Line 167: | ||
| rowspan=5 | Retrieve history of changes to rules | | rowspan=5 | Retrieve history of changes to rules | ||
| rowspan=2 | 200 - Log entries returned | | rowspan=2 | 200 - Log entries returned | ||
| rowspan=2 | JSON object whose keys are release_log_id's and values are an object with the following data: release name/version/product/data, username and timestamp | |||
|- | |- | ||
| product - Only retrieve log entries for a release whose product is this | | product - Only retrieve log entries for a release whose product is this | ||
Line 152: | Line 173: | ||
| version - Only retrieve log entries for a release whose version is this | | version - Only retrieve log entries for a release whose version is this | ||
| rowspan=3 | 204 - No log entries | | rowspan=3 | 204 - No log entries | ||
| rowspan=3 | | |||
|- | |- | ||
| startdate - Only retrieve rules newer than this date/time | | startdate - Only retrieve rules newer than this date/time | ||
Line 162: | Line 184: | ||
| rowspan=15 | Create a new rule with the supplied arguments. | | rowspan=15 | Create a new rule with the supplied arguments. | ||
| rowspan=7 | 201 - Rule created | | rowspan=7 | 201 - Rule created | ||
| rowspan=7 | | |||
|- | |- | ||
| mapping | | mapping | ||
Line 177: | Line 200: | ||
| buildTarget | | buildTarget | ||
| rowspan=8 | 400 - One or more of the arguments is invalid | | rowspan=8 | 400 - One or more of the arguments is invalid | ||
| rowspan=8 | errmsg | |||
|- | |- | ||
| buildID | | buildID | ||
Line 197: | Line 221: | ||
| rowspan=2 | Retrieve all of the rules that match the specified arguments. Any missing arguments are regarded as wildcards, therefore a request with no parameters returns all rules. | | rowspan=2 | Retrieve all of the rules that match the specified arguments. Any missing arguments are regarded as wildcards, therefore a request with no parameters returns all rules. | ||
| 200 - Rules returned | | 200 - Rules returned | ||
| JSON object whose keys are rule_id's and values are the same as the arguments described above | |||
|- | |- | ||
| 204 - No rules | | 204 - No rules | ||
| | |||
|- | |- | ||
| rowspan=2 | /rules/[id] | | rowspan=2 | /rules/[id] | ||
Line 205: | Line 231: | ||
| rowspan=2 | Update the rule with the supplied arguments. Any missing arguments will be considered NULL. | | rowspan=2 | Update the rule with the supplied arguments. Any missing arguments will be considered NULL. | ||
| 200 - Rule modified | | 200 - Rule modified | ||
| | |||
|- | |- | ||
| 400 - One or more of the arguments is invalid | | 400 - One or more of the arguments is invalid | ||
| errmsg | |||
|- | |- | ||
| rowspan=2 | /rules/[id] | | rowspan=2 | /rules/[id] | ||
Line 213: | Line 241: | ||
| rowspan=2 | Update the rule with any arguments passed. Any missing arguments will not be changed. | | rowspan=2 | Update the rule with any arguments passed. Any missing arguments will not be changed. | ||
| 200 - Rule modified | | 200 - Rule modified | ||
| | |||
|- | |- | ||
| 400 - One or more of the arguments is invalid | | 400 - One or more of the arguments is invalid | ||
| errmsg | |||
|- | |- | ||
| rowspan=2 | /rules/[id] | | rowspan=2 | /rules/[id] | ||
Line 221: | Line 251: | ||
| rowspan=2 | Delete the rule | | rowspan=2 | Delete the rule | ||
| 200 - Rule deleted | | 200 - Rule deleted | ||
| | |||
|- | |- | ||
| 404 - Rule does not exist | | 404 - Rule does not exist | ||
| | |||
|- | |- | ||
| rowspan=2 | /rules/[id]/rollback | | rowspan=2 | /rules/[id]/rollback | ||
Line 229: | Line 261: | ||
| rowspan=2 | Rollback the rule to the specified log entry | | rowspan=2 | Rollback the rule to the specified log entry | ||
| 200 - Rule modified | | 200 - Rule modified | ||
| | |||
|- | |- | ||
| 400 - rules_log_id doesn't exist or rule_id doesn't match | | 400 - rules_log_id doesn't exist or rule_id doesn't match | ||
| errmsg | |||
|- | |- | ||
| rowspan=3 | /rules/log | | rowspan=3 | /rules/log | ||
Line 237: | Line 271: | ||
| rowspan=3 | Retrieve history of changes to rules | | rowspan=3 | Retrieve history of changes to rules | ||
| 200 - Log entries returned | | 200 - Log entries returned | ||
| JSON object whose keys are rules_log_id's and values are an object with all rule data, username, and timestamp. | |||
|- | |- | ||
| startdate - Only retrieve rules newer than this date/time | | startdate - Only retrieve rules newer than this date/time | ||
| rowspan=2 | 204 - No log entries | | rowspan=2 | 204 - No log entries | ||
| rowspan=2 | | |||
|- | |- | ||
| enddate - Only retrieve rules older than this date/time | | enddate - Only retrieve rules older than this date/time |