Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ CodeArts Repo/ API Reference/ APIs/ Repository/ Obtaining the MR List of a Repository

Obtaining the MR List of a Repository

Updated on 2025-01-14 GMT+08:00

Function

This API is used to obtain the MR list of a repository.

URI

GET /v2/repositories/{repository_id}/merge_request

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Explanation:

Repository short ID, which corresponds to Repository ID on the console.

Constraints:

Mandatory

Range:

0–2147483647

Default value:

None

Table 2 Query parameters

Parameter

Mandatory

Type

Description

state

No

String

Explanation:

MR status.

Constraints:

None

Range:

The value can be any one of the following:

opened: The MR is open.

closed: The MR is closed.

merged: The MR has been merged.

locked: The MR is locked.

all: MRs in any status.

Default value:

all: MRs in any status.

page

No

String

Explanation:

Page number.

Constraints:

None

Range:

A positive integer

Default value:

1

per_page

No

Integer

Explanation:

Number of records displayed on each page.

Constraints:

None

Range:

0–2147483647

Default value:

20

search

No

String

Explanation:

Character string contained in MR titles or descriptions.

Constraints:

None

Range:

Max. 100 characters.

Default value:

None

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Explanation:

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

Constraints:

Mandatory

Range:

1–100,000 characters.

Default value:

None

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error code.

result

MergeResult object

Explanation:

Response result.

status

String

Explanation:

Response status of the API.

Range:

  • success: The API call is successful.
  • failed: The API call failed.
Table 5 Error

Parameter

Type

Description

code

String

Explanation:

Error code.

Range:

Max. 100 characters in the error code format.

message

String

Explanation:

Error message.

Range:

None

Table 6 MergeResult

Parameter

Type

Description

closed

Double

Explanation:

Number of closed MRs.

Range:

0–2147483647

merge_requests

Array of MergeRequestsItem objects

Explanation:

MR list.

merged

Double

Explanation:

Number of merged MRs.

Range:

0–2147483647

opened

Double

Explanation:

Number of open MRs.

Range:

0–2147483647

total

Double

Explanation:

Total number of MRs.

Range:

0–2147483647

Table 7 MergeRequestsItem

Parameter

Type

Description

author

Author object

Explanation:

MR author.

closed_at

String

Explanation:

Time when an MR was closed.

created_at

String

Explanation:

Time when an MR was created.

description

String

Explanation:

MR description.

devcloud_source_branch

String

Explanation:

MR source branch.

id

Double

Explanation:

MR ID.

Range:

0–2147483647

iid

Double

Explanation:

Sequence number of an MR in the current repository.

Range:

0–2147483647

merge_request_assignee_list

Array of Author objects

Explanation:

MR reviewer information.

merge_status

String

Explanation:

Whether an MR can be merged.

Range:

can_be_merged: Yes

cannot_be_merged: No

unchecked: Not yet checked

cannot_be_merged_recheck: No, and currently being checked

source_branch

String

Explanation:

MR source branch name.

state

String

Explanation:

MR status.

Range:

The value can be any one of the following:

opened: The MR is open.

closed: The MR is closed.

merged: The MR has been merged.

locked: The MR is locked.

target_branch

String

Explanation:

MR target branch name.

title

String

Explanation:

MR title.

updated_at

String

Explanation:

Last update time of an MR.

Table 8 Author

Parameter

Type

Description

id

Double

Explanation:

User ID.

name

String

Explanation:

Username.

state

String

Explanation:

User status.

username

String

Explanation:

IAM user ID.

avatar_url

String

Explanation:

Profile picture URL.

web_url

String

Explanation:

Web URL.

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.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback