@PLUGIN@ - /config/ 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.

Webhooks Endpoints

List webhooks

GET /config/server/@PLUGIN@~projects/{project-name}/remotes/

List existing webhooks for a project.

Request

  GET /config/server/@PLUGIN@~projects/myProject/remotes/

As result a map is returned that maps remote name to RemoteInfo entity.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8

  )]}'
  {
    "foo": {
      "url" : "https://foo.org/gerrit-events",
      "maxTries" : 3,
      "sslVerify": true
    },
    "bar": {
      "url" : "https://bar.org/",
      "events" : ["patchset-created", "ref-updated"]
    }
  }

Get webhook

GET /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]

Get information about one webhook.

Request

  GET /config/server/@PLUGIN@~projects/myProject/remotes/foo

As result a RemoteInfo entity is returned.

Response

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8

  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }

Create webhook

PUT /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]

Create or update a webhook for a project. The request body needs to include a RemoteInfo entity.

Request

  PUT /config/server/@PLUGIN@~projects/myProject/remotes/foo
  Content-Type: application/json; charset=UTF-8

  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : "3",
    "sslVerify": "true"
  }

As response a RemoteInfo entity, which describes the created/updated webhook, is returned.

Response

  HTTP/1.1 201 Created
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8

  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }

The response code is 200 when the webhook already existed and was updated:

  HTTP/1.1 200 OK
  Content-Disposition: attachment
  Content-Type: application/json; charset=UTF-8

  )]}'
  {
    "url" : "https://foo.org/gerrit-events",
    "maxTries" : 3,
    "sslVerify": true
  }

Delete webhook

DELETE /config/server/@PLUGIN@~projects/{project-name}/remotes/[{remote-name}]

Delete a webhook for a project.

Request

  DELETE /config/server/@PLUGIN@~projects/myProject/remotes/foo

Response

  HTTP/1.1 204 No Content

RemoteInfo

The RemoteInfo contains information about a remote section in a webhooks.config file.