Source Code Management Repositories

This chapter is managed on source code management repositories.

Get scm repository

A GET to /scm-repositories/{id} returns the source code management repository with the given id.

Path parameters

Table 1. /api/rest/latest/scm-repositories/{id}
Parameter Description

id

the id of the source code management repository

HTTP request

GET /api/rest/latest/scm-repositories/1 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

Request parameters

Parameter Description

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 606

{
  "_type" : "scm-repository",
  "id" : 1,
  "name" : "GherkinTestCase",
  "repository_path" : "home/Git1",
  "working_folder_path" : "resources/features",
  "working_branch" : "master",
  "scm_server" : {
    "_type" : "scm-server",
    "id" : 9,
    "name" : "server1",
    "url" : "https://github.com/",
    "kind" : "git",
    "committer_mail" : "henix@git.fr",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/scm-servers/9"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/scm-repositories/1"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the source code management repository

name

String

the name of the source code management repository

repository_path

String

the repository path of the source code management repository

working_folder_path

String

the working folder path of the source code management repository

working_branch

String

the working branch of the source code management repository

scm_server

Object

the scm server this source code management repository belongs to

_links

Object

related links

Relation Description

self

link to this source code management repository

Modify scm repository

A PATCH to /scm-repositories/{id} modifies the source code management repository with the given id.

HTTP request

PATCH /api/rest/latest/scm-repositories/1?branch=default HTTP/1.1
Accept: application/json
Host: localhost:8080

Path parameters

Table 1. /api/rest/latest/scm-repositories/{id}
Parameter Description

id

the id of the source code management repository

Request parameters

Parameter Description

branch

the new working branch of the source code management repository

fields

which fields of the elements should be returned (optional)

HTTP response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 607

{
  "_type" : "scm-repository",
  "id" : 1,
  "name" : "GherkinTestCase",
  "repository_path" : "home/Git1",
  "working_folder_path" : "resources/features",
  "working_branch" : "default",
  "scm_server" : {
    "_type" : "scm-server",
    "id" : 9,
    "name" : "server1",
    "url" : "https://github.com/",
    "kind" : "git",
    "committer_mail" : "henix@git.fr",
    "_links" : {
      "self" : {
        "href" : "http://localhost:8080/api/rest/latest/scm-servers/9"
      }
    }
  },
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/api/rest/latest/scm-repositories/1"
    }
  }
}

Response fields

Path Type Description

_type

String

the type of the entity

id

Number

the id of the source code management repository

name

String

the name of the source code management repository

repository_path

String

the repository path of the source code management repository

working_folder_path

String

the working folder path of the source code management repository

working_branch

String

the working branch of the source code management repository

scm_server

Object

the scm server this source code management repository belongs to

_links

Object

related links

Delete scm repository

A DELETE to /scm-repositories/{ids} deletes one or several source code management repositories with the given id(s).

Path parameters

Table 1. /api/rest/latest/scm-repositories/{ids}
Parameter Description

ids

the list of ids of the source code management repositories

HTTP request

DELETE /api/rest/latest/scm-repositories/9,10 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080

HTTP response

HTTP/1.1 204 No Content