@PLUGIN@ - /reviewers/ REST API

This page describes the REST endpoints that are added by the @PLUGIN@ plugin.

Please also take note of the general information on the REST API.

Reviewers Endpoints

Get Reviewers

GET /projects/project_name/@PLUGIN@

Gets the default reviewers for specified project.

Request

  GET /projects/myproject/@PLUGIN@ HTTP/1.0

As response a List of ReviewerFilterSection is returned that describes the default reviewers for myproject.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]

Change Reviewers

PUT /projects/project_name/@PLUGIN@

Changes the default reviewers for the specified project.

The change to reviewers must be provided in the request body inside a ConfigReviewersInput entity.

Request

  PUT /projects/myproject/@PLUGIN@ HTTP/1.0
  Content-Type: application/json;charset=UTF-8
  {
    "action": "ADD",
    "filter": "branch:master"
    "reviewer": "UserA"
  }

As response the default reviewers are returned as a list of ReviewerFilterSection.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json;charset=UTF-8
  )]}'
  [
    {
      "filter": "branch:master",
      "reviewers": [
        "UserA",
        "UserB"
      ]
    },
    {
      "filter": "file:^lib/*",
      "reviewers": [
        "UserB",
        "UserC"
      ]
    }
  ]

JSON Entities

ReviewerFilterSection

The ReviewerFilterSection entity contains a filter section of the default reviewers.

  • filter: A filter that is used to assign default reviewers.
  • reviewers: List of usernames which are assigned as default reviewers under the filter.

ConfigReviewersInput

The ConfigReviewersInput entity contains an update for the default reviewers.

  • action: Indicates whether to add or remove the input reviewer
  • filter: The filter associated with the input reviewer.
  • reviewer: The user to add or remove from the default reviewers.

GERRIT

Part of Gerrit Code Review