Compartilhar via


Connection Monitors - Query

Query a snapshot of the most recent connection states.

POST https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/connectionMonitors/{connectionMonitorName}/query?api-version=2024-01-01

URI Parameters

Name In Required Type Description
connectionMonitorName
path True

string

The name given to the connection monitor.

networkWatcherName
path True

string

The name of the Network Watcher resource.

resourceGroupName
path True

string

The name of the resource group containing Network Watcher.

subscriptionId
path True

string

The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.

api-version
query True

string

Client API version.

Responses

Name Type Description
200 OK

ConnectionMonitorQueryResult

Successful query of connection states.

202 Accepted

ConnectionMonitorQueryResult

Accepted query of connection states.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Query connection monitor

Sample request

POST https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1/query?api-version=2024-01-01

Sample response

{
  "sourceStatus": "Active",
  "states": [
    {
      "connectionState": "Reachable",
      "startTime": "2018-01-08T03:42:33.3387305Z",
      "endTime": "2018-01-08T05:12:41.5265438Z",
      "evaluationState": "Completed",
      "hops": [
        {
          "type": "Source",
          "id": "7dbbe7aa-60ba-4650-831e-63d775d38e9e",
          "address": "10.1.1.4",
          "resourceId": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1",
          "nextHopIds": [
            "75c8d819-b208-4584-a311-1aa45ce753f9"
          ],
          "issues": []
        },
        {
          "type": "VirtualNetwork",
          "id": "75c8d819-b208-4584-a311-1aa45ce753f9",
          "address": "192.168.100.4",
          "resourceId": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1",
          "nextHopIds": [],
          "issues": []
        }
      ]
    }
  ]
}
Location: https:/management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1/query?api-version=2024-01-01
{
  "sourceStatus": "Active",
  "states": [
    {
      "connectionState": "Reachable",
      "startTime": "2018-01-08T03:42:33.3387305Z",
      "endTime": "2018-01-08T05:12:41.5265438Z",
      "evaluationState": "Completed",
      "hops": [
        {
          "type": "Source",
          "id": "7dbbe7aa-60ba-4650-831e-63d775d38e9e",
          "address": "10.1.1.4",
          "resourceId": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic0/ipConfigurations/ipconfig1",
          "nextHopIds": [
            "75c8d819-b208-4584-a311-1aa45ce753f9"
          ],
          "issues": []
        },
        {
          "type": "VirtualNetwork",
          "id": "75c8d819-b208-4584-a311-1aa45ce753f9",
          "address": "192.168.100.4",
          "resourceId": "subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkInterfaces/nic1/ipConfigurations/ipconfig1",
          "nextHopIds": [],
          "issues": []
        }
      ]
    }
  ]
}

Definitions

Name Description
ConnectionMonitorQueryResult

List of connection states snapshots.

ConnectionMonitorSourceStatus

Status of connection monitor source.

ConnectionState

The connection state.

ConnectionStateSnapshot

Connection state snapshot.

ConnectivityHop

Information about a hop between the source and the destination.

ConnectivityIssue

Information about an issue encountered in the process of checking for connectivity.

ErrorDetails

Common error details representation.

ErrorResponse

The error object.

EvaluationState

Connectivity analysis evaluation state.

HopLink

Hop link.

IssueType

The type of issue.

Origin

The origin of the issue.

Severity

The severity of the issue.

ConnectionMonitorQueryResult

List of connection states snapshots.

Name Type Description
sourceStatus

ConnectionMonitorSourceStatus

Status of connection monitor source.

states

ConnectionStateSnapshot[]

Information about connection states.

ConnectionMonitorSourceStatus

Status of connection monitor source.

Name Type Description
Active

string

Inactive

string

Unknown

string

ConnectionState

The connection state.

Name Type Description
Reachable

string

Unknown

string

Unreachable

string

ConnectionStateSnapshot

Connection state snapshot.

Name Type Description
avgLatencyInMs

integer

Average latency in ms.

connectionState

ConnectionState

The connection state.

endTime

string

The end time of the connection snapshot.

evaluationState

EvaluationState

Connectivity analysis evaluation state.

hops

ConnectivityHop[]

List of hops between the source and the destination.

maxLatencyInMs

integer

Maximum latency in ms.

minLatencyInMs

integer

Minimum latency in ms.

probesFailed

integer

The number of failed probes.

probesSent

integer

The number of sent probes.

startTime

string

The start time of the connection snapshot.

ConnectivityHop

Information about a hop between the source and the destination.

Name Type Description
address

string

The IP address of the hop.

id

string

The ID of the hop.

issues

ConnectivityIssue[]

List of issues.

links

HopLink[]

List of hop links.

nextHopIds

string[]

List of next hop identifiers.

previousHopIds

string[]

List of previous hop identifiers.

previousLinks

HopLink[]

List of previous hop links.

resourceId

string

The ID of the resource corresponding to this hop.

type

string

The type of the hop.

ConnectivityIssue

Information about an issue encountered in the process of checking for connectivity.

Name Type Description
context

object[]

Provides additional context on the issue.

origin

Origin

The origin of the issue.

severity

Severity

The severity of the issue.

type

IssueType

The type of issue.

ErrorDetails

Common error details representation.

Name Type Description
code

string

Error code.

message

string

Error message.

target

string

Error target.

ErrorResponse

The error object.

Name Type Description
error

ErrorDetails

Error
The error details object.

EvaluationState

Connectivity analysis evaluation state.

Name Type Description
Completed

string

InProgress

string

NotStarted

string

Hop link.

Name Type Description
context

object

Provides additional context on links.

issues

ConnectivityIssue[]

List of issues.

linkType

string

Link type.

nextHopId

string

The ID of the next hop.

properties.roundTripTimeAvg

integer

Average roundtrip time in milliseconds.

properties.roundTripTimeMax

integer

Maximum roundtrip time in milliseconds.

properties.roundTripTimeMin

integer

Minimum roundtrip time in milliseconds.

resourceId

string

Resource ID.

IssueType

The type of issue.

Name Type Description
AgentStopped

string

DnsResolution

string

GuestFirewall

string

NetworkSecurityRule

string

Platform

string

PortThrottled

string

SocketBind

string

Unknown

string

UserDefinedRoute

string

Origin

The origin of the issue.

Name Type Description
Inbound

string

Local

string

Outbound

string

Severity

The severity of the issue.

Name Type Description
Error

string

Warning

string