Obtaining the Basic Settings of a Specified Project
Function
This API is used to obtain basic settings of a specified project.
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:group:getGroup |
Read |
- |
- |
- |
- |
URI
GET https://{hostURL}/v4/projects/{project_id}/general-policy
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition You can obtain the unique project identifier, 32-character project UUID, by calling the API used to query the project list. Range String length: 32 characters. |
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 |
|---|---|---|
|
disable_fork |
Boolean |
Definition Whether to disable fork. |
|
forbidden_developer_create_branch |
Boolean |
Definition Whether to forbid developers to create branches. |
|
forbidden_developer_create_tag |
Boolean |
Definition Whether to forbid developers to create tags. |
|
forbidden_committer_create_branch |
Boolean |
Definition Developers are not allowed to create tags. |
|
branch_name_regex |
String |
Definition Regular expression of the branch name. Range 1–1,000 characters. |
|
tag_name_regex |
String |
Definition Regular expression of the tag name. Range 1–1,000 characters. |
|
generate_pre_merge_ref |
Boolean |
Definition Generate a merge request for pre-merging. |
|
forbidden_gitlab_access |
Boolean |
Definition Whether to forbid repo access. |
|
rebase_disable_trigger_webhook |
Boolean |
Definition Whether to forbid the MR rebase to trigger the webhook event. |
|
open_gpg_verified |
Boolean |
Definition Whether to enable GPG public key authentication. |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition Error code. |
|
error_msg |
String |
Definition Error message. |
Example Requests
GET https://{endpoint}/v4/projects/{project_id}/general-policy
Example Responses
Status code: 200
Obtain basic settings of a specified project.
{
"disable_fork" : false,
"forbidden_developer_create_branch" : false,
"forbidden_developer_create_tag" : false,
"forbidden_committer_create_branch" : null,
"branch_name_regex" : null,
"tag_name_regex" : null,
"generate_pre_merge_ref" : false,
"forbidden_gitlab_access" : null,
"rebase_disable_trigger_webhook" : null,
"open_gpg_verified" : null
}
Status code: 401
Unauthorized
{
"error_code" : "DEV.00000003",
"error_msg" : "Authentication information expired."
}
Status code: 403
Bad Request
{
"error_code" : "CH.004403",
"error_msg" : "Insufficient permissions. Apply for the required permissions and try again."
}
Status code: 404
Not Found
{
"error_code" : "CH.004404",
"error_msg" : "Project Not Found. Project Not Found"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Obtain basic settings of a specified project. |
|
401 |
Unauthorized |
|
403 |
Bad Request |
|
404 |
Not Found |
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