Creating a Repository System Tag
Function
This API is used to create a repository system tag.
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
Authorization Information
Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.
|
Action |
Access Level |
Resource Type (*: required) |
Condition Key |
Alias |
Dependencies |
|---|---|---|---|---|---|
|
codeartsrepo:repository:setRepository |
Write |
- |
- |
- |
- |
URI
POST https://{hostURL}/v4/repositories/{repository_id}/system-labels
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
repository_id |
Yes |
Integer |
Definition You can query the project list to obtain the repository ID by calling the API used to query user's all repositories. Constraints N/A Default Value N/A Value range: 1~2147483647 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition User token. Obtain one by calling the IAM API Obtaining a User Token. The value of X-Subject-Token in the response header is a token. Constraints N/A Range 1–100,000 characters. Default Value N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
[items] |
Array of LabelDetailDto objects |
Tag list. |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
Integer |
Definition: Tag ID. Value range: 1–2147483647 Value range: 1~2147483647 |
|
name |
String |
Definition: Tag name. Value range: N/A. |
|
color |
String |
Definition: Tag color, which is provided in a 6-character hexadecimal format starting with sign (#) (for example, #FFAABB). Value range: Regular expression: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ |
|
description |
String |
Definition: Description. Value range: N/A. |
|
text_color |
String |
Definition: Font color, which is provided in a 6-digit hexadecimal format starting with sign (#) (for example, #FFAABB). Value range: Regular expression: ^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$ |
|
expires_at |
String |
Definition: Expiration time. Value range: N/A. |
|
is_expired |
Boolean |
Definition: Whether it is invalid. Value range: N/A. |
|
open_merge_requests_count |
Integer |
Definition: Number of enabled MRs to be associated. Constraints: This field is returned by the MR repository. Value range: 0–2147483647 Value range: 0~2147483647 |
|
open_change_request_count |
Integer |
Definition: Number of enabled CRs to be associated. Constraints: This field is returned by the CR repository. Value range: 0–2147483647 Value range: 0~2147483647 |
|
priority |
Integer |
Definition: Priority. Value range: N/A. Value range: 0~30 |
|
is_repository_label |
Boolean |
Definition: Whether it is a repository tag. Value range: N/A. |
Example Requests
None
Example Responses
Status code: 200
Repository system tag.
[ {
"id" : 196,
"name" : "Bug",
"color" : "#CC0033",
"description" : "Fix bug",
"text_color" : "#FFFFFF",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
}, {
"id" : 197,
"name" : "Critical",
"color" : "#f90027",
"description" : "Fix critical defects",
"text_color" : "#FFFFFF",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
}, {
"id" : 198,
"name" : "Feature",
"color" : "#428BCA",
"description" : "New features",
"text_color" : "#FFFFFF",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
}, {
"id" : 199,
"name" : "Major",
"color" : "#F0AD4E",
"description" : "Fix major defects",
"text_color" : "#FFFFFF",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
}, {
"id" : 200,
"name" : "Minor",
"color" : "#0033CC",
"description" : "Fix minor defects",
"text_color" : "#FFFFFF",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
}, {
"id" : 201,
"name" : "Suggestion",
"color" : "#A8D695",
"description" : "Optimization suggestions",
"text_color" : "#333333",
"expires_at" : null,
"is_expired" : false,
"open_merge_requests_count" : 0,
"priority" : 0,
"is_repository_label" : true
} ]
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Repository system tag. |
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