Creating a repository
Function
Creates a repository on a specified project with the specified name. Input parameters: repository name, template ID, whether to import project members, and home project
URI
POST /v1/repositories
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Specifies the user token. It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token. |
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 |
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. |
project_uuid |
Yes |
String |
Specifies the UUID of a project. Minimum: 32 Maximum: 32 |
template_id |
No |
String |
ID of the replication template. |
visibility_level |
No |
Integer |
Warehouse status. The options are as follows: 0: private; 20: public and read-only |
import_url |
No |
String |
Encrypting the HTTPS Address of the Template Repository Using Base64 |
description |
No |
String |
Repository description. |
gitignore_id |
No |
String |
Generating the .gitignore File Based on the Programming Language |
license_id |
No |
Integer |
License ID |
enable_readme |
No |
Integer |
Indicates whether to allow README file generation. |
caller |
No |
String |
Invoker |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
error |
Error object |
Response error. |
result |
Repository object |
Result |
status |
String |
Response Status |
Example Requests
POST https://{endpoint}/v1/repositories { "project_uuid": "4838955a48e2492bbe44b31bc4c272f6", "name": "demotest1", "import_members": "0", "visibility_level": "20", }
Example Responses
Status code: 200
OK
{ "result" : { "repository_uuid" : "d161fd00d9194816a455cb3c1d6a783e" }, "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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot