Jump to >

Repository List 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 repositories
URI /api/repositories/
Token Policy ID repository
HTTP Methods
  • GET - Retrieves the list of repositories on the server.
  • POST - Creates a repository.
Parent Resource Root List Resource
Child Resources
Anonymous Access Yes, if anonymous site access is enabled

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

counts-onlyBoolean If specified, a single count field is returned with the number of results, instead of the results themselves.
hosting-serviceString

Filter repositories by one or more comma-separated hosting service IDs.

Added in 1.7.21

max-resultsInteger The maximum number of results to return in this list. By default, this is 25. There is a hard limit of 200; if you need more than 200 results, you will need to make more than one request, using the “next” pagination link.
nameString

Filter repositories by one or more comma-separated names.

Added in 1.7.21

name-or-pathString

Filter repositories by one or more comma-separated names, paths, or mirror paths.

Added in 1.7.21

pathString

Filter repositories by one or more comma-separated paths or mirror paths.

Added in 1.7.21

qString

Filter repositories by those that have a name starting with the search term.

Added in 4.0

show-invisibleBoolean

Whether to list only visible repositories or all repositories.

Added in 2.0

startInteger 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.
toolString

Filter repositories by one or more comma-separated tool names.

Added in 1.7.21

usernameString

Filter repositories by one or more comma-separated usernames.

Added in 1.7.21

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
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 POST

Creates a repository.

This will create a new repository that can immediately be used for review requests.

The tool is a registered SCMTool name. 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

nameString Required

The human-readable name of the repository.

Added in 1.6

toolString Required

The name of the SCMTool to use. Valid names can be found in the Administration UI.

Added in 1.6

bug_trackerString

The URL to a bug in the bug tracker for this repository, with %s in place of the bug ID.

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 bug_tracker_type.

Added in 3.0.19

bug_tracker_planString

The bug tracker service plan, if specifying bug_tracker_type. The value is specific to the type of bug tracker hosting service.

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 bug_tracker. This may require bug_tracker_hosting_account_username and some service-specific fields (bug_tracker_hosting_url, bug_tracker_plan, and fields containing the service ID).

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 hosting_type.

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 hosting_type is set.

Added in 3.0.19

hosting_typeString

The type of hosting service backing this repository, if not configuring a plain repository. This will require hosting_account_username and some service-specific fields (hosting_url, repository_plan, and fields prefixed with the hosting type ID).

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 hosting_type.

Added in 3.0.19

mirror_pathString

An alternate path to 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 <revision> and <filename> in the URL in place of the revision and filename parts of the path.

Added in 1.6

repository_planString

The hosting service repository plan, if specifying hosting_type. The value is specific to the type of hosting service.

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

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
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.
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.
HTTP 409 - Conflict A repository with this name already exists.

Examples

application/vnd.reviewboard.org.repositories+json

$ curl http://reviews.example.com/api -H "Accept: application/json"
Vary: Accept, Cookie
Item-Content-Type: application/vnd.reviewboard.org.repository+json
Content-Type: application/vnd.reviewboard.org.repositories+json
ETag: fa196866728f8de28feb0d0dce86119735e023ef
X-Content-Type-Options: nosniff
{
  "links": {
    "create": {
      "href": "http://reviews.example.com/api", 
      "method": "POST"
    }, 
    "self": {
      "href": "http://reviews.example.com/api", 
      "method": "GET"
    }
  }, 
  "repositories": [
    {
      "bug_tracker": "http://code.google.com/p/reviewboard/issues/detail?id=%s", 
      "extra_data": {}, 
      "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
    }, 
    {
      "bug_tracker": "", 
      "extra_data": {}, 
      "id": 2, 
      "links": {
        "branches": {
          "href": "http://reviews.example.com/api/repositories/2/branches/", 
          "method": "GET"
        }, 
        "commits": {
          "href": "http://reviews.example.com/api/repositories/2/commits/", 
          "method": "GET"
        }, 
        "delete": {
          "href": "http://reviews.example.com/api/repositories/2/", 
          "method": "DELETE"
        }, 
        "diff_file_attachments": {
          "href": "http://reviews.example.com/api/repositories/2/diff-file-attachments/", 
          "method": "GET"
        }, 
        "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"
        }
      }, 
      "mirror_path": "", 
      "name": "Navi SVN", 
      "path": "http://svn.navi.cx/misc", 
      "tool": "Subversion", 
      "visible": true
    }, 
    {
      "bug_tracker": "", 
      "extra_data": {}, 
      "id": 3, 
      "links": {
        "branches": {
          "href": "http://reviews.example.com/api/repositories/3/branches/", 
          "method": "GET"
        }, 
        "commits": {
          "href": "http://reviews.example.com/api/repositories/3/commits/", 
          "method": "GET"
        }, 
        "delete": {
          "href": "http://reviews.example.com/api/repositories/3/", 
          "method": "DELETE"
        }, 
        "diff_file_attachments": {
          "href": "http://reviews.example.com/api/repositories/3/diff-file-attachments/", 
          "method": "GET"
        }, 
        "info": {
          "href": "http://reviews.example.com/api/repositories/3/info/", 
          "method": "GET"
        }, 
        "self": {
          "href": "http://reviews.example.com/api/repositories/3/", 
          "method": "GET"
        }, 
        "update": {
          "href": "http://reviews.example.com/api/repositories/3/", 
          "method": "PUT"
        }
      }, 
      "mirror_path": "", 
      "name": "Git Repo", 
      "path": "/private/var/folders/d6/k73lbsvs0fl4s0r7l3nh67wr0000gn/T/beanbag-tools.UI_onh/reviewboard/scmtools/testdata/git_repo", 
      "tool": "Git", 
      "visible": true
    }
  ], 
  "stat": "ok", 
  "total_results": 3
}