Viewing the General Policies of a Repository
Function
This API is used to view the general policies of the repository.
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:getRepository | Read | - | - | - | - |
URI
GET https://{hostURL}/v4/repositories/{repository_id}/general-policy
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| repository_id | Yes | Integer | Definition You can call the API used to query all repositories of the user to query the project list to obtain the repository ID. 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. You can obtain the token by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token. Constraints N/A Range A string that can contain 1 to 100,000 characters. Default Value N/A |
Response Parameters
Status code: 200
| Parameter | Type | Description |
|---|---|---|
| disable_fork | Boolean | Definition: Whether to forbid to fork this repository. Constraints: N/A. Value range: Default value: N/A. |
| generate_pre_merge_ref | Boolean | Definition: Whether to pre-merge MRs. Constraints: N/A. Value range: Default value: N/A. |
| branch_name_regex | String | Definition: Branch name rule. Constraints: N/A. Value range: N/A. Default value: N/A. |
| tag_name_regex | String | Definition: Tag name rule. Constraints: N/A. Value range: N/A. Default value: N/A. |
| forbidden_developer_create_branch | Boolean | Definition: Whether to forbid developers to create branches. Constraints: N/A. Value range: |
| create_branch_whitelist_users | Array of PushRuleDevelopersDto objects | Definition: A whitelist of developers who have the permission to create branches. |
| repo_encryption_enabled | Boolean | Definition Whether to enable repository encryption. Constraints N/A Range |
| repo_encryption_status | Definition Status of using code repository encryption. |
| Parameter | Type | Description |
|---|---|---|
| id | AnyType | Definition: Primary key ID. Value range: 1~2147483647 |
| user_id | AnyType | Definition: User ID. Value range: 1~2147483647 |
| user_name | AnyType | Definition: Username. |
| nick_name | String | Definition: Alias. Constraints: N/A. Value range: N/A. Default value: N/A. |
| tenant_name | String | Definition: Tenant name. Constraints: N/A. Value range: N/A. Default value: N/A. |
| Parameter | Type | Description |
|---|---|---|
| id | Integer | Definition ID of the repository encryption status. Range N/A Value range: 1~2147483647 |
| status | String | Definition Repository encryption status. Range Default Value N/A Enumeration values: |
| last_encryption_at | String | Definition Last encryption time. Range N/A |
| last_decryption_at | String | Definition Last decryption time. Range N/A |
| is_consistent | Boolean | Definition Whether to enable repository encryption. Constraints N/A Range |
Example Requests
None
Example Responses
Status code: 200
General policies of a repository.
{
"disable_fork" : true,
"generate_pre_merge_ref" : true,
"branch_name_regex" : "^[0-9]*$",
"tag_name_regex" : "^[0-9]*$",
"forbidden_developer_create_branch" : true,
"create_branch_whitelist_users" : [ {
"id" : "198,",
"user_id" : "9458,",
"user_name" : "test_01",
"nick_name" : "test_01",
"tenant_name" : "test"
} ]
} Status Codes
| Status Code | Description |
|---|---|
| 200 | General policies of a repository. |
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