查询服务关联的目标规则列表 - ShowServiceRelatedDestinationRule
功能介绍
查询服务关联的目标规则列表
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
授权信息
账号具备所有API的调用权限,如果使用账号下的IAM用户调用当前API,该IAM用户需具备调用API所需的权限,具体权限要求请参见权限和授权项。
URI
GET /v2/{project_id}/edgemgr/services/{service_id}/destination-rules
|
参数 |
是否必选 |
参数类型 |
描述 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID |
|
service_id |
是 |
String |
服务ID |
请求参数
无
响应参数
状态码:200
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
count |
Integer |
数目 |
|
destination_rules |
Array of DestinationRuleResp objects |
目标规则 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
projectId |
String |
项目ID |
|
metadata |
DestinationRuleMetaData object |
元数据 |
|
spec |
DestinationRuleSpec object |
详细描述 |
|
createdAt |
String |
创建时间 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
host |
String |
目标规则的应用对象 |
|
trafficPolicy |
TrafficPolicy object |
目标规则内容的具体定义 |
|
subsets |
Array of Subset objects |
服务子集 |
|
exportTo |
Array of strings |
目标规则在ExportTo定义的一组命名空间中具有可见性 默认全局可见;“.”表示仅应用到当前命名空间;“*”表示应用到所有的命名空间 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
name |
String |
服务子集名称 |
|
labels |
Map<String,String> |
标签,通过一组标签定义了属于这个服务子集的服务实例 |
|
trafficPolicy |
TrafficPolicy object |
应用到这个服务子集的流量策略 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
loadBalancer |
Map<String,Array> |
服务的负载均衡算法 |
|
connectionPool |
ConnectionPoolSettings object |
服务的连接池配置 |
|
outlierDetection |
OutlierDetection object |
服务的异常点检查 |
|
tls |
Array of TLSSettings objects |
服务的TLS连接设置 |
|
portLevelSettings |
每个端口的流量策略 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
mode |
String |
TLS模式,默认不使用,定义了如下4种升级策略 Disable:对指定的服务的连接不使用TLS SIMPLE:发起与服务端的TLS连接 MUTUAL:使用双向认证对服务端发起安全连接,并且提供客户端证书 ISTIO_MUTUAL:使用双向认证对服务端发起安全认证,证书由Istio自动生成 |
|
clientCertificate |
String |
客户端证书路径,为MUTUAL模式时必须指定,为ISTIO_MUTUAL模式时无须指定 |
|
privateKey |
String |
客户端私钥路径,为MUTUAL模式时必须指定,为ISTIO_MUTUAL模式时无须指定 |
|
caCertificates |
String |
验证服务端证书的CA文件路径,若未指定则忽略校验服务端证书,为ISTIO_MUTUAL模式时无须指定 |
|
subjectAltNames |
Array of strings |
验证在服务端证书中标识的列表文件,为ISTIO_MUTUAL模式时无须指定 |
|
sni |
String |
在TLS握手阶段提供给服务端的SNI字符串,为ISTIO_MUTUAL模式时无须指定 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
port |
PortSelector object |
端口 |
|
loadBalancer |
Map<String,Array> |
负载均衡 |
|
connectionPool |
ConnectionPoolSettings object |
连接池 |
|
outlierDetection |
OutlierDetection object |
outlierDetection |
|
tls |
TLSSettings object |
tls |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
[数组元素] |
Array of strings |
消息 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
maxConnections |
Integer |
为上游服务的所有实例建立的最大连接数 |
|
connectTimeout |
String |
TCP连接超时,表示主机网络连接超时 ConnectTimeout是可能带符号的十进制数字序列,每个序列都有可选的小数和一个单位后缀,例如“ 300ms”,“-1.5h”或“ 2h45m”。有效时间单位为“ ns”,“ us”(或“ µs”) ”,“ ms”,“ s”,“ m”,“ h”。 |
|
tcpKeepalive |
定期给对端发送一个keepalive的探测包,判断连接是否可用 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
probes |
Integer |
探测次数 |
|
time |
String |
探测时间 |
|
interval |
String |
探测间隔 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
http1MaxPendingRequests |
Integer |
最大等待HTTP请求数,默认值是1024,只适用于HTTP/1.1的服务,HTTP/2协议的请求在到来时会立即复用连接,不会在连接池等待 |
|
http2MaxRequests |
Integer |
最大请求数,默认是1024,只适用于HTTP/2服务 |
|
maxRequestsPerConnection |
Integer |
每个连接的最大请求数,HTTP/1.1和HTTP/2连接池都遵循此参数 |
|
maxRetries |
Integer |
最大重试次数,默认是3 |
|
idleTimeout |
String |
空闲超时,定义在多长时间内没有活动请求则关闭连接 IdleTimeout是可能带符号的十进制数字序列,每个序列都有可选的小数和一个单位后缀,例如“ 300ms”,“-1.5h”或“ 2h45m”。有效时间单位为“ ns”,“ us”(或“ µs”) ”,“ ms”,“ s”,“ m”,“ h”。 |
|
h2UpgradePolicy |
String |
将http1.1连接升级到http2的策略,定义了如下3种升级策略 DEFAULT:使用全局默认值 DO_NOT_UPGRADE:不把连接升级至http2,此选项将覆盖默认值 UPGRADE:将连接升级至http2,此选项将覆盖默认值 |
|
参数 |
参数类型 |
描述 |
|---|---|---|
|
consecutiveErrors |
Integer |
连续错误次数 |
|
consecutiveGatewayErrors |
Integer |
连续网关错误次数 |
|
consecutive5xxErrors |
Integer |
连续5xx错误次数 |
|
interval |
String |
驱逐的时间间隔,默认值是10秒,要求大于1毫秒,单位可以是时、分、毫秒 |
|
baseEjectionTime |
String |
最小驱逐时间 |
|
maxEjectionPercent |
Integer |
指负载均衡池中可以被驱逐的故障实例的最大比例,默认是10% |
|
minHealthPercent |
Integer |
最小健康实例比例 |
请求示例
/v2/{project_id}/edgemgr/services/{service_id}/destination-rules
{ }
响应示例
状态码:200
查询服务关联的目标规则列表响应体
{
"count" : 0,
"destination_rules" : [ {
"projectId" : "string",
"metadata" : {
"name" : "string"
},
"spec" : {
"host" : "string",
"trafficPolicy" : {
"loadBalancer" : {
"additionalProp1" : [ "string" ],
"additionalProp2" : [ "string" ],
"additionalProp3" : [ "string" ]
},
"connectionPool" : {
"tcp" : {
"maxConnections" : 0,
"connectTimeout" : "string",
"tcpKeepalive" : {
"probes" : 0,
"time" : "string",
"interval" : "string"
}
},
"http" : {
"http1MaxPendingRequests" : 0,
"http2MaxRequests" : 0,
"maxRequestsPerConnection" : 0,
"maxRetries" : 0,
"idleTimeout" : "string",
"h2UpgradePolicy" : "string"
}
},
"outlierDetection" : {
"consecutiveErrors" : 0,
"consecutiveGatewayErrors" : 0,
"consecutive5xxErrors" : 0,
"interval" : "string",
"baseEjectionTime" : "string",
"maxEjectionPercent" : 0,
"minHealthPercent" : 0
},
"tls" : [ {
"mode" : "string",
"clientCertificate" : "string",
"privateKey" : "string",
"caCertificates" : "string",
"subjectAltNames" : [ "string" ],
"sni" : "string"
} ],
"portLevelSettings" : {
"port" : {
"number" : 0
},
"loadBalancer" : {
"additionalProp1" : [ "string" ],
"additionalProp2" : [ "string" ],
"additionalProp3" : [ "string" ]
},
"connectionPool" : {
"tcp" : {
"maxConnections" : 0,
"connectTimeout" : "string",
"tcpKeepalive" : { }
},
"http" : {
"http1MaxPendingRequests" : 0,
"http2MaxRequests" : 0,
"maxRequestsPerConnection" : 0,
"maxRetries" : 0,
"idleTimeout" : "string",
"h2UpgradePolicy" : "string"
}
},
"outlierDetection" : {
"consecutiveErrors" : 0,
"consecutiveGatewayErrors" : 0,
"consecutive5xxErrors" : 0,
"interval" : "string",
"baseEjectionTime" : "string",
"maxEjectionPercent" : 0,
"minHealthPercent" : 0
},
"tls" : {
"mode" : "string",
"clientCertificate" : "string",
"privateKey" : "string",
"caCertificates" : "string",
"subjectAltNames" : [ "string" ],
"sni" : "string"
}
}
},
"subsets" : [ {
"name" : "string",
"labels" : {
"additionalProp1" : "string",
"additionalProp2" : "string",
"additionalProp3" : "string"
},
"trafficPolicy" : {
"loadBalancer" : {
"additionalProp1" : [ "string" ],
"additionalProp2" : [ "string" ],
"additionalProp3" : [ "string" ]
},
"connectionPool" : {
"tcp" : {
"maxConnections" : 0,
"connectTimeout" : "string",
"tcpKeepalive" : { }
},
"http" : {
"http1MaxPendingRequests" : 0,
"http2MaxRequests" : 0,
"maxRequestsPerConnection" : 0,
"maxRetries" : 0,
"idleTimeout" : "string",
"h2UpgradePolicy" : "string"
}
},
"outlierDetection" : {
"consecutiveErrors" : 0,
"consecutiveGatewayErrors" : 0,
"consecutive5xxErrors" : 0,
"interval" : "string",
"baseEjectionTime" : "string",
"maxEjectionPercent" : 0,
"minHealthPercent" : 0
},
"tls" : [ {
"mode" : "string",
"clientCertificate" : "string",
"privateKey" : "string",
"caCertificates" : "string",
"subjectAltNames" : [ "string" ],
"sni" : "string"
} ],
"portLevelSettings" : {
"port" : {
"number" : 0
},
"loadBalancer" : {
"additionalProp1" : [ "string" ],
"additionalProp2" : [ "string" ],
"additionalProp3" : [ "string" ]
},
"connectionPool" : {
"tcp" : { },
"http" : { }
},
"outlierDetection" : {
"consecutiveErrors" : 0,
"consecutiveGatewayErrors" : 0,
"consecutive5xxErrors" : 0,
"interval" : "string",
"baseEjectionTime" : "string",
"maxEjectionPercent" : 0,
"minHealthPercent" : 0
},
"tls" : {
"mode" : "string",
"clientCertificate" : "string",
"privateKey" : "string",
"caCertificates" : "string",
"subjectAltNames" : [ "string" ],
"sni" : "string"
}
}
}
} ],
"exportTo" : [ "string" ]
},
"createdAt" : "string"
} ]
}
状态码
|
状态码 |
描述 |
|---|---|
|
200 |
查询服务关联的目标规则列表响应体 |
错误码
请参见错误码。