Creating a Repository Source
Function
This API is used to create a repository source.
URI
POST /v1/configsets/repos
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
No |
String |
Identity authentication information. Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
name |
No |
String |
Repository Name |
|
namespace |
No |
String |
Namespace |
|
gitRepositorySpec |
No |
GitRepositorySpec object |
Git repository information |
|
secretInfo |
No |
SecretInfo object |
Authentication information for accessing the repository |
|
clusterInfo |
No |
ClusterInfo object |
Cluster information |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
url |
No |
String |
Git repository address |
|
ref |
No |
GitRepositoryRef object |
Git reference to be parsed and checked out |
|
secretRef |
No |
LocalObjectReference object |
Secret that contains authentication information |
|
interval |
No |
String |
Interval for periodically checking repository updates. For example, 1m indicates 1 minute. |
|
timeout |
No |
String |
Timeout duration for Git operations (such as clone). The default value is 60 seconds. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
branch |
No |
String |
Git branch to be checked out. If no other fields are defined, the master branch is checked out by default. |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
uid |
String |
Repository ID |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Status code: 409
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Example Requests
Request for creating a repository source
POST https://ucs.myhuaweicloud.com/v1/configsets/repos
{
"name" : "config-0320-02",
"namespace" : "default",
"gitRepositorySpec" : {
"url" : "https://github.com/GitHubxsy/podinfo",
"interval" : "1m",
"timeout" : "1m",
"secretRef" : {
"name" : "https-ca-credentials"
},
"ref" : {
"branch" : "master"
}
},
"clusterInfo" : {
"clusterName" : "flux-wangzy-donot-del",
"clusterID" : "ab03e878-c2f9-11ed-8651-0255ac1001b9",
"clusterPath" : "kustomize"
}
}
Example Responses
Status code: 201
Repository source created
{
"uid" : "xxx-xxx-xxx"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Repository source created |
|
400 |
Client request error. The server could not execute the request. |
|
409 |
There was a request conflict. |
|
500 |
Internal server error |
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