{Network} Update connection monitor creation and related commands#29124
Open
Ishpreet-01 wants to merge 49 commits intoAzure:devfrom
Open
{Network} Update connection monitor creation and related commands#29124Ishpreet-01 wants to merge 49 commits intoAzure:devfrom
Ishpreet-01 wants to merge 49 commits intoAzure:devfrom
Conversation
…est groups for cm
…s for cm creation
…ction monitor with http, tcp and icmp test configs
…onfig1 test to handle this and added relevant tests for cm creation the same
…ems and updated tests to handle the same
…cope for endpoint and also added tests for the same
… watcher.py to handle this
️✔️AzureCLI-FullTest
|
Member
Member
|
please provide the pr in aaz repo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Related commands
az network watcher connection-monitor create
az network watcher connection-monitor output add
az network watcher connection-monitor endpoint add
az network watcher connection-monitor test-configuration add
az network watcher connection-monitor test-group add
Description
We have two versions of connection monitors- Connection Monitor (Classic) and Connection Monitor. The Connection Monitor (Classic) was in a deprecation phase and it completely stopped working on 29th February after which the customers were not able to use the existing commands for creating a connection monitor. These commands were not able to support the newer connection monitor and the customers were not able to create a connection monitor using these commands.
Changes that we have made
In the network module:
We have modified these five commands and followed an approach similar to PowerShell according to which the customer will now be able to use these commands and use the output in the subsequent commands for creating a connection monitor. The test group add command is modified to accept a list of sources, destinations and test configurations and then we can use the output of this command in the connection monitor create command in order to create a connection monitor.
Effect of our changes
Testing Guide
For testing the commands, we use the launch.json file where we specified the commands using the args array.
For output add, the command used is:
"network", "watcher", "connection-monitor", "output", "add", "--type", "Workspace", "--workspace-id", "WorkspaceId"
For test configuration add, the command used is:
"network", "watcher", "connection-monitor", "test-configuration", "add", "--name", "myTC", "--frequency", "60", "--protocol", "Http", "--http-method", "Get", "--http-valid-status-codes", "[200,201]", "--http-port", "84", "--http-request-headers", "[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]"
For endpoint add, the command used is:
"network", "watcher", "connection-monitor", "endpoint", "add", "--name", "MyVM", "--type", "AzureVM", "--resource-id", "MyResourceId", "--scope-exclude", "[{'address':'10.0.0.25'},{'address':'10.0.0.30'}]", "--coverage-level", "BelowAverage"
For test group add, the command used is:
"network", "watcher", "connection-monitor", "test-group", "add", "--name", "tg1", "--sources", "[{'name':'Google','type':'ExternalAddress','address':'google.com'},{'name':'github','type':'ExternalAddress','address':'github.com','coverageLevel':'BelowAverage','scope':{'exclude':[{'address':'10.0.0.25'},{'address':'10.0.0.30'}]}}]", "--destinations", "[{'name':'MyVM','type':'AzureVM','resourceId':'MyResourceId'}]", "--test-configurations", "[{'name':'tc1','protocol':'Http','frequency':'60','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201'],'requestHeaders':[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]}}]"
For connection monitor create, the command used is:
"network", "watcher", "connection-monitor", "create", "--name", "cm3", "--network-watcher-name", "testnw", "--resource-group", "testrg", "--location", "eastus2", "--test-groups", "[{'testGroupName':'tg1','sources':[{'name':'VNet1','type':'AzureVNet','resourceId':'resourceId','coverageLevel':'BelowAverage',{name:'VNet2','type':'AzureVNet','resourceId':'resourceId2'}],'destinations':[{'name':'Google','type':'ExternalAddress','address':'google.com'},{name:'Github','type':'ExternalAddress','address':'github.com'}],'testConfigurations':[{'name':'tc1','protocol':'Http',frequency:'60','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201'],'requestHeaders':[{'name':'name1','value':'value1'},{'name':'name2','value':'value2'}]}},{'name':'tc3','protocol':'Http',frequency:'60'}]},{'testGroupName':'tg2','sources':[{'name':'Vnet','type':'AzureVNet','resourceId':'resourceId'},{'name':'VM','resourceId':'resourceId','type':'AzureVM'}],'destinations':[{'name':'Github','type':'ExternalAddress','address':'github.com'},{name:'Bing','type':'ExternalAddress','address':'bing.com'}],'testConfigurations':[{'name':'tc2','protocol':'Http',frequency:'120','httpConfiguration':{'method':'Get','validStatusCodeRanges':['200','201']}}]}]"
These commands are tested properly, and we also validated them using the get and delete API calls where we were able to get all the details of the connection monitor created using this command and also delete the CM successfully.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.