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

Importer Endpoints

Import Project

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

Imports a project.

Information about the project import must be provided in the request body as a ImportProjectInput entity.

Caller must be a member of a group that is granted the ‘Import’ capability (provided by this plugin) or the ‘Administrate Server’ capability.

Request

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

  {
    "from": "https://some-gerrit-server:8080",
    "user": "myUser",
    "pass": "myPassword"
  }

List Imported Projects

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

Lists the imported projects.

As result a map is returned that maps the project name to ImportProjectInfo entity.

Caller must be a member of a group that is granted the ‘Import’ capability (provided by this plugin) or the ‘Administrate Server’ capability.

Request

  GET /config/server/@PLUGIN@~projects/ HTTP/1.0

Response

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

  )]}'
  {
    "myProject": {
      "from": "http://localhost:8081/",
      "imports": [
        {
          "timestamp": "2015-03-11 09:14:21.748000000",
          "user": {
            "_account_id": 1000000,
            "name": "Administrator",
            "email": "edwin.kempin@gmail.com",
            "username": "admin"
          },
          "remote_user": "admin"
        }
      ]
    },
    "myOtherProject": {
      "from": "http://localhost:8081/",
      "imports": [
        {
          "timestamp": "2015-03-11 09:16:04.511000000",
          "user": {
            "_account_id": 1000000,
            "name": "Administrator",
            "email": "edwin.kempin@gmail.com",
            "username": "admin"
          },
          "remote_user": "admin"
        }
      ]
    }
  }

JSON Entities

ImportInfo

The ImportInfo entity contains information about a past import.

  • timestamp: The timestamp of when the import was done.
  • user: User that did the import as a detailed link:../../../Documentation/rest-api-accounts.html#account-info[AccountInfo] entity.
  • remote_user: User on remote system.

ImportProjectInfo

The ImportProjectInfo entity contains information about the past imports of a project.

  • from: URL of the remote system from where the project should be imported.
  • parent: (Optional) Name of the parent project in the target system.
  • imports: List of past imports as ImportInfo entities.

ImportProjectInput

The ImportProjectInput entity contains information about a project import.

  • from: URL of the remote system from where the project should be imported.
  • user: User on remote system.
  • pass: Password of remote user.
  • parent: (Optional) Name of the parent project in the target system. The imported project will be created under this parent project.

SEE ALSO

GERRIT

Part of Gerrit Code Review