Obtaining an MR List of a Repository
Description
This API is used to obtain an MR list of a repository.
URI
GET /v2/repositories/{repository_id}/merge_request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_id |
Yes |
Integer |
Repository short ID |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
state |
No |
String |
MR status |
|
page |
No |
String |
Page number |
|
per_page |
No |
String |
Number of data records on each page |
|
search |
No |
String |
Match condition |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
error |
Error object |
Response error |
|
result |
MergeResult object |
Response result |
|
status |
String |
Response status |
|
Parameter |
Type |
Description |
|---|---|---|
|
closed |
Double |
Number of closed MRs |
|
merge_requests |
Array of MergeRequestsItem objects |
MR details |
|
merged |
Double |
Number of merged requests |
|
opened |
Double |
Number of open MRs |
|
total |
Double |
Total number of MRs |
|
Parameter |
Type |
Description |
|---|---|---|
|
author |
Author object |
Author |
|
closed_at |
String |
Close time |
|
created_at |
String |
Creation time |
|
description |
String |
MR description |
|
devcloud_source_branch |
String |
Source branch |
|
id |
Double |
MR ID |
|
iid |
Double |
Sequence number of an MR in the current repository |
|
merge_request_assignee_list |
Array of Author objects |
Merger |
|
merge_status |
String |
Whether it can be merged |
|
source_branch |
String |
Source branch |
|
state |
String |
MR status |
|
target_branch |
String |
Target branch |
|
title |
String |
Title |
|
updated_at |
String |
Update time |
Request Examples
GET https://{endpoint}/v2/repositories/907199/merge_request
Response Examples
Status code: 200
Request succeeded
{
"result" : {
"total" : 1,
"merge_requests" : [ {
"iid" : 1,
"description" : "merge \"branch123\" into \"master\"\nCreate the dsadsad11 file",
"created_at" : "2021-12-08T16:34:49.000+08:00",
"title" : "tesafrds.",
"source_branch" : "branch123",
"updated_at" : "2021-12-08T16:39:24.000+08:00",
"id" : 6670,
"state" : "opened",
"closed_at" : "2021-12-08T16:34:50.000+08:00",
"author" : {
"name" : "repo",
"id" : 1234,
"state" : "active",
"username" : "e0c068bf68c44bfab87b763ff85da277"
},
"target_branch" : "master",
"merge_status" : "can_be_merged",
"devcloud_source_branch" : "branch123",
"merge_request_assignee_list" : [ {
"name" : "Example account",
"id" : 3333,
"state" : "active",
"username" : "a618e34bd5704be3ae3395dfede06041"
}, {
"name" : "Example account",
"id" : 6747,
"state" : "active",
"username" : "42dd0277cfb048dea856e4ee352e937d"
} ]
} ],
"merged" : 0,
"closed" : 0,
"opened" : 1
},
"status" : "success"
}
Status Codes
|
Status Codes |
Description |
|---|---|
|
200 |
Request succeeded |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot