Creating a Project and Forking a Repository
Function
After a warehouse is created, the following parameters are transferred to the fork warehouse: warehouse name, whether to import project members, and home project.
URI
POST /v2/projects/repositories/fork
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling the IAM API (value of X-Subject-Token in the response header). |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
import_members |
No |
Integer |
Indicates whether to import project members. The options are as follows: 0->Do not import project members; 1->Import project members |
project_name |
Yes |
String |
Project name. The options are as follows: The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_), and must start with a letter. |
repo_name |
Yes |
String |
Repository name. The options are as follows: The value can contain uppercase letters, lowercase letters, digits, hyphens (-), and underscores (_), and must start with a letter. Minimum: 2 Maximum: 128 |
template_id |
Yes |
String |
ID of the replication template. |
type |
No |
String |
Project type. The options are normal and scrum. |
visibility_level |
No |
Integer |
Whether the warehouse is a public warehouse |
external_project_info |
No |
ExternalKeyMessage object |
Third-party service information |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Response error. |
result |
ProjectRepository object |
Result |
status |
String |
Status code in a response |
Example Requests
POST https://{endpoint}/v2/projects/{project_uuid}/repositories/fork { "project_name" : "testworld", "repo_name" : "demotest1", "template_id" : 453489, "import_members" : 0, "visibility_level" : 20, "type" : "normal" }
Example Responses
Status code: 200
OK
{ "result" : { "repositoryUuid" : "9a780fd55cd64333b668ba26132629d2", "projectUuid" : "278a03286efe45c6b788122bfc166976" }, "status" : "success" }
Status Codes
Status Code |
Description |
---|---|
200 |
OK |
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.