Balrog/Admin API: Difference between revisions
(Created page with "Balrog's Admin app provides an API that allows for retrieval and modification of Rules, Releases, and Permissions. This page documents all of the available endpoints, their pa...") |
No edit summary |
||
| Line 78: | Line 78: | ||
Deletes the rule identified by the id or alias given. The following parameters are supported: | Deletes the rule identified by the id or alias given. The following parameters are supported: | ||
* data_version (required) | * data_version (required) | ||
== /rules/<id_or_alias>/revisions == | |||
=== GET === | |||
Returns previous versions of the rule identified by the id or alias given in a JSON Object in the following format: | |||
<pre> | |||
{ | |||
"count": 2, | |||
"rules": [ | |||
{ | |||
"id": 1, | |||
"change_id": 4, | |||
"timestamp": 1451610061000, | |||
"changed_by": "jane", | |||
"product": "Firefox", | |||
... | |||
}, | |||
{ | |||
"id": 1, | |||
"change_id": 4, | |||
"timestamp": 1451610061000, | |||
"changed_by": "jane", | |||
"product": "Firefox", | |||
... | |||
} | |||
] | |||
</pre> | |||
=== POST === | |||
Reverts the rule identified by the given id (alias is not supported here) to the version identified by the change_id given in the request body. The request body <em>must</em> be a JSON object containing a "change_id" key. | |||
== /rules/columns/<column> == | |||
=== GET === | |||
Returns a JSON Object containing the unique values for the given column. For example, /rules/columns/product would return something like: | |||
<pre> | |||
{ | |||
"count": 10, | |||
"product": [ | |||
"Firefox", | |||
"Graphene", | |||
"Thunderbird", | |||
"MetroFirefox", | |||
"Horizon", | |||
"B2G", | |||
"GMP", | |||
"Fennec", | |||
"SystemAddons", | |||
"B2GDroid" | |||
] | |||
} | |||
</pre> | |||
Revision as of 14:17, 30 March 2016
Balrog's Admin app provides an API that allows for retrieval and modification of Rules, Releases, and Permissions. This page documents all of the available endpoints, their parameters, and responses.
POST and PUT requests may submit parameters as multipart form data or json.
Rules
/rules
GET
Returns all of the Rules in Balrog's database inside of a JSON Object in the following format:
{
"count": 2,
"rules": [
{
"rule_id": 1,
...
},
{
"rule_id": 2,
...
}
]
}
POST
Creates a new rule with the provided values. The following parameters are supported:
- priority (required)
- backgroundRate (required)
- mapping
- alias
- product
- version
- buildID
- channel
- locale
- distribution
- buildTarget
- osVersion
- distVersion
- whitelist
- comment
- headerArchitecture
For detailed information on parameters see [| the Rule table documentation].
/rules/<id_or_alias>
GET
Returns the entire rule identified by the id or alias given in JSON format. Eg:
{
"rule_id": 3,
"product": "Firefox",
...
}
POST
Modifies the rule identified by the id or alias given according to the parameters given. The following parameters are supported:
- data_version (required)
- priority
- backgroundRate
- mapping
- alias
- product
- version
- buildID
- channel
- locale
- distribution
- buildTarget
- osVersion
- distVersion
- whitelist
- comment
- headerArchitecture
DELETE
Deletes the rule identified by the id or alias given. The following parameters are supported:
- data_version (required)
/rules/<id_or_alias>/revisions
GET
Returns previous versions of the rule identified by the id or alias given in a JSON Object in the following format:
{
"count": 2,
"rules": [
{
"id": 1,
"change_id": 4,
"timestamp": 1451610061000,
"changed_by": "jane",
"product": "Firefox",
...
},
{
"id": 1,
"change_id": 4,
"timestamp": 1451610061000,
"changed_by": "jane",
"product": "Firefox",
...
}
]
POST
Reverts the rule identified by the given id (alias is not supported here) to the version identified by the change_id given in the request body. The request body must be a JSON object containing a "change_id" key.
/rules/columns/<column>
GET
Returns a JSON Object containing the unique values for the given column. For example, /rules/columns/product would return something like:
{
"count": 10,
"product": [
"Firefox",
"Graphene",
"Thunderbird",
"MetroFirefox",
"Horizon",
"B2G",
"GMP",
"Fennec",
"SystemAddons",
"B2GDroid"
]
}