Repository Resource¶
Name | repository |
URI | /api/repositories/{repository_id}/ |
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 | Repository List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Fields¶
Field | Type | Description |
---|---|---|
id | Integer | The numeric ID of the repository. |
mirror_path | String | An alternate path to the repository, for lookup purposes. |
name | String | The name of the repository. |
path | String | The main path to the repository, which is used for communicating with the repository and accessing files. |
tool | String | The name of the internal repository communication class used to talk to the repository. This is generally the type of the repository. |
Links¶
Name | Method | Resource |
---|---|---|
delete | DELETE | Repository Resource |
info | GET | Repository Info Resource |
self | GET | Repository Resource |
update | PUT | Repository Resource |
HTTP DELETE¶
Deletes a repository.
The repository will not actually be deleted from the database, as that would also trigger a deletion of all review requests. Instead, it makes a repository as no longer being visible, which will hide it in the UIs and in the API.
HTTP GET¶
Retrieves information on a particular repository.
This will only return basic information on the repository. Authentication information, hosting details, and repository-specific information are not provided.
HTTP PUT¶
Updates a repository.
This will update the information on a repository. If the path, username, or password has changed, Review Board will try again to verify access to the repository.
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 |
---|---|---|
archive_name (optional) | Boolean | Whether or not the (non-user-visible) name of the repository should be changed so that it (probably) won’t conflict with any future repository names. |
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 (optional) | String | The human-readable name of the repository. |
password (optional) | String | The password used to access the repository. |
path (optional) | 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. |
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/vnd.reviewboard.org.repository+json¶
{
"repository": {
"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"
}
},
"mirror_path": "",
"name": "Review Board SVN",
"path": "http://reviewboard.googlecode.com/svn",
"tool": "Subversion"
},
"stat": "ok"
}
application/vnd.reviewboard.org.repository+xml¶
<?xml version="1.0" encoding="utf-8"?>
<rsp>
<stat>ok</stat>
<repository>
<name>Review Board SVN</name>
<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>
<mirror_path></mirror_path>
<id>1</id>
<path>http://reviewboard.googlecode.com/svn</path>
<tool>Subversion</tool>
</repository>
</rsp>