Creating a Project and Repository
Function
After a project is created, the parameters for creating a repository group are generated in the background, including the repository name, template ID, whether to import project members, and home project.
URI
POST /v2/projects/repositories
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Explanation: User token. It can be obtained by calling the corresponding IAM API. The value of X-Subject-Token in the response header is the user token. Constraints: Mandatory Range: 1–100,000 characters. Default value: None |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
import_members |
No |
Integer |
Explanation: Whether to import project members. Constraints: None Range:
Default value: 0 |
project_name |
Yes |
String |
Explanation: Project name. Constraints: Mandatory Range: Start with a letter and use only letters, digits, hyphens (-), and underscores (_). Default value: None |
repo_name |
Yes |
String |
Explanation: Repository name. Constraints: Mandatory Range:
Default value: 0 |
type |
No |
String |
Explanation: Project type, such as scrum. Constraints: None Range: Default value: 0 |
visibility_level |
No |
Integer |
Explanation: Repository visibility. Constraints: None Range:
Default value: 0 |
external_project_info |
No |
ExternalKeyMessage object |
Explanation: Third-party service information. Constraints: None |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
external_key_message |
No |
String |
Explanation: Key information stored by third parties in CodeArts Repo. Constraints: None Range: Character string. Default value: None |
external_service |
No |
String |
Explanation: External service name. Constraints: None Range: Character string. Default value: None |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Explanation: Response error. |
result |
ProjectRepository object |
Explanation: Response result. |
status |
String |
Explanation: Response status. Range:
|
Parameter |
Type |
Description |
---|---|---|
code |
String |
Explanation: Error code. Range: See Error Codes. |
message |
String |
Explanation: Error message. Range: Character string. |
Parameter |
Type |
Description |
---|---|---|
projectUuid |
String |
Explanation: Project ID. For details, see Obtaining a Project ID. Range: 32 characters. |
repositoryUuid |
String |
Explanation: Repository UUID. Range: 32 characters. |
Example Requests
POST https://{endpoint}/v2/projects/repositories
{
"project_name" : "testworld",
"repo_name" : "demotest1",
"import_members" : "0",
"visibility_level" : "20",
"type" : "normal"
}
Example Responses
Status code: 200
OK
{
"result" : {
"repositoryUuid" : "02637c34ba954ab5bd37ff9537fe05b4",
"projectUuid" : "1aeda7a6070d4119b7d8b45e5641599b"
},
"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.