Updated on 2025-12-01 GMT+08:00

Creating a Configuration Set

Function

This API is used to create a configuration set.

URI

POST /v1/configsets

Request Parameters

Table 1 Request header 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.

Table 2 Request body parameters

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

Table 3 GitRepositorySpec

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.

Table 4 GitRepositoryRef

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.

Table 5 LocalObjectReference

Parameter

Mandatory

Type

Description

name

No

String

Referent name

Table 6 KustomizationSpec

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

Table 7 SourceRef

Parameter

Mandatory

Type

Description

kind

Yes

String

Type of the referent. The value must be OCIRepository, GitRepository, or Bucket.

name

Yes

String

Referent name

Table 8 ClusterInfo

Parameter

Mandatory

Type

Description

clusterID

No

String

Cluster ID

clusterName

No

String

Cluster name

clusterPath

No

String

Cluster path

Table 9 SecretInfo

Parameter

Mandatory

Type

Description

authMode

No

String

Authentication mode

secret

No

Object

Secret that stores the authentication credential

Response Parameters

Status code: 201

Table 10 Response body parameters

Parameter

Type

Description

uid

String

Configuration set ID

Status code: 400

Table 11 Response body parameters

Parameter

Type

Description

-

String

-

Status code: 409

Table 12 Response body parameters

Parameter

Type

Description

-

String

-

Status code: 500

Table 13 Response body parameters

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.