Skip to content

Commit 111e7ac

Browse files
Merge pull request #8665 from TencentBlueKing/v3.14.x
v3.14.x合入master
2 parents 51ec880 + 112f64d commit 111e7ac

63 files changed

Lines changed: 1164 additions & 8991 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

docs/apidoc/apigw/backend/bk_apigw_resources_bk-cmdb.yaml

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
openapi: 3.0.1
1+
swagger: '2.0'
2+
basePath: /
23
info:
4+
version: '0.1'
35
title: API Gateway Resources
4-
description: ""
5-
version: "0.1"
6-
servers:
7-
- url: /
6+
description: ''
7+
schemes:
8+
- http
89
paths:
910
/api/v3/set/{biz_id}/batch:
1011
post:
@@ -8625,3 +8626,33 @@ paths:
86258626
userVerifiedRequired: false
86268627
disabledStages: []
86278628
descriptionEn:
8629+
/api/v3/findmany/biz_set/{bk_biz_set_id}/kube/containers:
8630+
post:
8631+
operationId: list_kube_container_in_biz_set
8632+
description: 查询业务集下容器信息(该接口为bk-ops专用接口,可能会随时调整,其它服务请勿使用)
8633+
responses:
8634+
default:
8635+
description: ''
8636+
x-bk-apigateway-resource:
8637+
isPublic: false
8638+
allowApplyPermission: false
8639+
matchSubpath: false
8640+
backend:
8641+
type: HTTP
8642+
method: post
8643+
path: /api/v3/findmany/biz_set/{bk_biz_set_id}/kube/containers
8644+
matchSubpath: false
8645+
timeout: 0
8646+
upstreams: {}
8647+
transformHeaders: {}
8648+
pluginConfigs:
8649+
- type: bk-rate-limit
8650+
yaml: |
8651+
rates:
8652+
__default:
8653+
- period: 1
8654+
tokens: 100
8655+
authConfig:
8656+
userVerifiedRequired: false
8657+
disabledStages: []
8658+
descriptionEn: List kube container in business set
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
### Description
2+
3+
Query container information under a business set (version: v3.14.8+, permission: biz set access, this interface is
4+
dedicated to bk-ops and may be adjusted at any time. Please do not use it for other services)
5+
6+
### Parameters
7+
8+
| Name | Type | Required | Description |
9+
|------------------|--------------|----------|--------------------------------|
10+
| bk_biz_set_id | int64 | Yes | Business set ID |
11+
| bk_container_ids | int64 array | Yes | Container ID list, maximum 500 |
12+
| container_fields | string array | Yes | Container attribute list |
13+
| pod_fields | string array | Yes | Pod attribute list |
14+
| host_fields | string array | Yes | Host attribute list |
15+
16+
### Request Example
17+
18+
```json
19+
{
20+
"bk_biz_set_id": 1,
21+
"bk_container_ids": [
22+
1,
23+
2
24+
],
25+
"container_fields": [
26+
"id",
27+
"name",
28+
"container_uid"
29+
],
30+
"pod_fields": [
31+
"id",
32+
"name"
33+
],
34+
"host_fields": [
35+
"bk_host_id",
36+
"bk_agent_id",
37+
"bk_cloud_id"
38+
]
39+
}
40+
```
41+
42+
### Response Example
43+
44+
```json
45+
{
46+
"result": true,
47+
"code": 0,
48+
"message": "success",
49+
"permission": null,
50+
"data": [
51+
{
52+
"container": {
53+
"id": 1,
54+
"name": "container1",
55+
"container_uid": "uid"
56+
},
57+
"pod": {
58+
"id": 1,
59+
"name": "pod1"
60+
},
61+
"host": {
62+
"bk_host_id": 1,
63+
"bk_agent_id": "xxxxxxxxxxx",
64+
"bk_cloud_id": 0
65+
}
66+
}
67+
]
68+
}
69+
```
70+
71+
### Response Parameters
72+
73+
| Name | Type | Description |
74+
|------------|--------|--------------------------------------------------------------------|
75+
| result | bool | Whether the request is successful. true: successful; false: failed |
76+
| code | int | Error code. 0 indicates success, >0 indicates failure |
77+
| message | string | Error message returned in case of failure |
78+
| permission | object | Permission information |
79+
80+
#### data[x]
81+
82+
| Name | Type | Description |
83+
|-----------|--------|----------------|
84+
| container | object | Container data |
85+
| pod | object | Pod data |
86+
| host | object | Host data |
87+
88+
#### data[x].container
89+
90+
| Name | Type | Description |
91+
|---------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
92+
| id | int | Unique ID in cmdb |
93+
| name | string | Container name |
94+
| container_uid | string | Container uid |
95+
| image | string | Container image |
96+
| ports | object array | Container ports, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#containerport-v1-core |
97+
| args | string array | Startup arguments |
98+
| started | timestamp | Start time |
99+
| limits | object | Resource limits, docs: https://kubernetes.io/docs/concepts/policy/resource-quotas/ |
100+
| requests | object | Resource requests, docs: https://kubernetes.io/docs/concepts/policy/resource-quotas/ |
101+
| liveness | object | Liveness probe, docs: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#probe-v1-core |
102+
| environment | object array | Environment variables, docs: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envvar-v1-core |
103+
| mounts | object array | Volume mounts, docs: https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volumemount-v1-core |
104+
105+
#### data[x].pod
106+
107+
| Name | Type | Description |
108+
|----------------|--------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
109+
| id | int | Unique ID in cmdb |
110+
| name | string | Name |
111+
| priority | int | Priority |
112+
| labels | string map | Labels, both key and value are strings, docs: http://kubernetes.io/docs/user-guide/labels |
113+
| ip | string | Container network IP |
114+
| ips | object array | Container network IP array, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podip-v1-core |
115+
| volumes | object array | Volume information used, docs: https://kubernetes.io/docs/concepts/storage/volumes/, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core |
116+
| qos_class | enum | Quality of Service, docs: https://kubernetes.io/docs/tasks/configure-pod-container/quality-service-pod/ |
117+
| node_selectors | string map | Node label selector, both key and value are strings, docs: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/ |
118+
| tolerations | object array | Tolerations, format: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#toleration-v1-core |
119+
| operator | string array | Pod operator |
120+
| containers | object array | Container data |
121+
122+
#### data[x].host
123+
124+
| Name | Type | Description |
125+
|--------------|----------------|-------------------------------------------------------|
126+
| bk_host_id | int | Host ID |
127+
| bk_agent_id | string | Agent ID |
128+
| bk_cloud_id | int | Cloud area ID |
129+
| other fields | attribute type | other user-defined fields, defined by model attribute |
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
### 描述
2+
3+
查询业务集下容器信息 (版本:v3.14.8+,权限:业务集访问,该接口为bk-ops专用接口,可能会随时调整,其它服务请勿使用)
4+
5+
### 输入参数
6+
7+
| 字段 | 类型 | 必选 | 描述 |
8+
|------------------|-------|----|--------------------------------------|
9+
| bk_biz_set_id | int || 业务集ID |
10+
| bk_container_ids | array || 容器ID列表,最多500条 |
11+
| container_fields | array || container属性列表,控制返回结果的container里有哪些字段 |
12+
| pod_fields | array || pod属性列表,控制返回结果的pod里有哪些字段 |
13+
| host_fields | array || host属性列表,控制返回结果的host里有哪些字段 |
14+
15+
### 调用示例
16+
17+
```json
18+
{
19+
"bk_biz_set_id": 1,
20+
"bk_container_ids": [
21+
1,
22+
2
23+
],
24+
"container_fields": [
25+
"id",
26+
"name",
27+
"container_uid"
28+
],
29+
"pod_fields": [
30+
"id",
31+
"name"
32+
],
33+
"host_fields": [
34+
"bk_host_id",
35+
"bk_agent_id",
36+
"bk_cloud_id"
37+
]
38+
}
39+
```
40+
41+
### 响应示例
42+
43+
```json
44+
{
45+
"result": true,
46+
"code": 0,
47+
"message": "success",
48+
"permission": null,
49+
"data": [
50+
{
51+
"container": {
52+
"id": 1,
53+
"name": "container1",
54+
"container_uid": "uid"
55+
},
56+
"pod": {
57+
"id": 1,
58+
"name": "pod1"
59+
},
60+
"host": {
61+
"bk_host_id": 1,
62+
"bk_agent_id": "xxxxxxxxxxx",
63+
"bk_cloud_id": 0
64+
}
65+
}
66+
]
67+
}
68+
```
69+
70+
### 响应参数说明
71+
72+
| 参数名称 | 参数类型 | 描述 |
73+
|------------|--------------|----------------------------|
74+
| result | bool | 请求成功与否。true:请求成功;false请求失败 |
75+
| code | int | 错误编码。 0表示success,>0表示失败错误 |
76+
| message | string | 请求失败返回的错误信息 |
77+
| permission | object | 权限信息 |
78+
| data | object array | 请求返回的数据 |
79+
80+
#### data[x]
81+
82+
| 参数名称 | 参数类型 | 描述 |
83+
|-----------|--------|-------------|
84+
| container | object | container数据 |
85+
| pod | object | pod数据 |
86+
| host | object | host数据 |
87+
88+
#### data[x].container
89+
90+
| 参数名称 | 参数类型 | 描述 |
91+
|---------------|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
92+
| id | int | 在cmdb中的唯一ID |
93+
| name | string | 名称 |
94+
| container_uid | string | 容器uid |
95+
| image | string | 镜像信息 |
96+
| ports | object array | 容器端口,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#containerport-v1-core |
97+
| args | string array | 启动参数 |
98+
| started | timestamp | 启动时间 |
99+
| limits | object | 资源限制,官方文档:https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ |
100+
| requests | object | 申请资源大小,官方文档:https://kubernetes.io/zh/docs/concepts/policy/resource-quotas/ |
101+
| liveness | object | 存活探针,官方文档:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#probe-v1-core |
102+
| environment | object array | 环境变量,官方文档:https://kubernetes.io/zh/docs/tasks/inject-data-application/define-environment-variable-container/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envvar-v1-core |
103+
| mounts | object array | 挂载卷,官方文档:https://kubernetes.io/zh/docs/tasks/configure-pod-container/configure-volume-storage/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volumemount-v1-core |
104+
105+
#### data[x].pod
106+
107+
| 参数名称 | 参数类型 | 描述 |
108+
|----------------|--------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------|
109+
| id | int | 在cmdb中的唯一ID |
110+
| name | string | 名称 |
111+
| priority | int | 优先级 |
112+
| labels | string map | 标签,key和value均是string,官方文档:http://kubernetes.io/docs/user-guide/labels |
113+
| ip | string | 容器网络IP |
114+
| ips | object array | 容器网络IP数组,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#podip-v1-core |
115+
| volumes | object array | 使用的卷信息,官方文档:https://kubernetes.io/zh/docs/concepts/storage/volumes/ ,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#volume-v1-core |
116+
| qos_class | enum | 服务质量,官方文档:https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/quality-service-pod/ |
117+
| node_selectors | string map | 节点标签选择器,key和value均是string,官方文档:https://kubernetes.io/zh/docs/concepts/scheduling-eviction/assign-pod-node/ |
118+
| tolerations | object array | 容忍度,格式:https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#toleration-v1-core |
119+
| operator | string array | pod负责人 |
120+
| containers | object array | 容器数据 |
121+
122+
#### data[x].host
123+
124+
| 参数名称 | 参数类型 | 描述 |
125+
|-------------|--------|---------------------|
126+
| bk_host_id | int | 主机ID |
127+
| bk_agent_id | string | Agent ID |
128+
| bk_cloud_id | int | 云区域ID |
129+
| 其他属性字段 | 对应属性类型 | 其他自定义属性字段,与模型属性定义对应 |

0 commit comments

Comments
 (0)