Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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 MR Details of a Repository

Obtaining MR Details of a Repository

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

Function

This API is used to obtain MR details of a repository.

URI

GET /v2/repositories/{repository_id}/merge_request/{merge_request_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

repository_id

Yes

Integer

Explanation:

Repository short ID.

Constraints:

Mandatory

Range:

0–2147483647

Default value:

None

merge_request_id

Yes

Integer

Explanation:

MR ID.

Constraints:

Mandatory

Range:

0–2147483647

Default value:

None

Request Parameters

Table 2 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 3 Response body parameters

Parameter

Type

Description

error

Error object

Explanation:

Response error code.

result

MergeInfoResult 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 4 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 5 MergeInfoResult

Parameter

Type

Description

approval_merge_request_approvers

Array of ApprovalMergeRequestApproversItem objects

Explanation:

Scorer.

author

Author object

Explanation:

Author.

closed_at

String

Explanation:

Closing time.

created_at

String

Explanation:

Creation time.

description

String

Explanation:

MR description.

devcloud_source_branch

String

Explanation:

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

is_source_branch_exist

Boolean

Explanation:

Whether the source branch exists.

merge_request_assignee_list

Array of MergeRequestAssigneeListItem objects

Explanation:

Reviewer.

merge_request_diff

MergeRequestDiff object

Explanation:

Merge differences.

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:

Source branch.

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:

Target branch.

title

String

Explanation:

Title.

updated_at

String

Explanation:

Update time.

merged_at

String

Explanation:

Merging time.

merged_by

MergedByUser object

Explanation:

Merger.

merge_request_related_work_items

Array of MergeRequestRelatedWorkItem objects

Explanation:

Associated work items.

Table 6 ApprovalMergeRequestApproversItem

Parameter

Type

Description

id

Double

Explanation:

User ID.

name

String

Explanation:

Username.

nick_name

String

Explanation:

User alias.

state

String

Explanation:

User status.

username

String

Explanation:

IAM user ID.

Table 7 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.

Table 8 MergeRequestAssigneeListItem

Parameter

Type

Description

id

Double

Explanation:

User ID.

name

String

Explanation:

Username.

state

String

Explanation:

User status.

username

String

Explanation:

IAM user ID.

Table 9 MergeRequestDiff

Parameter

Type

Description

id

Double

Explanation:

MR difference ID.

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.

merge_request_id

Double

Explanation:

MR ID.

Range:

0–2147483647

created_at

String

Explanation:

Creation time.

updated_at

String

Explanation:

Update time.

base_commit_sha

String

Explanation:

Base commit.

real_size

Double

Explanation:

Actual size.

head_commit_sha

String

Explanation:

Head commit.

start_commit_sha

String

Explanation:

Start commit.

commits_count

Double

Explanation:

Number of commits.

external_diff

String

Explanation:

External differences.

external_diff_store

Double

Explanation:

External storage differences.

stored_externally

Boolean

Explanation:

Whether external storage exists.

added_lines

Double

Explanation:

Number of new lines.

removed_lines

Double

Explanation:

Number of deleted lines.

Table 10 MergedByUser

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:

Homepage URL.

Table 11 MergeRequestRelatedWorkItem

Parameter

Type

Description

id

Double

Explanation:

Work item ID.

user_id

String

Explanation:

User ID.

repo_id

Double

Explanation:

Repository ID.

merge_request_id

Double

Explanation:

MR ID.

target_branch

String

Explanation:

Target branch

source_branch

String

Explanation:

Source branch

merge_request_title

String

Explanation:

MR title

merge_request_url

String

Explanation:

MR URL

merge_request_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.

related_id

String

Explanation:

Associated work item ID.

related_title

String

Explanation:

Associated work item title

related_url

String

Explanation:

Associated work item URL

result

Double

Explanation:

Query result

create_at

String

Explanation:

Creation time.

update_at

String

Explanation:

Update time.

Example Requests

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

Example Responses

Status code: 200

OK

{
  "result" : {
    "iid" : 1,
    "approval_merge_request_approvers" : [ {
      "nick_name" : "emily",
      "name" : "emily",
      "id" : 7513,
      "state" : "optional",
      "username" : "0c1de3e61c80d56b1f7dc01164788784"
    }, {
      "nick_name" : "lmptest02",
      "name" : "lmptest02",
      "id" : 7745,
      "state" : "optional",
      "username" : "2ef8c2c835424e988ff33a8339ee1cb4"
    } ],
    "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-09T11:21:02.000+08:00",
    "id" : 6670,
    "state" : "opened",
    "closed_at" : "2021-12-08T16:34:50.000+08:00",
    "author" : {
      "name" : "repo",
      "id" : 6879,
      "state" : "active",
      "username" : "e0c068bf68c44bfab87b763ff85da277"
    },
    "is_source_branch_exist" : true,
    "target_branch" : "master",
    "merge_status" : "unchecked",
    "merge_request_diff" : {
      "merge_request_id" : 6670,
      "head_commit_sha" : "715fc146292edc31a588fbc74349a2b8d18dbc27",
      "updated_at" : "2021-12-09T11:20:58.000+08:00",
      "start_commit_sha" : "02f0482056d3b949699eb69683914466c84529af",
      "created_at" : "2021-12-09T11:20:58.000+08:00",
      "base_commit_sha" : "6e90282f6334433a9fe3be809a7c1eed1afbf10b",
      "commits_count" : 2
    },
    "devcloud_source_branch" : "branch123",
    "merge_request_assignee_list" : [ {
      "name" : "Flying snow in June",
      "id" : 6743,
      "state" : "active",
      "username" : "a618e34bd5704be3ae3395dfede06041"
    }, {
      "name" : "General administrator account",
      "id" : 6747,
      "state" : "active",
      "username" : "42dd0277cfb048dea856e4ee352e937d"
    } ],
    "merged_at" : "2023-08-14T20:51:51.000+08:00",
    "merged_by" : {
      "id" : "9124,",
      "name" : "CodeHub_beta_dev",
      "username" : "c369c68f1ff84679b5a8ed904d8bff1c",
      "state" : "active",
      "avatar_url" : "",
      "web_url" : "https://test.com/c369c68f1ff84679b5a8ed904d8bff1c"
    },
    "merge_request_related_work_items" : [ {
      "id" : 7343,
      "user_id" : "9124",
      "repo_id" : 2111746921,
      "merge_request_id" : 20637,
      "target_branch" : "master",
      "source_branch" : "test123",
      "merge_request_url" : "https://test.com/codehub/2111746921/18/mergedetail?source=test123&target=master",
      "merge_request_state" : "opened",
      "related_id" : "6437435",
      "related_title" : "msm-0115-1000",
      "related_url" : "https://test.com/projectman/scrum/e76c13e86364438d9183ca2f395371e1/task/detail/6437435",
      "result" : 1,
      "create_at" : "2023-09-18T20:29:59.000+08:00",
      "update_at" : "2023-09-18T20:29:59.000+08:00"
    } ]
  },
  "status" : "success"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback