调用GetK8sServices接口获取K8s集群中应用的服务Service列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
edas:ReadApplication |
get |
*Application
|
无 | 无 |
请求语法
GET /pop/v5/k8s/acs/k8s_service HTTP/1.1
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
AppId |
string |
是 |
应用 ID。 |
5a166fbd-****-****-a286-781659d9f54c |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
接口响应。 |
||
Code |
integer |
变更流程 ID。 |
200 |
Message |
string |
附加信息。 |
success |
RequestId |
string |
请求 ID。 |
4823-bhjf-23u4-eiufh |
Services |
array<object> |
K8s 服务 Service 列表。 |
|
object |
K8s 服务 Service 对象。 |
||
Type |
string |
服务类型。 |
ClusterIP |
Name |
string |
服务名。 |
service-http |
ClusterIP |
string |
K8s 服务 Service IP 地址。 |
104.23.xx.xx |
ServicePorts |
array<object> |
端口映射列表。 |
|
object |
端口映射对象。 |
||
TargetPort |
string |
后端容器端口。 |
8080 |
NodePort |
integer |
节点端口。 |
0 |
Port |
integer |
前端服务端口。 |
80 |
Protocol |
string |
服务协议。 |
TCP |
示例
正常返回示例
JSON
格式
{
"Code": 200,
"Message": "success",
"RequestId": "4823-bhjf-23u4-eiufh",
"Services": [
{
"Type": "ClusterIP",
"Name": "service-http",
"ClusterIP": "104.23.xx.xx",
"ServicePorts": [
{
"TargetPort": "8080",
"NodePort": 0,
"Port": 80,
"Protocol": "TCP"
}
]
}
]
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
500 | Edas.errorcode.PermissionDenied.message | You are not authorized to perform the operation. | 无权限操作 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。