ListPushRules
Lists the push rules for a specified repository. This operation does not support pagination.
Operation description
This operation requires repository administrator permissions or higher.
Try it now
Test
RAM authorization
Request syntax
GET /api/v4/projects/{repositoryId}/push_rule/push_rules/list HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| repositoryId |
integer |
Yes |
The ID of the repository. |
889910 |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| organizationId |
string |
Yes |
The organization ID. You can find this ID in the URL of your organization's page on the Alibaba Cloud DevOps platform: |
60d54f3daccf2bbd6659f3ad |
| accessToken |
string |
No |
The personal access token. This parameter is not required if you use an Alibaba Cloud AccessKey pair or a Security Token Service (STS) token for authentication. |
f0b1e61db5961df5975a93f9129d2513 |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response schema. |
||
| requestId |
string |
The request ID. |
ASSDS-ASSASX-XSAXSA-XSAXSAXS |
| errorCode |
string |
The error code. |
Openapi.RequestError |
| errorMessage |
string |
The error message. |
"" |
| success |
boolean |
Indicates whether the request was successful. |
true |
| total |
integer |
The total number of results. |
2 |
| result |
array<object> |
The list of results. |
|
|
array<object> |
Details of a push rule. |
||
| id |
integer |
The ID of the push rule. |
2077 |
| ruleInfos |
array<object> |
A list of rule details. |
|
|
object |
Details of a rule checker. |
||
| checkerName |
string |
The name of the rule checker. Valid values include:
|
CommitFilesChecker |
| checkerType |
string |
Specifies the restriction level. This parameter is valid only for the commit author check and the committer check. It is optional for other rules. Valid values:
|
warn |
| extraMessage |
string |
Provides additional configuration for certain rule checkers:
|
"" |
| fileRuleRegexes |
array |
This parameter is valid only for the committed file restriction rule. You can provide one or more regular expressions to restrict committed files. |
|
|
string |
A regular expression used to restrict file paths. |
\.java$ |
|
| gmtCreate |
string |
The time when the rule was created. |
2023-09-03T18:20:06+08:00 |
| gmtModified |
string |
The time when the rule was last updated. |
2023-09-03T18:20:06+08:00 |
Examples
Success response
JSON format
{
"requestId": "ASSDS-ASSASX-XSAXSA-XSAXSAXS",
"errorCode": "Openapi.RequestError",
"errorMessage": "\"\"",
"success": true,
"total": 2,
"result": [
{
"id": 2077,
"ruleInfos": [
{
"checkerName": "CommitFilesChecker",
"checkerType": "warn",
"extraMessage": "\"\"",
"fileRuleRegexes": [
"\\.java$"
]
}
],
"gmtCreate": "2023-09-03T18:20:06+08:00",
"gmtModified": "2023-09-03T18:20:06+08:00"
}
]
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.