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
Parameter | Description |
---|---|
|
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 |
---|---|
|
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 |
---|---|---|
|
|
the type of the entity |
|
|
the id of the source code management repository |
|
|
the name of the source code management repository |
|
|
the repository path of the source code management repository |
|
|
the working folder path of the source code management repository |
|
|
the working branch of the source code management repository |
|
|
the scm server this source code management repository belongs to |
|
|
related links |
Links
Relation | Description |
---|---|
|
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
Parameter | Description |
---|---|
|
the id of the source code management repository |
Request parameters
Parameter | Description |
---|---|
|
the new working branch of the source code management repository |
|
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 |
---|---|---|
|
|
the type of the entity |
|
|
the id of the source code management repository |
|
|
the name of the source code management repository |
|
|
the repository path of the source code management repository |
|
|
the working folder path of the source code management repository |
|
|
the working branch of the source code management repository |
|
|
the scm server this source code management repository belongs to |
|
|
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
Parameter | Description |
---|---|
|
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