调用GetK8sServices获取K8s集群中应用的服务Service列表。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求头
该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。
请求语法
GET /pop/v5/k8s/acs/k8s_service HTTPS|HTTP
请求参数
名称 | 类型 | 位置 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|---|
AppId | String | Query | 是 | 5a166fbd-****-****-a286-781659d9f54c |
应用ID |
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
Code | Integer | 200 |
变更流程ID |
Message | String | success |
附加信息 |
RequestId | String | 4823-bhjf-23u4-eiufh |
请求ID |
Services | Array of Services |
K8s服务Service列表 |
|
ClusterIP | String | 104.23.xx.xx |
K8s服务Servic IP地址 |
Name | String | service-http |
服务名 |
ServicePorts | Array of ServicePorts |
端口映射列表 |
|
NodePort | Integer | 0 |
节点端口 |
Port | Integer | 80 |
前端服务端口 |
Protocol | String | TCP |
服务协议 |
TargetPort | String | 8080 |
后端容器端口 |
Type | String | ClusterIP |
服务类型 |
示例
请求示例
GET /pop/v5/k8s/acs/k8s_service HTTP/1.1
公共请求头
{
"AppId": "5a166fbd-****-****-a286-781659d9f54c"
}
正常返回示例
XML
格式
<Services>
<ClusterIP>104.23.xx.xx</ClusterIP>
<Type>ClusterIP</Type>
<Name>service-http</Name>
</Services>
<Services>
<ServicePorts>
<NodePort>0</NodePort>
<TargetPort>8080</TargetPort>
<Protocol>TCP</Protocol>
<Port>80</Port>
</ServicePorts>
</Services>
<RequestId>4823-bhjf-23u4-eiufh</RequestId>
<Message>success</Message>
<Code>200</Code>
JSON
格式
{
"Services": [
{
"ClusterIP": "104.23.xx.xx",
"Type": "ClusterIP",
"Name": "service-http"
},
{
"ServicePorts": {
"NodePort": 0,
"TargetPort": 8080,
"Protocol": "TCP",
"Port": 80
}
}
],
"RequestId": "4823-bhjf-23u4-eiufh",
"Message": "success",
"Code": 200
}
在文档使用中是否遇到以下问题
更多建议
匿名提交