Project
# Create Project
# Create Empty Project
Will create an empty project without any service resources or environment resources.
Request
POST /openapi/projects/project
1
Body Parameter Description
| Parameter Name | Description | Type | Required | Example |
|---|---|---|---|---|
project_name | Project name | string | Yes | voting-app |
project_key | Project identifier, naming rules as follows: Supports lowercase letters and numbers, as well as hyphens - | string | Yes | voting-app |
is_public | Whether it is a public project | bool | Yes | false |
description | Project description | string | No | Voting system |
project_type | Project type, optional values as follows:helm (i.e.: Kubernetes Helm Chart project)yaml (i.e.: Kubernetes YAML project)loaded (i.e.: Kubernetes managed project) | string | Yes | yaml |
Response
{
"message": "success"
}
1
2
3
2
3
# Create YAML Project and Initialize
Suitable for Kubernetes YAML type projects.
Request
POST /openapi/projects/project/init/yaml
1
Body Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
project_name | Project name | string | Yes |
project_key | Project identifier, naming rules as follows: Supports lowercase letters and numbers, as well as hyphens - | string | Yes |
project_type | Project type, fixed value yaml | string | Yes |
is_public | Whether it is a public project | bool | Yes |
description | Project description | string | No |
service_list | Service list | []Service | Yes |
env_list | Environment list | []Env | Yes |
Service Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
source | Service creation source, there are two creation sources:template: Create service through templateyaml: Create service through handwritten yaml | string | Yes |
template_name | Service template name | string | Required when source is template |
variable_yaml | Variables in service template | []KeyVal | No |
auto_sync | Auto-sync switch, effective when source is template | bool | No |
service_name | Service name | string | Yes |
yaml | Service YAML configuration | string | Required when source is yaml |
Env Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment identifier | string | Yes |
cluster | Cluster name | string | Yes |
namespace | Namespace name where the environment is located | string | Yes |
KeyVal Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable key | string | Yes |
value | Variable value, if there is nested content, use json format | any | Yes |
Body Parameter Example
Taking creating demo project and initializing new service myapp-1 and environment dev as an example:
{
"project_name": "demo",
"project_key": "demo",
"project_type": "yaml",
"is_public": true,
"description": "demo project",
"service_list": [
{
"source": "yaml",
"service_name": "myapp-1",
"yaml": "apiVersion: v1\nkind: Service\nmetadata:\n name: a\n labels:\n app: a\nspec:\n ports:\n - name: http\n port: 80\n targetPort: 8080\n selector:\n app: a\n\n---\n\napiVersion: apps/v1\nkind: Deployment\nmetadata:\n name: a\n labels:\n app: a\nspec:\n selector:\n matchLabels:\n app: a\n replicas: 1\n template:\n metadata:\n labels:\n app: a\n spec:\n containers:\n - name: myapp-1\n image: koderover.tencentcloudcr.com/koderover-demo/myapp-1:v0.1__linux_amd64\n imagePullPolicy: Always\n command: [\"/myapp-1\"]\n args: [\"--downstream-addr\", \"$(DOWNSTREAM_ADDR)\", \"--headers\", \"$(HEADERS)\"]\n env:\n - name: DOWNSTREAM_ADDR\n value: \"b\"\n - name: HEADERS\n value: \"x-request-id\"\n ports:\n - containerPort: 8080\n resources:\n limits:\n cpu: 100m\n memory: 100Mi\n"
}
],
"env_list": [
{
"env_key": "dev",
"cluster_name": "dev",
"namespace": "demo-env-dev"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Response
{
"message": "success"
}
1
2
3
2
3
# Create Helm Project and Initialize
Request
POST /openapi/projects/project/init/helm
1
Body Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
project_name | Project name | string | Yes |
project_key | Project identifier, naming rules as follows: Supports lowercase letters and numbers, as well as hyphens - | string | Yes |
is_public | Whether it is a public project | bool | Yes |
description | Project description | string | No |
service_list | Service list | []Service | Yes |
env_list | Environment list | []Env | Yes |
Service Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
service_name | Service name | string | Yes |
source | Service creation type, fixed value: template | string | Yes |
template_name | Service template name | string | Required when source is template |
variable_yaml | Variables in service template | []KeyVal | No |
auto_sync | Auto-sync switch, effective when source is template | bool | No |
values_yaml | Helm values file | string |
Env Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
env_key | Environment identifier | string | Yes |
cluster_name | Cluster name | string | Yes |
namespace | Namespace name where the environment is located | string | Yes |
KeyVal Parameter Description
| Parameter Name | Description | Type | Required |
|---|---|---|---|
key | Variable key | string | Yes |
value | Variable value, if there is nested content, use json format | any | Yes |
Body Parameter Example
{
"project_name":"helm project test 2",
"project_key":"test-helm-2",
"is_public":true,
"description":"test",
"service_list":[
{
"source":"template",
"service_name":"service33",
"template_name":"minmin-helm-template",
"variable_yaml":[{"key":"port","value":"7777"}],
"values_yaml":"",
"auto_sync":true
}
],
"env_list":[
{
"env_key":"dev1",
"cluster_name":"local-20220823144517",
"namespace":"test-helm-env-dev"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
Response
{
"message": "success"
}
1
2
3
2
3
# Get Project List
Request
GET /openapi/projects/project?pageSize=<current page display count>&pageNum=<current page number>
1
Query Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
pageSize | int | Pagination display count per page, default value: 20 | No |
pageNum | int | Current page number for pagination, default value: 1 | No |
Response Description
| Parameter Name | Type | Description |
|---|---|---|
projects | []Project | Project list |
total | int | Total number of projects |
Project Parameter Description
| Parameter Name | Type | Description |
|---|---|---|
project_name | string | Project name |
project_key | string | Project identifier |
deploy_type | string | Project deployment type:helm: Kubernetes Helm Chart projectyaml: Kubernetes YAML projectloaded: Kubernetes managed project |
desc | string | Project description |
Response Example
{
"total": 14,
"projects": [
{
"project_name": "lilian-test",
"project_key": "lilian-test",
"description": "",
"deploy_type":"k8s"
},
{
"project_name": "Release Center",
"project_key": "release-center",
"description": "migrate from deploy center",
"deploy_type":"k8s"
}
]
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# Get Specific Project Details
Request
GET /openapi/projects/project/detail?projectKey=<project identifier>
1
Query Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
projectKey | string | Project identifier | Yes |
Response Description
| Parameter Name | Type | Description |
|---|---|---|
project_name | string | Project name |
project_key | string | Project identifier |
deploy_type | string | Project deployment type:helm: Kubernetes Helm Chart projectyaml: Kubernetes YAML projectloaded: Kubernetes managed project |
desc | string | Project description |
created_by | string | Creator |
created_time | int | Creation time |
Response Example
{
"project_name": "lilian-test",
"project_key": "lilian-test",
"desc": "",
"deploy_type": "k8s",
"create_time": 1686134245,
"created_by": "admin",
}
1
2
3
4
5
6
7
8
2
3
4
5
6
7
8
# Delete Project
Request
DELETE /openapi/projects/project?projectKey=<project identifier>&isDelete=<whether to delete project related resources>
1
Query Parameter Description
| Parameter Name | Type | Description | Required |
|---|---|---|---|
projectKey | string | Project identifier | Yes |
isDelete | bool | Whether to delete the Kubernetes namespace and services corresponding to the environment | Yes |
Success Response Description
{message: "success"}
1


