Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining the List of Warehouse Combination Requests
Updated on 2023-05-06 GMT+08:00

Obtaining the List of Warehouse Combination Requests

Function

Obtaining the List of Warehouse Combination Requests

URI

GET /v2/repositories/{repository_id}/merge_request

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Warehouse Short ID

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

state

No

String

Match Conditions

page

No

String

Indicates the page number.

per_page

No

String

Number of data records on each page

search

No

String

Match Condition

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token.

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Response error.

result

MergeResult object

Result

status

String

Response Status

Table 5 Error

Parameter

Type

Description

code

String

Error Codes

message

String

Error message

Table 6 MergeResult

Parameter

Type

Description

closed

Double

Closed Merge Requests

merge_requests

Array of MergeRequestsItem objects

Merge Request Details

merged

Double

Number of Merged Requests

opened

Double

Number of merging requests when the function is enabled

total

Double

Total number of combination requests

Table 7 MergeRequestsItem

Parameter

Type

Description

author

Author object

Author

closed_at

String

Closing time

created_at

String

Created

description

String

Combination Request Description

devcloud_source_branch

String

Source Branch

id

Double

Combination request ID.

iid

Double

Sequence number of a combination request in the current warehouse.

merge_request_assignee_list

Array of Author objects

Reviewer

merge_status

String

Can Be Merged?

source_branch

String

Source Branch

state

String

Combination Request Status

target_branch

String

Target Branch

title

String

Title

updated_at

String

Update time.

Table 8 Author

Parameter

Type

Description

id

Double

User ID.

name

String

User Name

state

String

Status

username

String

User iamId

Example Requests

GET https://{endpoint}/v2/repositories/907199/merge_request

Example Responses

Status code: 200

OK

{
  "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 Code

Description

200

OK

Error Codes

See Error Codes.