Repository List Resource¶
Name | repositories |
URI | /api/repositories/ |
Description | Provides information on a registered repository. Review Board has a list of known repositories, which can be modified through the site’s administration interface. These repositories contain the information needed for Review Board to access the files referenced in diffs. |
HTTP Methods | |
Parent Resource | Root List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Links¶
Name | Method | Resource |
---|---|---|
create | POST | Repository List Resource |
self | GET | Repository List Resource |
HTTP GET¶
Retrieves the list of repositories on the server.
This will only list visible repositories. Any repository that the administrator has hidden will be excluded from the list.
Request Parameters¶
Field | Type | Description |
---|---|---|
counts-only (optional) | Boolean | If specified, a single count field is returned with the number of results, instead of the results themselves. |
max-results (optional) | Integer | The maximum number of results to return in this list. By default, this is 25. |
start (optional) | Integer | The 0-based index of the first result in the list. The start index is usually the previous start index plus the number of previous results. By default, this is 0. |
HTTP POST¶
Creates a repository.
This will create a new repository that can immediately be used for review requests.
The tool is a registered SCMTool ID. This must be known beforehand, and can be looked up in the Review Board administration UI.
Before saving the new repository, the repository will be checked for access. On success, the repository will be created and this will return HTTP 201 Created.
In the event of an access problem (authentication problems, bad/unknown SSH key, or unknown certificate), an error will be returned and the repository information won’t be updated. Pass trust_host=1 to approve bad/unknown SSH keys or certificates.
Request Parameters¶
Field | Type | Description |
---|---|---|
bug_tracker (optional) | String | The URL to a bug in the bug tracker for this repository, with %s in place of the bug ID. |
encoding (optional) | String | The encoding used for files in the repository. This is an advanced setting and should only be used if you absolutely need it. |
mirror_path (optional) | String | An alternate path to the repository. |
name (required) | String | The human-readable name of the repository. |
password (optional) | String | The password used to access the repository. |
path (required) | String | The path to the repository. |
public (optional) | Boolean | Whether or not review requests on the repository will be publicly accessible by users on the site. The default is true. |
raw_file_url (optional) | String | A URL mask used to check out a particular file using HTTP. This is needed for repository types that can’t access files natively. Use <revision> and <filename> in the URL in place of the revision and filename parts of the path. |
tool (required) | String | The ID of the SCMTool to use. |
trust_host (optional) | Boolean | Whether or not any unknown host key or certificate should be accepted. The default is false, in which case this will error out if encountering an unknown host key or certificate. |
username (optional) | String | The username used to access the repository. |
Examples¶
application/json¶
{
"links": {
"create": {
"href": "http://reviews.example.com/api/repositories/",
"method": "POST"
},
"self": {
"href": "http://reviews.example.com/api/repositories/",
"method": "GET"
}
},
"repositories": [
{
"id": 1,
"links": {
"delete": {
"href": "http://reviews.example.com/api/repositories/1/",
"method": "DELETE"
},
"info": {
"href": "http://reviews.example.com/api/repositories/1/info/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/repositories/1/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/repositories/1/",
"method": "PUT"
}
},
"name": "Review Board SVN",
"path": "http://reviewboard.googlecode.com/svn",
"tool": "Subversion"
},
{
"id": 2,
"links": {
"delete": {
"href": "http://reviews.example.com/api/repositories/2/",
"method": "DELETE"
},
"info": {
"href": "http://reviews.example.com/api/repositories/2/info/",
"method": "GET"
},
"self": {
"href": "http://reviews.example.com/api/repositories/2/",
"method": "GET"
},
"update": {
"href": "http://reviews.example.com/api/repositories/2/",
"method": "PUT"
}
},
"name": "Navi SVN",
"path": "http://svn.navi.cx/misc",
"tool": "Subversion"
}
],
"stat": "ok",
"total_results": 2
}
application/xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<total_results>2</total_results>
<stat>ok</stat>
<repositories>
<array>
<item>
<path>http://reviewboard.googlecode.com/svn</path>
<tool>Subversion</tool>
<id>1</id>
<links>
<info>
<href>http://reviews.example.com/api/repositories/1/info/</href>
<method>GET</method>
</info>
<self>
<href>http://reviews.example.com/api/repositories/1/</href>
<method>GET</method>
</self>
<update>
<href>http://reviews.example.com/api/repositories/1/</href>
<method>PUT</method>
</update>
<delete>
<href>http://reviews.example.com/api/repositories/1/</href>
<method>DELETE</method>
</delete>
</links>
<name>Review Board SVN</name>
</item>
<item>
<path>http://svn.navi.cx/misc</path>
<tool>Subversion</tool>
<id>2</id>
<links>
<info>
<href>http://reviews.example.com/api/repositories/2/info/</href>
<method>GET</method>
</info>
<self>
<href>http://reviews.example.com/api/repositories/2/</href>
<method>GET</method>
</self>
<update>
<href>http://reviews.example.com/api/repositories/2/</href>
<method>PUT</method>
</update>
<delete>
<href>http://reviews.example.com/api/repositories/2/</href>
<method>DELETE</method>
</delete>
</links>
<name>Navi SVN</name>
</item>
</array>
</repositories>
<links>
<self>
<href>http://reviews.example.com/api/repositories/</href>
<method>GET</method>
</self>
<create>
<href>http://reviews.example.com/api/repositories/</href>
<method>POST</method>
</create>
</links>
</rsp>