Creating a Project and Repository
Description
This API is used to create a project first, then create a repository in the project.
URI
POST /v2/projects/repositories
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. It can be obtained 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. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
import_members |
No |
Integer |
Whether to import project members. 0: No. 1: Yes. |
|
project_name |
Yes |
String |
Project name. Start with a letter and use only letters, digits, hyphens (-), and underscores (_). |
|
repo_name |
Yes |
String |
Repository name. Start with a letter and use only letters, digits, hyphens (-), and underscores (_). Minimum length: 2 Maximum length: 128 |
|
type |
No |
String |
Project type, scrum |
|
visibility_level |
No |
Integer |
Repository visibility: *Private: Only repository members can read, write and access the repository. The value is 0. *Public: 1. Read-only for project members: Only project members can read, view and search for repositories of a project or a repository group. The value is 10. 2. Read-only for tenant members: Only tenant members can read, view and search for repositories of a project or a repository group. The value is 10. 3. Read-only for all visitors: All visitors can read, view and search for repositories of a project or a repository group. The value is 20. |
|
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 |
Response result |
|
status |
String |
Response status |
|
Parameter |
Type |
Description |
|---|---|---|
|
projectUuid |
String |
Project ID. For details, see Obtaining a Project ID. Minimum length: 32 Maximum length: 32 |
|
repositoryUuid |
String |
Repository UUID Minimum length: 32 Maximum length: 32 |
Request Examples
POST https://{endpoint}/v2/projects/repositories
{
"project_name" : "testworld",
"repo_name" : "demotest1",
"import_members" : "0",
"visibility_level" : "20",
"type" : "normal"
}
Response Examples
Status code: 200
Request succeeded
{
"result" : {
"repositoryUuid" : "02637c34ba954ab5bd37ff9537fe05b4",
"projectUuid" : "1aeda7a6070d4119b7d8b45e5641599b"
},
"status" : "success"
}
Status Codes
|
Status Codes |
Description |
|---|---|
|
200 |
Request succeeded |
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