Skip to content

Commit

Permalink
Merge pull request #1055 from alex-smile/ft_esb_update_apis_20221220_2
Browse files Browse the repository at this point in the history
ESB 更新配置类组件
  • Loading branch information
alex-smile authored Dec 20, 2022
2 parents 4f53b52 + a684c25 commit 12a00b6
Show file tree
Hide file tree
Showing 52 changed files with 6,209 additions and 1 deletion.
2 changes: 1 addition & 1 deletion paas2/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.14.38
2.14.39
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
### Function description

Add hosts to the service idle machine
- This interface ensures that hosts are either added successfully or fail at the same time

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

| field | type | mandatory | description |
| -----------|------------|--------|------------|
| bk_host_list | array | Yes | Host information (array length is limited to 200 at a time) |
| bk_biz_id | int | yes | business_id |

#### bk_host_list(host-related fields)

| field | type | required | description |
| -----------|------------|--------|------------|
| bk_host_innerip | string | yes | host_internal_ip |
| bk_cloud_id | int | Yes | cloud_region_id |
| bk_addressing | string | Yes | Addressing method, "static", "dynamic" |
| operator | string | No | Primary maintainer |
...

### Request Parameters Example

```python
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "xxx",
"bk_token": "xxx",
"bk_biz_id": 3,
"bk_host_list": [
{
"bk_host_innerip": "10.0.0.1",
"bk_cloud_id": 0,
"bk_addressing": "dynamic",
"operator": "admin"
},
{
"bk_host_innerip": "10.0.0.2",
"bk_cloud_id": 0,
"bk_addressing": "dynamic",
"operator": "admin"
}
]
}
```

### Return Result Example

```python

{
"result": true,
"code": 0,
"message": "",
"permission": null,
"request_id": "e43da4ef221746868dc4c837d36f3807",
"data": {
"bk_host_ids": [
1,
2
]
}
}
```
### Return Result Parameters Description

#### response

| name | type | description |
| ------- | ------ | ------------------------------------- |
| result | bool | Whether the request was successful or not. true:request successful; false request failed.
| code | int | The error code. 0 means success, >0 means failure error.
| message | string | The error message returned by the failed request.
| data | object | The data returned by the request.
| permission | object | Permission information |
| request_id | string | Request chain id |

#### data
| field | type | description |
| -----------|-----------|--------------|
| bk_host_ids | array | host_id of the host |
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
### Function Description

Batch create namespace (version: v3.10.23+, auth: create container namespace)

### Request parameters

{{ common_args_desc }}

#### Interface Parameters

| field | type | required | description |
|----------------------------|------------|--------|--------------------------------------------|
| bk_biz_id | int| yes |business_id|
| data | array| Yes |namespace array, limited to 200 at a time|

#### data
| field | type | required | description |
|----------------------------|------------|--------|--------------------------------------------|
| bk_cluster_id | int| yes | The unique id of the cluster identified in cmdb, passed in with cluster_uid.
|name | string |yes |namespace name|
|labels| map |no |labels|
| resource_quotas| array | no |namespace CPU and memory requests and limits|

#### resource_quotas[0]
| field | type | required | description |
| ----- | ----- | ------------|------------ |
|hard | object |no |hard limits required per named resource|
|scopes | array |no |Quota scopes,optional values are: "Terminating", "NotTerminating", "BestEffort", "NotBestEffort", "PriorityClass", "CrossNamespacePodAffinity" |scope_selector
|scope_selector |no | object |scope selector|

#### scope_selector
| field | type | required | description |
| ----- | ----- | ------------|------------ |
|match_expressions |no | array |match_expressions|

#### match_expressions[0]
| field | type | required | description |
| ----- | ----- | ------------|------------ |
|scope_name | array | is |quota scope,optional values are: "Terminating", "NotTerminating", "BestEffort", "NotBestEffort", "PriorityClass", " CrossNamespacePodAffinity"|
|operator | string |Yes | selector operator, with optional values "In", "NotIn", "Exists", "DoesNotExist"|
|values | array |no |Array of strings, cannot be empty if the operator is "In" or "NotIn", must be empty if it is "Exists" or "DoesNotExist"|

### Request parameter examples
```json
{
"bk_app_code": "esb_test",
"bk_app_secret": "xxx",
"bk_username": "xxx",
"bk_token": "xxx",
"bk_biz_id": 3,
"data": [
{
"bk_cluster_id": 1,
"name": "test",
"labels": {
"test": "test",
"test2": "test2"
},
"resource_quotas": [
{
"hard":{
"memory": "20000Gi",
"pods": "100",
"cpu": "10k"
},
"scope_selector": {
"match_expressions": [
{
"values": [ "high" ],
"operator": "In",
"scope_name": "PriorityClass"
}
]
}
}
]
}
]
}
```

### Return Result Example

```json

{
"result": true,
"code": 0,
"data": {
"ids": [1]
},
"message": "success",
"permission": null,
"request_id": "87de106ab55549bfbcc46e47ecf5bcc7"
}
```

**Note:**
- The order of the node ID array in the returned data is consistent with the order of the array data in the parameter.

### Return result parameter description
#### response

| name | type | description |
| ------- | ------ | ------------------------------------- |
| result | bool | Whether the request was successful or not. true:request successful; false request failed.
| code | int | The error code. 0 means success, >0 means failure error.
| message | string | The error message returned by the failed request.
| permission | object | Permission information |
| request_id | string | request_chain_id |
| data | object | data returned by the request

#### data

| field | type | description |
| ----------- |-----------|----------|
| ids | array | array of unique identifiers for namespace in cc |
135 changes: 135 additions & 0 deletions paas2/esb/components/confapis/cc/apidocs/en/batch_create_kube_node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
### Functional description

create a new container node (v3.10.23+, permission: kube Node Creation Permission)

### Request Parameters

{{ common_args_desc }}

#### Interface Parameters

| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| bk_biz_id | int | yes | business ID|
| data | object | yes | the specific information of the node that needs to be created|


#### data

| Field | Type | Required | Description |
|-----------|------------|--------|------------|
| bk_cluster_id | int | yes | ID of the container cluster in cmdb|
| bk_host_id | int | yes | associated host ID|
| uid | string | yes | the own ID of the container cluster|
| name | string | yes | node name |
| roles | string | no | node roles |
| labels | object | no | label|
| taints | object | no | taints|
| unschedulable | bool| no | Whether to turn off schedulable, true means not schedulable, false means schedulable|
| internal_ip | array | no | internal ip |
| external_ip | array | no | external ip|
| hostname | string | no | hostname |
| runtime_component | string | no | runtime components|
| kube_proxy_mode | string | no | kube-proxy proxy mode|
| pod_cidr | string | no | The allocation range of the Pod address of this node |

### Request Parameters Example

```json
{
"bk_app_code":"esb_test",
"bk_app_secret":"xxx",
"bk_username":"xxx",
"bk_token":"xxx",
"bk_biz_id":2,
"data":[
{
"bk_host_id":1,
"bk_cluster_id":1,
"name":"k8s",
"roles":"master",
"labels":{
"env":"test"
},
"taints":{
"type":"gpu"
},
"unschedulable":false,
"internal_ip":[
"127.0.0.1"
],
"external_ip":[
"127.0.0.2"
],
"hostname":"xxx",
"runtime_component":"runtime_component",
"kube_proxy_mode":"ipvs",
"pod_cidr":"127.0.0.1/26"
},
{
"bk_host_id":2,
"bk_cluster_id":1,
"name":"k8s",
"roles":"master",
"labels":{
"env":"test"
},
"taints":{
"type":"gpu"
},
"unschedulable":false,
"internal_ip":[
"127.0.0.1"
],
"external_ip":[
"127.0.0.2"
],
"hostname":"xxx",
"runtime_component":"runtime_component",
"kube_proxy_mode":"ipvs",
"pod_cidr":"127.0.0.1/26"
}
]
}
```
**Note:**
- internal_ip and external_ip cannot be empty at the same time.
- no more than 100 nodes can be created at one time.

### Return Result Example

```json
{
"result":true,
"code":0,
"message":"success",
"permission":null,
"data":{
"ids":[
1,
2
]
},
"request_id":"87de106ab55549bfbcc46e47ecf5bcc7"
}
```
**Note:**
- The order of the node ID array in the returned data is consistent with the order of the array data in the parameter.

### Return Result Parameters Description
#### response

| Name | Type | Description |
| ------- | ------ | ------------------------------------- |
| result | bool | Whether the request succeeded or not. True: request succeeded;false request failed|
| code | int | Wrong code. 0 indicates success,>0 indicates failure error |
| message | string |Error message returned by request failure |
| permission | object |Permission information |
| data | object |Data returned by request |
| request_id | string |Request chain id |

### data

| Name | Type | Description |
| ------- | ------ | ------------------------------- |
| ids | array |list of kube node IDs created |
Loading

0 comments on commit 12a00b6

Please sign in to comment.