Creating a Configuration Set
Function
This API is used to create a configuration set.
URI
POST /v1/configsets
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 |
Yes |
String |
Name of a configuration set |
|
namespace |
Yes |
String |
Namespace |
|
configSetType |
No |
String |
Type of a configuration set |
|
repoName |
No |
String |
Source Code Repository Name |
|
bucketSpec |
No |
Object |
Basic information about an object storage bucket |
|
helmChartSpec |
No |
Object |
Basic information about the Helm chart source |
|
gitRepositorySpec |
No |
GitRepositorySpec object |
Basic information about the Git repository source |
|
helmRepositorySpec |
No |
Object |
Basic information about the Helm repository |
|
kustomizationSpec |
No |
KustomizationSpec object |
Kustomization deployment parameters |
|
clusterInfo |
No |
ClusterInfo object |
Destination cluster information |
|
secretInfo |
No |
SecretInfo object |
Authentication information for accessing the configuration source |
|
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. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
path |
No |
String |
Path of the kustomization.yaml file |
|
interval |
No |
String |
Interval at which the controller executes kustomization synchronization and verification |
|
timeout |
No |
String |
Timeout for the verification, application, and health check operations |
|
sourceRef |
No |
SourceRef object |
Source reference of the kustomization file |
|
targetNamespace |
No |
String |
Namespace to be set or overridden in the kustomization.yaml file |
|
prune |
No |
Boolean |
Whether to enable garbage collection |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
kind |
Yes |
String |
Type of the referent. The value must be OCIRepository, GitRepository, or Bucket. |
|
name |
Yes |
String |
Referent name |
Response Parameters
Status code: 201
|
Parameter |
Type |
Description |
|---|---|---|
|
uid |
String |
Configuration set ID |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Status code: 409
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
- |
String |
- |
Example Requests
Creating a configuration set
POST https://ucs.myhuaweicloud.com/v1/configsets
{
"name" : "example",
"namespace" : "default",
"gitRepositorySpec" : {
"url" : "https://github.com/example/app-configs.git",
"ref" : {
"branch" : "master"
},
"interval" : "1m",
"timeout" : "1m"
},
"clusterInfo" : {
"clusterName" : "test",
"clusterID" : "db46d87b-469e-11f0-8c47-0255ac100b09"
},
"repoName" : "example",
"configSetType" : "Kustomize",
"kustomizationSpec" : {
"path" : "xxx",
"interval" : "1m",
"timeout" : "1m",
"sourceRef" : {
"kind" : "GitRepository",
"name" : "example"
},
"targetNamespace" : "default"
}
}
Example Responses
Status code: 201
Configuration set created
{
"uid" : "7e1b45ef-84ab-4604-9a49-c9cba87cb1cd"
}
Status Codes
|
Status Code |
Description |
|---|---|
|
201 |
Configuration set 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