容器组(Pod)
容器组(pod)详情(包含状态,事件)
URI
示例:product_type_list=[eks, hybrid, security]
GET /api/ecns/${product type}/pods/pod/<pod_name>/
响应消息
| 参数 | 参数类型 | 描述 |
|---|---|---|
| pod | pod | pod type定义见后文 |
| conditions | list(condition) | pod状态列表 |
| events | list(event) | pod事件列表 |
pod type定义:
| 参数 | 参数类型 | 是否必选 | 描述 |
|---|---|---|---|
| name | str | 是 | 容器组名称(pod名称) |
| containers | list(container) | 是 | 容器列表,container Type定义 |
| restart_policy | str | 是 | pod重启策略 |
| labels | dict(str:str) | 是 | 标签,”labels”:{“k1”:”v1”, “k2”:”v2”} |
| pod_status | pod_status | 是 | pod状态 |
容器组(pod)删除
URI
示例:product_type_list=[eks, hybrid, security]
DELETE /api/ecns/${product type}/pods/?force=true
请求消息
| 参数 | 参数类型 | 是否必选 | 描述 |
|---|---|---|---|
| pod | pod | 是 | |
| force | str | 否 | true时强制删除 |
正常响应代码
200 ok
获取pod列表
URI
示例:product_type_list=[eks, hybrid, security]
GET /api/ecns/${product type}/pods/
响应消息
| 参数 | 参数类型 | 描述 |
|---|---|---|
| name | str | |
| creation_time | str | |
| pod_ip | str | |
| host_ip | str | |
| images | list(image) | |
| labels | ditc(str:str) | |
| restart_count | str | pod重启次数 |
| status | str |
查看yaml
URI
示例:product_type_list=[eks, hybrid, security]
GET /api/ecns/${product type}/_raw/<kind>/name/<resource_name>/?cluster_addr=<cluster_addr>
响应消息
kind:’Pod’,’Service’,’ConfigMap’,’Ingress’,’DaemonSet’,’Deployment’,’StatefulSet’,’CronJob’,’Job’,’ReplicaSet’, ‘PersistentVolumeClaim’,’PersistentVolume’,’StorageClass’,’Secret’
cluster_addr: apiserver address – 当kind为’PersistentVolume’,’StorageClass’时,需要考虑是否添加此参数。
此处有待补充
编辑yaml
URI
示例:product_type_list=[eks, hybrid, security]
PUT /api/ecns/${product type}/_raw/<kind>/name/<resource_name>/
接口约束
kind: 当kind为application时,支持application关联的资源如’Pod’,’Service’,’Ingress’,’DaemonSet’,’Deployment’,’StatefulSet’,’CronJob’,’Job’等的编辑;
kind也可以为k8s原生资源:’Pod’,’Service’,’ConfigMap’,’Ingress’,’DaemonSet’,’Deployment’,’StatefulSet’,’CronJob’,’Job’,’ReplicaSet’, ‘PersistentVolumeClaim’,’PersistentVolume’,’StorageClass’,’Secret’
响应消息
| 参数 | 参数类型 | 描述 |
|---|---|---|
| succeed | list(yaml_item) | |
| failed | list(yaml_item) |
yaml_item Type定义
| 参数 | 参数类型 | 描述 |
|---|---|---|
| name | str | |
| kind | str | |
| yaml | str | |
| reason | str |
上传yaml创建资源
URI
示例:product_type_list=[eks, hybrid, security]
POST /api/ecns/${product type}/_raw/<kind>/name/<resource_name>/
响应消息
| 参数 | 参数类型 | 描述 |
|---|---|---|
| succeed | list(yaml_item) | |
| failed | list(yaml_item) |
查看日志
待补充
登录终端
待补充