Skip to content

Commit

Permalink
Added NetworkConfigurationDiagnostic rest API + example (#3599)
Browse files Browse the repository at this point in the history
* Added NetworkConfigurationDiagnostic rest API + example

* Removed 'read-only' from queries in NetworkConfigurationDiagnostic API

* Added long-running-operation-options: final-state-via location to networkConfigurationDiagnostic API

* Added QueryConnectionMonitors API + example

* Fixed example name

* Added default response to all APIs

* Fixed reference to ErrorDetails

* Fixed response for QueryConnectionMonitors API + fixed example

* Added properties to ConnectionStateSnapshot

* Fixed types for latencies in networkwatcher.json
  • Loading branch information
irrogozh authored and lmazuel committed Aug 15, 2018
1 parent 3f0d485 commit eb94056
Show file tree
Hide file tree
Showing 3 changed files with 816 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
{
"parameters" : {
"api-version": "2018-06-01",
"subscriptionId" : "subid",
"resourceGroupName" : "rg1",
"networkWatcherName" : "nw1",
"parameters" : {
"targetResourceId" : "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Compute/virtualMachines/vm1",
"queries": [
{
"direction" : "Inbound",
"protocol" : "TCP",
"source" : "10.1.0.4",
"destination" : "12.11.12.14",
"destinationPort" : "12100"
}
]
}
},
"responses" : {
"200" : {
"body" : {
"results": [
{
"trafficQuery": {
"direction": "Inbound",
"protocol": "TCP",
"source": "10.1.0.4",
"destination": "12.11.12.14",
"destinationPort": "12100"
},
"networkSecurityGroupResult": {
"securityRuleAccessResult": "Allow",
"evaluatedNetworkSecurityGroups": [
{
"networkSecurityGroupId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1",
"matchedRule": {
"ruleName": "UserRule_fe_rule",
"action": "Allow"
},
"rulesEvaluationResult": [
{
"name": "UserRule_Cleanuptool-Allow-100",
"protocolMatched": true,
"sourceMatched": false,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Allow-101",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Allow-102",
"protocolMatched": true,
"sourceMatched": false,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Deny-103",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_fe_rule",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": true
}
]
},
{
"networkSecurityGroupId": "/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG",
"matchedRule": {
"ruleName": "UserRule_fe_rule",
"action": "Allow"
},
"rulesEvaluationResult": [
{
"name": "UserRule_fe_rule",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": true
}
]
}
]
}
}
]
}
},
"202" : {
"body" : {
"results": [
{
"trafficQuery": {
"direction": "Inbound",
"protocol": "TCP",
"source": "10.1.0.4",
"destination": "12.11.12.14",
"destinationPort": "12100"
},
"networkSecurityGroupResult": {
"securityRuleAccessResult": "Allow",
"evaluatedNetworkSecurityGroups": [
{
"networkSecurityGroupId": "/subscriptions/subid/resourceGroups/rg2/providers/Microsoft.Network/networkSecurityGroups/nsg1",
"matchedRule": {
"ruleName": "UserRule_fe_rule",
"action": "Allow"
},
"rulesEvaluationResult": [
{
"name": "UserRule_Cleanuptool-Allow-100",
"protocolMatched": true,
"sourceMatched": false,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Allow-101",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Allow-102",
"protocolMatched": true,
"sourceMatched": false,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_Cleanuptool-Deny-103",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": false
},
{
"name": "UserRule_fe_rule",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": true
}
]
},
{
"networkSecurityGroupId": "/subscriptions/61cc8a98-a8be-4bfe-a04e-0b461f93fe35/resourceGroups/NwRgCentralUSEUAP_copy/providers/Microsoft.Network/networkSecurityGroups/AppNSG",
"matchedRule": {
"ruleName": "UserRule_fe_rule",
"action": "Allow"
},
"rulesEvaluationResult": [
{
"name": "UserRule_fe_rule",
"protocolMatched": true,
"sourceMatched": true,
"sourcePortMatched": true,
"destinationMatched": true,
"destinationPortMatched": true
}
]
}
]
}
}
]
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"parameters" : {
"api-version": "2018-06-01",
"subscriptionId" : "subid",
"resourceGroupName" : "rg1",
"networkWatcherName" : "nw1",
"parameters" : {
"connectionMonitorIds": [
"/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchers/nw1/connectionMonitors/cm1"
]
}
},
"responses" : {
"200" : {
"body" : {
"value": [
{
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchersnw1/connectionMonitors/cm1",
"report": {
"states": [
{
"connectionState": "Reachable",
"startTime": "2018-08-10T05:41:23Z",
"evaluationState": "NotStarted",
"avgLatencyInMs": 1,
"minLatencyInMs": 1,
"maxLatencyInMs": 1,
"probesSent": 3,
"probesFailed": 0,
"hops": []
}
]
}
}
]
}
},
"202" : {
"body" : {
"value": [
{
"resourceId": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Network/networkWatchersnw1/connectionMonitors/cm1",
"report": {
"states": [
{
"connectionState": "Reachable",
"startTime": "2018-08-10T05:41:23Z",
"evaluationState": "NotStarted",
"avgLatencyInMs": 1,
"minLatencyInMs": 1,
"maxLatencyInMs": 1,
"probesSent": 3,
"probesFailed": 0,
"hops": []
}
]
}
}
]
}
}
}
}
Loading

0 comments on commit eb94056

Please sign in to comment.