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 | |
Child Resources |
Fields¶
bug_trackerString | The URL to a bug in the bug tracker for this repository, with Added in 2.5 |
extra_dataDictionary | Extra data as part of the repository. Some of this will be dependent on the type of repository or hosting service being used, and those should not be modified. Custom fields can be set by the API or extensions. Added in 3.0.18 |
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. |
requires_basedirBoolean | Whether the repository requires a patch base directory when creating new review requests. Added in 4.0.7 |
requires_change_numberBoolean | Whether the repository requires a change number when creating new review requests. Added in 4.0.7 |
supports_post_commitBoolean | Whether the repository supports post-commit review via the “New Review Request” page. Added in 4.0.7 |
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 |
|
commits | GET |
|
delete | DELETE |
|
diff_file_attachments | GET |
|
info | GET |
|
repository_groups | GET |
|
repository_users | GET |
|
self | GET |
|
update | PUT |
HTTP DELETE¶
Deletes a repository.
Repositories associated with review requests won’t be fully deleted from the database. Instead, they’ll be archived, removing them from any lists of repositories but freeing up their name for use in a future repository.
Changed in version 3.0.12: Previous releases simply marked a repository as invisible when deleting. Starting in 3.0.12, the repository is archived instead.
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 |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
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 |
112 - OAuth2 Missing Scope ErrorHTTP 403 - Forbidden | Your OAuth2 token lacks the necessary scopes for this request. |
113 - OAuth2 Access Denied ErrorHTTP 403 - Forbidden | OAuth2 token access for this resource is prohibited. |
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 | Deprecated 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. Starting in 3.0.12, performing a DELETE will archive the repository, and is the preferred method. Added in 1.6.2 Deprecated in 3.0.12 |
bug_trackerString | The URL to a bug in the bug tracker for this repository, with Added in 1.6 |
bug_tracker_hosting_urlString | The URL to the base of your bug tracker hosting service, for services that support this option and when using Added in 3.0.19 |
bug_tracker_planString | The bug tracker service plan, if specifying Added in 3.0.19 |
bug_tracker_typeString | The type of hosting service backing the bug tracker to use for this repository, if not specifying Added in 3.0.19 |
bug_tracker_use_hostingBoolean | Whether to use the hosting service’s own bug tracker support for this repository. This is dependent on the bug tracker, and required Added in 3.0.19 |
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 |
hosting_account_usernameString | The pre-configured username for a hosting service account used to connect to this repository. This is only used if Added in 3.0.19 |
hosting_typeString | The type of hosting service backing this repository, if not configuring a plain repository. This will require Added in 3.0.19 |
hosting_urlString | The URL to the base of your repository hosting service, for services that support this option and when using Added in 3.0.19 |
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 |
repository_planString | The hosting service repository plan, if specifying Added in 3.0.19 |
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¶
Examples¶
application/vnd.reviewboard.org.repository+json¶
$ curl https://reviews.example.com/api/repositories/1/ -H "Accept: application/json"
HTTP 200 OK
Content-Length: 1254
Content-Type: application/vnd.reviewboard.org.repository+json
ETag: b0af257bdde9fab86b5308e7562860e24a99688e
Vary: Accept, Cookie
X-Content-Type-Options: nosniff
{
"repository": {
"bug_tracker": "http://code.google.com/p/reviewboard/issues/detail?id=%s",
"extra_data": {},
"id": 1,
"links": {
"branches": {
"href": "https://reviews.example.com/api/repositories/1/branches/",
"method": "GET"
},
"commits": {
"href": "https://reviews.example.com/api/repositories/1/commits/",
"method": "GET"
},
"delete": {
"href": "https://reviews.example.com/api/repositories/1/",
"method": "DELETE"
},
"diff_file_attachments": {
"href": "https://reviews.example.com/api/repositories/1/diff-file-attachments/",
"method": "GET"
},
"info": {
"href": "https://reviews.example.com/api/repositories/1/info/",
"method": "GET"
},
"repository_groups": {
"href": "https://reviews.example.com/api/repositories/1/groups/",
"method": "GET"
},
"repository_users": {
"href": "https://reviews.example.com/api/repositories/1/users/",
"method": "GET"
},
"self": {
"href": "https://reviews.example.com/api/repositories/1/",
"method": "GET"
},
"update": {
"href": "https://reviews.example.com/api/repositories/1/",
"method": "PUT"
}
},
"mirror_path": "",
"name": "Review Board SVN",
"path": "https://svn.riouxsvn.com/reviewboard/",
"requires_basedir": true,
"requires_change_number": false,
"supports_post_commit": true,
"tool": "Subversion",
"visible": true
},
"stat": "ok"
}