Repository Resource¶
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.
Details¶
Name | repository |
URI | /api/repositories/{repository_id}/ |
Token Policy ID | repository |
HTTP Methods | |
Parent Resource | Repository List Resource |
Child Resources | |
Anonymous Access | Yes, if anonymous site access is enabled |
Fields¶
bug_trackerString | The URL to a bug in the bug tracker for this repository, with Added in 2.5 |
idInteger | The numeric ID of the repository. |
mirror_pathString | An alternate path to the repository, for lookup purposes. Added in 1.7.19 |
nameString | The name of the repository. |
pathString | The main path to the repository, which is used for communicating with the repository and accessing files. |
toolString | The name of the internal repository communication class used to talk to the repository. This is generally the type of the repository. |
visibleBoolean | Whether or not this repository is visible (admin only). Added in 2.0 |
Links¶
Name | Method | Resource |
---|---|---|
branches | GET | Repository Branches Resource |
commits | GET | Repository Commits Resource |
delete | DELETE | Repository Resource |
diff_file_attachments | GET | Diff File Attachment List 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.
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
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.
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
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¶
archive_nameBoolean | 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. Added in 1.6.2 |
bug_trackerString | The URL to a bug in the bug tracker for this repository, with Added in 1.6 |
encodingString | The encoding used for files in the repository. This is an advanced setting and should only be used if you absolutely need it. Added in 1.6 |
mirror_pathString | An alternate path to the repository. Added in 1.6 |
nameString | The human-readable name of the repository. Added in 1.6 |
passwordString | The password used to access the repository. Added in 1.6 |
pathString | The path to the repository. Added in 1.6 |
publicBoolean | Whether or not review requests on the repository will be publicly accessible by users on the site. The default is true. Added in 1.6 |
raw_file_urlString | 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 Added in 1.6 |
trust_hostBoolean | 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. Added in 1.6 |
usernameString | The username used to access the repository. Added in 1.6 |
visibleBoolean | Whether the repository is visible. Added in 2.0 |
Errors¶
100 - Does Not ExistHTTP 404 - Not Found | Object does not exist |
101 - Permission DeniedHTTP 403 - Forbidden | You don’t have permission for this |
103 - Not Logged InHTTP 401 - Unauthorized | You are not logged in |
105 - Invalid Form DataHTTP 400 - Bad Request | One or more fields had errors |
210 - Repository Information ErrorHTTP 500 - Internal Server Error | There was an error fetching extended information for this repository. |
213 - Server Configuration ErrorHTTP 500 - Internal Server Error | There was an error storing configuration on the server. |
214 - Bad Host KeyHTTP 403 - Forbidden | The SSH key on the host does ot match the stored key. |
215 - Unverified Host KeyHTTP 403 - Forbidden | The SSH key on the host is unverified. |
216 - Unverified Host CertificateHTTP 403 - Forbidden | The HTTPS certificate on the host is unverified. |
218 - Repository Authentication ErrorHTTP 403 - Forbidden | Unable to authenticate with the repository using the provided credentials. |
Examples¶
application/vnd.reviewboard.org.repository+json¶
$ curl http://reviews.example.com/api/repositories/1/ -H "Accept: application/json"
Vary: Accept, Cookie
ETag: 0edb460494b50374ee716598875a4cac768e294a
Content-Type: application/vnd.reviewboard.org.repository+json
X-Content-Type-Options: nosniff
{
"repository": {
"bug_tracker": "http://code.google.com/p/reviewboard/issues/detail?id=%s",
"id": 1,
"links": {
"branches": {
"href": "http://reviews.example.com/api/repositories/1/branches/",
"method": "GET"
},
"commits": {
"href": "http://reviews.example.com/api/repositories/1/commits/",
"method": "GET"
},
"delete": {
"href": "http://reviews.example.com/api/repositories/1/",
"method": "DELETE"
},
"diff_file_attachments": {
"href": "http://reviews.example.com/api/repositories/1/diff-file-attachments/",
"method": "GET"
},
"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": "https://svn.riouxsvn.com/reviewboard/",
"tool": "Subversion",
"visible": true
},
"stat": "ok"
}