Perform Connectivity Check Async - Perform Connectivity Check Async
在 API 管理服务和给定目标之间执行连接检查,并返回连接的指标,以及尝试建立连接时遇到的错误。
POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/connectivityCheck?api-version=2022-08-01
URI 参数
名称 | 在 | 必需 | 类型 | 说明 |
---|---|---|---|---|
resource
|
path | True |
string minLength: 1maxLength: 90 |
资源组的名称。 名称不区分大小写。 |
service
|
path | True |
string minLength: 1maxLength: 50 pattern: ^[a-zA-Z](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$ |
API 管理服务的名称。 |
subscription
|
path | True |
string minLength: 1 |
目标订阅的 ID。 |
api-version
|
query | True |
string minLength: 1 |
用于此作的 API 版本。 |
请求正文
名称 | 必需 | 类型 | 说明 |
---|---|---|---|
destination | True |
连接检查作目标。 |
|
source | True |
有关连接检查源的定义。 |
|
preferredIPVersion |
要使用的 IP 版本。 目前仅支持 IPv4。 |
||
protocol |
请求的协议。 可以根据此选择使用特定的协议配置。 指定的目标地址必须与此值一致。 |
||
protocolConfiguration |
特定于协议的配置。 |
响应
名称 | 类型 | 说明 |
---|---|---|
200 OK |
连接检查请求已完成。 |
|
202 Accepted |
请求已接受且当前正在运行。 位置标头包含 URL,可在其中检查长时间运行作的状态,并最终检索结果。 |
|
Other Status Codes |
描述作失败的原因的错误响应。 |
安全性
azure_auth
Azure Active Directory OAuth2 Flow。
类型:
oauth2
流向:
implicit
授权 URL:
https://login.microsoftonline.com/common/oauth2/authorize
作用域
名称 | 说明 |
---|---|
user_impersonation | 模拟用户帐户 |
示例
HTTP Connectivity Check |
TCP Connectivity Check |
HTTP Connectivity Check
示例请求
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/connectivityCheck?api-version=2022-08-01
{
"source": {
"region": "northeurope"
},
"destination": {
"address": "https://microsoft.com",
"port": 3306
},
"protocol": "HTTPS",
"protocolConfiguration": {
"HTTPConfiguration": {
"method": "GET",
"validStatusCodes": [
200,
204
],
"headers": [
{
"name": "Authorization",
"value": "******"
}
]
}
}
}
示例响应
location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/connectivityCheck/operationresults/bmljb2xhLW5ldHdvcmt3YXRjaGVyNF9Db25uZWN0aXRpdml0eUNoZWNrXzE2MmExNmZl?api-version=2022-08-01
{
"hops": [
{
"type": "Source",
"id": "c60e2296-5ebc-48cc-80e8-7e6d2981e7b2",
"address": "20.82.216.48",
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"nextHopIds": [
"26aa44e7-04f1-462f-aa5d-5951957b5650"
],
"issues": []
},
{
"type": "Internet",
"id": "26aa44e7-04f1-462f-aa5d-5951957b5650",
"address": "40.113.200.201",
"nextHopIds": [],
"issues": []
}
],
"connectionStatus": "Reachable",
"avgLatencyInMs": 260,
"minLatencyInMs": 250,
"maxLatencyInMs": 281,
"probesSent": 3,
"probesFailed": 0
}
TCP Connectivity Check
示例请求
POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/connectivityCheck?api-version=2022-08-01
{
"source": {
"region": "northeurope"
},
"destination": {
"address": "8.8.8.8",
"port": 53
},
"preferredIPVersion": "IPv4"
}
示例响应
location: https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/connectivityCheck/operationresults/bmljb2xhLW5ldHdvcmt3YXRjaGVyNF9Db25uZWN0aXRpdml0eUNoZWNrXzE2MmExNmZl?api-version=2022-08-01
{
"hops": [
{
"type": "Source",
"id": "7dbbe7aa-60ba-4650-831e-63d775d38e9e",
"address": "10.1.1.4",
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1",
"nextHopIds": [
"75c8d819-b208-4584-a311-1aa45ce753f9"
],
"issues": []
},
{
"type": "Internet",
"id": "75c8d819-b208-4584-a311-1aa45ce753f9",
"address": "8.8.8.8",
"nextHopIds": [],
"issues": []
}
],
"connectionStatus": "Connected",
"avgLatencyInMs": 1,
"minLatencyInMs": 1,
"maxLatencyInMs": 4,
"probesSent": 100,
"probesFailed": 0
}
定义
名称 | 说明 |
---|---|
Connection |
连接状态。 |
Connectivity |
请求的协议。 可以根据此选择使用特定的协议配置。 指定的目标地址必须与此值一致。 |
Connectivity |
对 API 管理服务执行连接检查作的请求。 |
Connectivity |
有关连接状态的信息。 |
Connectivity |
有关源和目标之间的跃点的信息。 |
Connectivity |
有关在检查连接过程中遇到的问题的信息。 |
Destination |
连接检查作目标。 |
Error |
错误字段协定。 |
Error |
错误响应。 |
HTTPConfiguration |
HTTP 或 HTTPS 请求的配置。 |
HTTPHeader |
HTTP 标头及其值。 |
Issue |
问题的类型。 |
Method |
要使用的 HTTP 方法。 |
Origin |
问题的起源。 |
Preferred |
要使用的 IP 版本。 目前仅支持 IPv4。 |
Protocol |
特定于协议的配置。 |
Severity |
问题的严重性。 |
Source |
有关连接检查源的定义。 |
ConnectionStatus
连接状态。
值 | 说明 |
---|---|
Connected | |
Degraded | |
Disconnected | |
Unknown |
ConnectivityCheckProtocol
请求的协议。 可以根据此选择使用特定的协议配置。 指定的目标地址必须与此值一致。
值 | 说明 |
---|---|
HTTP | |
HTTPS | |
TCP |
ConnectivityCheckRequest
对 API 管理服务执行连接检查作的请求。
名称 | 类型 | 说明 |
---|---|---|
destination |
连接检查作目标。 |
|
preferredIPVersion |
要使用的 IP 版本。 目前仅支持 IPv4。 |
|
protocol |
请求的协议。 可以根据此选择使用特定的协议配置。 指定的目标地址必须与此值一致。 |
|
protocolConfiguration |
特定于协议的配置。 |
|
source |
有关连接检查源的定义。 |
ConnectivityCheckResponse
有关连接状态的信息。
名称 | 类型 | 说明 |
---|---|---|
avgLatencyInMs |
integer (int64) |
平均延迟(以毫秒为单位)。 |
connectionStatus |
连接状态。 |
|
hops |
源和目标之间的跃点列表。 |
|
maxLatencyInMs |
integer (int64) |
最大延迟(以毫秒为单位)。 |
minLatencyInMs |
integer (int64) |
最小延迟(以毫秒为单位)。 |
probesFailed |
integer (int64) |
失败的探测数。 |
probesSent |
integer (int64) |
发送的探测总数。 |
ConnectivityHop
有关源和目标之间的跃点的信息。
名称 | 类型 | 说明 |
---|---|---|
address |
string |
跃点的 IP 地址。 |
id |
string |
跃点的 ID。 |
issues |
问题列表。 |
|
nextHopIds |
string[] |
下一跃点标识符的列表。 |
resourceId |
string |
与此跃点对应的资源的 ID。 |
type |
string |
跃点的类型。 |
ConnectivityIssue
有关在检查连接过程中遇到的问题的信息。
名称 | 类型 | 说明 |
---|---|---|
context |
object[] |
提供有关此问题的其他上下文。 |
origin |
问题的起源。 |
|
severity |
问题的严重性。 |
|
type |
问题的类型。 |
Destination
连接检查作目标。
名称 | 类型 | 说明 |
---|---|---|
address |
string |
目标地址。 可以是 IP 地址或 FQDN。 |
port |
integer (int64) |
目标端口。 |
ErrorFieldContract
错误字段协定。
名称 | 类型 | 说明 |
---|---|---|
code |
string |
属性级别错误代码。 |
message |
string |
属性级错误的人工可读表示形式。 |
target |
string |
属性名称。 |
ErrorResponse
错误响应。
名称 | 类型 | 说明 |
---|---|---|
error.code |
string |
服务定义的错误代码。 此代码充当响应中指定的 HTTP 错误代码的子状态。 |
error.details |
请求中发送的无效字段列表(如果出现验证错误)。 |
|
error.message |
string |
错误的人工可读表示形式。 |
HTTPConfiguration
HTTP 或 HTTPS 请求的配置。
名称 | 类型 | 说明 |
---|---|---|
headers |
要包含在请求中的标头列表。 |
|
method |
要使用的 HTTP 方法。 |
|
validStatusCodes |
integer[] (int64) |
被视为对请求响应有效的 HTTP 状态代码列表。 |
HTTPHeader
HTTP 标头及其值。
名称 | 类型 | 说明 |
---|---|---|
name |
string |
标头名称。 |
value |
string |
标头值。 |
IssueType
问题的类型。
值 | 说明 |
---|---|
AgentStopped | |
DnsResolution | |
GuestFirewall | |
NetworkSecurityRule | |
Platform | |
PortThrottled | |
SocketBind | |
Unknown | |
UserDefinedRoute |
Method
要使用的 HTTP 方法。
值 | 说明 |
---|---|
GET | |
POST |
Origin
问题的起源。
值 | 说明 |
---|---|
Inbound | |
Local | |
Outbound |
PreferredIPVersion
要使用的 IP 版本。 目前仅支持 IPv4。
值 | 说明 |
---|---|
IPv4 |
ProtocolConfiguration
特定于协议的配置。
名称 | 类型 | 说明 |
---|---|---|
HTTPConfiguration |
HTTP 或 HTTPS 请求的配置。 |
Severity
问题的严重性。
值 | 说明 |
---|---|
Error | |
Warning |
Source
有关连接检查源的定义。
名称 | 类型 | 说明 |
---|---|---|
instance |
integer (int64) |
要从中触发请求的特定 VMSS 实例。 |
region |
string |
从何处启动连接检查作的 API 管理服务区域。 |