Permalink
Browse files

Merge pull request #3666 from number213/nw-reachability

Added Reachability Report methods for Network Watcher
  • Loading branch information...
2 parents c3b6761 + e755ec7 commit 57d082aea1766e3dd9a93f3ca01ea4559299e4c9 @amarzavery amarzavery committed Oct 17, 2017
Showing with 2,461 additions and 1,744 deletions.
  1. +2 −2 lib/commands/arm/network.generated/ApplicationGateways-probes._js
  2. +4 −4 lib/commands/arm/network.generated/ApplicationGateways-sslPolicy._js
  3. +1 −1 lib/commands/arm/network.generated/ApplicationGateways-urlPathMaps._js
  4. +2 −2 lib/commands/arm/network.generated/ExpressRoutes-expressRouteCircuitPeerings._js
  5. +1 −1 lib/commands/arm/network.generated/LoadBalancers-frontendIPConfigurations._js
  6. +8 −8 lib/commands/arm/network.generated/NetworkSecurityGroups-securityRules._js
  7. +2 −2 lib/commands/arm/network.generated/TrafficManagers-endpoints._js
  8. +2 −2 lib/commands/arm/network.generated/localNetworkGateways._js
  9. +149 −0 lib/commands/arm/network.generated/networkWatchers._js
  10. +1 −1 lib/commands/arm/network.generated/publicIPAddresses._js
  11. +2 −2 lib/commands/arm/network.generated/virtualNetworkGateways._js
  12. +4 −4 lib/commands/arm/network.generated/virtualNetworks._js
  13. +221 −0 lib/plugins.arm.json
  14. +51 −0 lib/util/generatorUtils.js
  15. +12 −12 .../commands/arm/network.generated/arm.network.application-gateway-address-pool-tests.json-output.js
  16. +10 −10 .../commands/arm/network.generated/arm.network.application-gateway-address-pool-tests.text-output.js
  17. +10 −10 test/commands/arm/network.generated/arm.network.application-gateway-auth-cert-tests.json-output.js
  18. +10 −10 test/commands/arm/network.generated/arm.network.application-gateway-auth-cert-tests.text-output.js
  19. +8 −8 test/commands/arm/network.generated/arm.network.application-gateway-frontend-ip-tests.json-output.js
  20. +8 −8 test/commands/arm/network.generated/arm.network.application-gateway-frontend-ip-tests.text-output.js
  21. +11 −11 ...commands/arm/network.generated/arm.network.application-gateway-frontend-port-tests.json-output.js
  22. +11 −11 ...commands/arm/network.generated/arm.network.application-gateway-frontend-port-tests.text-output.js
  23. +13 −13 ...commands/arm/network.generated/arm.network.application-gateway-http-listener-tests.json-output.js
  24. +13 −13 ...commands/arm/network.generated/arm.network.application-gateway-http-listener-tests.text-output.js
  25. +12 −12 ...commands/arm/network.generated/arm.network.application-gateway-http-settings-tests.json-output.js
  26. +12 −12 ...commands/arm/network.generated/arm.network.application-gateway-http-settings-tests.text-output.js
  27. +13 −13 test/commands/arm/network.generated/arm.network.application-gateway-probe-tests.json-output.js
  28. +11 −11 test/commands/arm/network.generated/arm.network.application-gateway-probe-tests.text-output.js
  29. +14 −14 ...mmands/arm/network.generated/arm.network.application-gateway-redirect-config-tests.json-output.js
  30. +14 −14 ...mmands/arm/network.generated/arm.network.application-gateway-redirect-config-tests.text-output.js
  31. +18 −18 test/commands/arm/network.generated/arm.network.application-gateway-rule-tests.json-output.js
  32. +18 −18 test/commands/arm/network.generated/arm.network.application-gateway-rule-tests.text-output.js
  33. +10 −10 test/commands/arm/network.generated/arm.network.application-gateway-ssl-cert-tests.json-output.js
  34. +10 −10 test/commands/arm/network.generated/arm.network.application-gateway-ssl-cert-tests.text-output.js
  35. +12 −12 test/commands/arm/network.generated/arm.network.application-gateway-ssl-policy-tests.json-output.js
  36. +9 −9 test/commands/arm/network.generated/arm.network.application-gateway-ssl-policy-tests.text-output.js
  37. +15 −15 test/commands/arm/network.generated/arm.network.application-gateway-tests.json-output.js
  38. +13 −13 test/commands/arm/network.generated/arm.network.application-gateway-tests.text-output.js
  39. +13 −13 .../commands/arm/network.generated/arm.network.application-gateway-url-path-map-tests.json-output.js
  40. +11 −11 .../commands/arm/network.generated/arm.network.application-gateway-url-path-map-tests.text-output.js
  41. +8 −8 test/commands/arm/network.generated/arm.network.application-gateway-waf-config-tests.json-output.js
  42. +8 −8 test/commands/arm/network.generated/arm.network.application-gateway-waf-config-tests.text-output.js
  43. +7 −7 test/commands/arm/network.generated/arm.network.application-security-group-tests.json-output.js
  44. +7 −7 test/commands/arm/network.generated/arm.network.application-security-group-tests.text-output.js
  45. +1 −1 test/commands/arm/network.generated/arm.network.endpoint-service-tests.json-output.js
  46. +1 −1 test/commands/arm/network.generated/arm.network.endpoint-service-tests.text-output.js
  47. +8 −8 ...erated/arm.network.express-route-circuit-express-route-circuit-authorization-tests.json-output.js
  48. +8 −8 ...erated/arm.network.express-route-circuit-express-route-circuit-authorization-tests.text-output.js
  49. +12 −12 ...rk.generated/arm.network.express-route-circuit-express-route-circuit-peering-tests.json-output.js
  50. +12 −12 ...rk.generated/arm.network.express-route-circuit-express-route-circuit-peering-tests.text-output.js
  51. +13 −13 test/commands/arm/network.generated/arm.network.express-route-circuit-tests.json-output.js
  52. +13 −13 test/commands/arm/network.generated/arm.network.express-route-circuit-tests.text-output.js
  53. +9 −9 test/commands/arm/network.generated/arm.network.lb-address-pool-tests.json-output.js
  54. +9 −9 test/commands/arm/network.generated/arm.network.lb-address-pool-tests.text-output.js
  55. +12 −12 test/commands/arm/network.generated/arm.network.lb-frontend-ip-tests.json-output.js
  56. +10 −10 test/commands/arm/network.generated/arm.network.lb-frontend-ip-tests.text-output.js
  57. +17 −17 test/commands/arm/network.generated/arm.network.lb-inbound-nat-pool-tests.json-output.js
  58. +17 −17 test/commands/arm/network.generated/arm.network.lb-inbound-nat-pool-tests.text-output.js
  59. +18 −18 test/commands/arm/network.generated/arm.network.lb-inbound-nat-rule-tests.json-output.js
  60. +18 −18 test/commands/arm/network.generated/arm.network.lb-inbound-nat-rule-tests.text-output.js
  61. +19 −19 test/commands/arm/network.generated/arm.network.lb-probe-tests.json-output.js
  62. +19 −19 test/commands/arm/network.generated/arm.network.lb-probe-tests.text-output.js
  63. +21 −21 test/commands/arm/network.generated/arm.network.lb-rule-tests.json-output.js
  64. +21 −21 test/commands/arm/network.generated/arm.network.lb-rule-tests.text-output.js
  65. +7 −7 test/commands/arm/network.generated/arm.network.lb-tests.json-output.js
  66. +7 −7 test/commands/arm/network.generated/arm.network.lb-tests.text-output.js
  67. +15 −15 test/commands/arm/network.generated/arm.network.local-gateway-tests.json-output.js
  68. +11 −11 test/commands/arm/network.generated/arm.network.local-gateway-tests.text-output.js
  69. +11 −11 test/commands/arm/network.generated/arm.network.nic-ip-config-tests.json-output.js
  70. +11 −11 test/commands/arm/network.generated/arm.network.nic-ip-config-tests.text-output.js
  71. +21 −21 test/commands/arm/network.generated/arm.network.nic-tests.json-output.js
  72. +21 −21 test/commands/arm/network.generated/arm.network.nic-tests.text-output.js
  73. +33 −33 test/commands/arm/network.generated/arm.network.nsg-rule-tests.json-output.js
  74. +25 −25 test/commands/arm/network.generated/arm.network.nsg-rule-tests.text-output.js
  75. +7 −7 test/commands/arm/network.generated/arm.network.nsg-tests.json-output.js
  76. +7 −7 test/commands/arm/network.generated/arm.network.nsg-tests.text-output.js
  77. +19 −19 test/commands/arm/network.generated/arm.network.public-ip-tests.json-output.js
  78. +17 −17 test/commands/arm/network.generated/arm.network.public-ip-tests.text-output.js
  79. +13 −13 test/commands/arm/network.generated/arm.network.route-table-route-tests.json-output.js
  80. +13 −13 test/commands/arm/network.generated/arm.network.route-table-route-tests.text-output.js
  81. +7 −7 test/commands/arm/network.generated/arm.network.route-table-tests.json-output.js
  82. +7 −7 test/commands/arm/network.generated/arm.network.route-table-tests.text-output.js
  83. +10 −11 test/commands/arm/network.generated/arm.network.traffic-manager-endpoint-tests.json-output.js
  84. +7 −8 test/commands/arm/network.generated/arm.network.traffic-manager-endpoint-tests.text-output.js
  85. +12 −13 test/commands/arm/network.generated/arm.network.traffic-manager-profile-tests.json-output.js
  86. +12 −13 test/commands/arm/network.generated/arm.network.traffic-manager-profile-tests.text-output.js
  87. +1 −1 test/commands/arm/network.generated/arm.network.usage-tests.json-output.js
  88. +1 −1 test/commands/arm/network.generated/arm.network.usage-tests.text-output.js
  89. +9 −9 test/commands/arm/network.generated/arm.network.vnet-peering-tests.json-output.js
  90. +9 −9 test/commands/arm/network.generated/arm.network.vnet-peering-tests.text-output.js
  91. +21 −21 test/commands/arm/network.generated/arm.network.vnet-subnet-tests.json-output.js
  92. +19 −19 test/commands/arm/network.generated/arm.network.vnet-subnet-tests.text-output.js
  93. +30 −30 test/commands/arm/network.generated/arm.network.vnet-tests.json-output.js
  94. +21 −21 test/commands/arm/network.generated/arm.network.vnet-tests.text-output.js
  95. +23 −23 test/commands/arm/network.generated/arm.network.vpn-gateway-tests.json-output.js
  96. +21 −21 test/commands/arm/network.generated/arm.network.vpn-gateway-tests.text-output.js
  97. +13 −13 test/commands/arm/network.generated/arm.network.watcher-packet-capture-tests.json-output.js
  98. +13 −13 test/commands/arm/network.generated/arm.network.watcher-packet-capture-tests.text-output.js
  99. +65 −41 test/commands/arm/network.generated/arm.network.watcher-tests.json-output.js
  100. +65 −41 test/commands/arm/network.generated/arm.network.watcher-tests.text-output.js
  101. +56 −56 ...-generated/arm_network_local_network_gateways_create_should_create_local_network_gateways.nock.js
  102. +38 −38 ...ted/arm_network_local_network_gateways_create_should_fail_for_invalid_bgp_peering_address.nock.js
  103. +24 −24 ...ts-generated/arm_network_local_network_gateways_create_should_fail_for_invalid_ip_address.nock.js
  104. +26 −26 ...ests-generated/arm_network_local_network_gateways_create_should_fail_for_invalid_prefixes.nock.js
  105. +26 −26 ...ateway-tests-generated/arm_network_local_network_gateways_create_should_fail_for_zero_asn.nock.js
  106. +70 −70 ...-generated/arm_network_local_network_gateways_delete_should_delete_local_network_gateways.nock.js
  107. +16 −16 ...k_local_network_gateways_list_should_display_all_local_network_gateways_in_resource_group.nock.js
  108. +60 −60 ...sts-generated/arm_network_local_network_gateways_set_should_update_local_network_gateways.nock.js
  109. +18 −18 ...ted/arm_network_local_network_gateways_show_should_display_local_network_gateways_details.nock.js
  110. +2 −2 ...arm-network-local-gateway-tests-generated/suite.arm-network-local-gateway-tests-generated.nock.js
  111. +20 −20 ...fic-manager-endpoint-tests-generated/arm_network_endpoints_create_should_create_endpoints.nock.js
  112. +34 −34 ...fic-manager-endpoint-tests-generated/arm_network_endpoints_delete_should_delete_endpoints.nock.js
  113. +20 −20 ...raffic-manager-endpoint-tests-generated/arm_network_endpoints_set_should_update_endpoints.nock.js
  114. +10 −10 ...ager-endpoint-tests-generated/arm_network_endpoints_show_should_display_endpoints_details.nock.js
  115. +16 −16 ...raffic-manager-profile-tests-generated/arm_network_profiles_create_should_create_profiles.nock.js
  116. +36 −36 ...ated/arm_network_profiles_create_with_defaults_should_create_profiles_with_default_values.nock.js
  117. +38 −38 ...raffic-manager-profile-tests-generated/arm_network_profiles_delete_should_delete_profiles.nock.js
  118. +8 −8 ...hould_perform_check_traffic_manager_relative_dns_name_availability_operation_successfully.nock.js
  119. +8 −8 ...e-tests-generated/arm_network_profiles_list_should_display_all_profiles_in_resource_group.nock.js
  120. +20 −20 ...k-traffic-manager-profile-tests-generated/arm_network_profiles_set_should_update_profiles.nock.js
  121. +10 −10 ...manager-profile-tests-generated/arm_network_profiles_show_should_display_profiles_details.nock.js
  122. +106 −0 ...ility-report-provider-list_should_perform_list_available_providers_operation_successfully.nock.js
  123. +146 −0 ...s_reachability-report_should_perform_get_azure_reachability_report_operation_successfully.nock.js
@@ -140,7 +140,7 @@ exports.init = function (cli) {
}
if(options.statusCodes) {
- parameters.match.statusCodes = options.statusCodes.split(',');
+ parameters.match.statusCodes = generatorUtils.splitStringByCharacter(options.statusCodes, ',');
}
parameters.name = name;
@@ -273,7 +273,7 @@ exports.init = function (cli) {
if(!utils.argHasValue(options.statusCodes)) {
delete parameters.match.statusCodes;
} else {
- parameters.match.statusCodes = options.statusCodes.split(',');
+ parameters.match.statusCodes = generatorUtils.splitStringByCharacter(options.statusCodes, ',');
}
}
@@ -85,7 +85,7 @@ exports.init = function (cli) {
var parameters = {};
if(options.disableSslProtocols) {
- parameters.disabledSslProtocols = options.disableSslProtocols.split(',');
+ parameters.disabledSslProtocols = generatorUtils.splitStringByCharacter(options.disableSslProtocols, ',');
}
if(options.policyType) {
@@ -97,7 +97,7 @@ exports.init = function (cli) {
}
if(options.cipherSuites) {
- parameters.cipherSuites = options.cipherSuites.split(',');
+ parameters.cipherSuites = generatorUtils.splitStringByCharacter(options.cipherSuites, ',');
}
if(options.minProtocolVersion) {
@@ -169,7 +169,7 @@ exports.init = function (cli) {
if(!utils.argHasValue(options.disableSslProtocols)) {
delete parameters.disabledSslProtocols;
} else {
- parameters.disabledSslProtocols = options.disableSslProtocols.split(',');
+ parameters.disabledSslProtocols = generatorUtils.splitStringByCharacter(options.disableSslProtocols, ',');
}
}
@@ -193,7 +193,7 @@ exports.init = function (cli) {
if(!utils.argHasValue(options.cipherSuites)) {
delete parameters.cipherSuites;
} else {
- parameters.cipherSuites = options.cipherSuites.split(',');
+ parameters.cipherSuites = generatorUtils.splitStringByCharacter(options.cipherSuites, ',');
}
}
@@ -117,7 +117,7 @@ exports.init = function (cli) {
parameters.pathRules[index] = {};
}
if(options.path) {
- parameters.pathRules[index].paths = options.path.split(',');
+ parameters.pathRules[index].paths = generatorUtils.splitStringByCharacter(options.path, ',');
}
if(!parameters.pathRules[index].backendAddressPool) {
@@ -139,7 +139,7 @@ exports.init = function (cli) {
}
if(options.msAdvertisedPublicPrefixes) {
parameters.microsoftPeeringConfig.advertisedPublicPrefixes = [];
- parameters.microsoftPeeringConfig.advertisedPublicPrefixes = parameters.microsoftPeeringConfig.advertisedPublicPrefixes.concat(options.msAdvertisedPublicPrefixes.split(','));
+ parameters.microsoftPeeringConfig.advertisedPublicPrefixes = parameters.microsoftPeeringConfig.advertisedPublicPrefixes.concat(generatorUtils.splitStringByCharacter(options.msAdvertisedPublicPrefixes, ','));
}
if(options.msAdvertisedPublicPrefixState) {
@@ -256,7 +256,7 @@ exports.init = function (cli) {
} else {
parameters.microsoftPeeringConfig.advertisedPublicPrefixes = [];
}
- parameters.microsoftPeeringConfig.advertisedPublicPrefixes = parameters.microsoftPeeringConfig.advertisedPublicPrefixes.concat(options.msAdvertisedPublicPrefixes.split(','));
+ parameters.microsoftPeeringConfig.advertisedPublicPrefixes = parameters.microsoftPeeringConfig.advertisedPublicPrefixes.concat(generatorUtils.splitStringByCharacter(options.msAdvertisedPublicPrefixes, ','));
}
if(options.msAdvertisedPublicPrefixState) {
@@ -124,7 +124,7 @@ exports.init = function (cli) {
}
if(options.zones) {
- parameters.zones = options.zones.split(',');
+ parameters.zones = generatorUtils.splitStringByCharacter(options.zones, ',');
}
parameters.name = name;
@@ -144,7 +144,7 @@ exports.init = function (cli) {
}
if(options.sourceAddressPrefixes) {
- parameters.sourceAddressPrefixes = options.sourceAddressPrefixes.split(',');
+ parameters.sourceAddressPrefixes = generatorUtils.splitStringByCharacter(options.sourceAddressPrefixes, ',');
}
if(options.sourceAddressPrefixes !== undefined) {
delete parameters.sourceAddressPrefix;
@@ -165,7 +165,7 @@ exports.init = function (cli) {
}
if(options.destinationAddressPrefixes) {
- parameters.destinationAddressPrefixes = options.destinationAddressPrefixes.split(',');
+ parameters.destinationAddressPrefixes = generatorUtils.splitStringByCharacter(options.destinationAddressPrefixes, ',');
}
if(options.destinationAddressPrefixes !== undefined) {
delete parameters.destinationAddressPrefix;
@@ -180,14 +180,14 @@ exports.init = function (cli) {
}
if(options.sourcePortRanges) {
- parameters.sourcePortRanges = options.sourcePortRanges.split(',');
+ parameters.sourcePortRanges = generatorUtils.splitStringByCharacter(options.sourcePortRanges, ',');
}
if(options.sourcePortRanges !== undefined) {
delete parameters.sourcePortRange;
}
if(options.destinationPortRanges) {
- parameters.destinationPortRanges = options.destinationPortRanges.split(',');
+ parameters.destinationPortRanges = generatorUtils.splitStringByCharacter(options.destinationPortRanges, ',');
}
if(options.destinationPortRanges !== undefined) {
delete parameters.destinationPortRange;
@@ -318,7 +318,7 @@ exports.init = function (cli) {
}
if(options.sourceAddressPrefixes) {
- parameters.sourceAddressPrefixes = options.sourceAddressPrefixes.split(',');
+ parameters.sourceAddressPrefixes = generatorUtils.splitStringByCharacter(options.sourceAddressPrefixes, ',');
}
if(options.sourceAddressPrefixes !== undefined) {
delete parameters.sourceAddressPrefix;
@@ -339,7 +339,7 @@ exports.init = function (cli) {
}
if(options.destinationAddressPrefixes) {
- parameters.destinationAddressPrefixes = options.destinationAddressPrefixes.split(',');
+ parameters.destinationAddressPrefixes = generatorUtils.splitStringByCharacter(options.destinationAddressPrefixes, ',');
}
if(options.destinationAddressPrefixes !== undefined) {
delete parameters.destinationAddressPrefix;
@@ -354,14 +354,14 @@ exports.init = function (cli) {
}
if(options.sourcePortRanges) {
- parameters.sourcePortRanges = options.sourcePortRanges.split(',');
+ parameters.sourcePortRanges = generatorUtils.splitStringByCharacter(options.sourcePortRanges, ',');
}
if(options.sourcePortRanges !== undefined) {
delete parameters.sourcePortRange;
}
if(options.destinationPortRanges) {
- parameters.destinationPortRanges = options.destinationPortRanges.split(',');
+ parameters.destinationPortRanges = generatorUtils.splitStringByCharacter(options.destinationPortRanges, ',');
}
if(options.destinationPortRanges !== undefined) {
delete parameters.destinationPortRange;
@@ -126,7 +126,7 @@ exports.init = function (cli) {
}
if(options.geoMapping) {
- parameters.geoMapping = options.geoMapping.split(',');
+ parameters.geoMapping = generatorUtils.splitStringByCharacter(options.geoMapping, ',');
}
generatorUtils.removeEmptyObjects(parameters);
@@ -229,7 +229,7 @@ exports.init = function (cli) {
}
if(options.geoMapping) {
- parameters.geoMapping = options.geoMapping.split(',');
+ parameters.geoMapping = generatorUtils.splitStringByCharacter(options.geoMapping, ',');
}
generatorUtils.removeEmptyObjects(parameters);
@@ -88,7 +88,7 @@ exports.init = function (cli) {
}
if(options.addressSpace) {
parameters.localNetworkAddressSpace.addressPrefixes = [];
- parameters.localNetworkAddressSpace.addressPrefixes = parameters.localNetworkAddressSpace.addressPrefixes.concat(options.addressSpace.split(','));
+ parameters.localNetworkAddressSpace.addressPrefixes = parameters.localNetworkAddressSpace.addressPrefixes.concat(generatorUtils.splitStringByCharacter(options.addressSpace, ','));
}
if(options.ipAddress) {
@@ -178,7 +178,7 @@ exports.init = function (cli) {
} else {
parameters.localNetworkAddressSpace.addressPrefixes = [];
}
- parameters.localNetworkAddressSpace.addressPrefixes = parameters.localNetworkAddressSpace.addressPrefixes.concat(options.addressSpace.split(','));
+ parameters.localNetworkAddressSpace.addressPrefixes = parameters.localNetworkAddressSpace.addressPrefixes.concat(generatorUtils.splitStringByCharacter(options.addressSpace, ','));
}
}
@@ -289,6 +289,92 @@ exports.init = function (cli) {
cli.interaction.formatOutput(networkWatcher, generatorUtils.traverse);
});
+ networkWatchers.command('reachability-report [resource-group] [name] [start-time] [end-time]')
+ .description($('Perform get azure reachability report operation on a network watcher'))
+ .usage('[options] <resource-group> <name> <start-time> <end-time>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-n, --name <name>', $('the name of the network watcher'))
+ .option('-c, --country [country]', $('country option value'))
+ .option('-a, --state [state]', $('state option value'))
+ .option('-i, --city [city]', $('city option value'))
+ .option('-p, --providers [providers]', $('list of Internet service providers'))
+ .option('-l, --azure-locations [azure-locations]', $('optional Azure regions to scope the' +
+ '\n query to'))
+ .option('-t, --start-time <start-time>', $('the start time for the Azure' +
+ '\n reachability report'))
+ .option('-e, --end-time <end-time>', $('the end time for the Azure reachability' +
+ '\n report'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, name, startTime, endTime, options, _) {
+ resourceGroup = cli.interaction.promptIfNotGiven($('resource group : '), resourceGroup, _);
+ name = cli.interaction.promptIfNotGiven($('name : '), name, _);
+ options.startTime = cli.interaction.promptIfNotGiven($('start time : '), startTime, _);
+ options.endTime = cli.interaction.promptIfNotGiven($('end time : '), endTime, _);
+
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var networkWatcher;
+
+ var progress = cli.interaction.progress(util.format($('Looking up the network watcher "%s"'), name));
+ try {
+ networkWatcher = networkManagementClient.networkWatchers.get(resourceGroup, name, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ networkWatcher = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if (!networkWatcher) {
+ throw new Error(util.format($('a network watcher with name "%s" not found in the resource group "%s"'), name, resourceGroup));
+ }
+ var parameters = {};
+ if(!parameters.providerLocation) {
+ parameters.providerLocation = {};
+ }
+ if(options.country) {
+ parameters.providerLocation.country = options.country;
+ }
+
+ if(options.state) {
+ parameters.providerLocation.state = options.state;
+ }
+
+ if(options.city) {
+ parameters.providerLocation.city = options.city;
+ }
+
+ if(options.providers) {
+ parameters.providers = generatorUtils.splitStringByCharacter(options.providers, ',');
+ }
+
+ if(options.azureLocations) {
+ parameters.azureLocations = generatorUtils.splitStringByCharacter(options.azureLocations, ',');
+ }
+
+ if(options.startTime) {
+ parameters.startTime = options.startTime;
+ }
+
+ if(options.endTime) {
+ parameters.endTime = options.endTime;
+ }
+
+ generatorUtils.removeEmptyObjects(parameters);
+ progress = cli.interaction.progress(util.format($('Performing get azure reachability report operation on a network watcher "%s"'), name));
+ try {
+ networkWatcher = networkManagementClient.networkWatchers.getAzureReachabilityReport(resourceGroup, name, parameters, _);
+ } finally {
+ progress.end();
+ }
+
+ cli.interaction.formatOutput(networkWatcher, generatorUtils.traverse);
+ });
+
networkWatchers.command('flow-log-status [resource-group] [name] [target]')
.description($('Perform get flow log status operation on a network watcher'))
.usage('[options] <resource-group> <name> <target>')
@@ -620,6 +706,69 @@ exports.init = function (cli) {
cli.interaction.formatOutput(networkWatcher, generatorUtils.traverse);
});
+ networkWatchers.command('reachability-report-provider-list [resource-group] [name]')
+ .description($('Perform list available providers operation on a network watcher'))
+ .usage('[options] <resource-group> <name>')
+ .option('-g, --resource-group <resource-group>', $('the name of the resource group'))
+ .option('-n, --name <name>', $('the name of the network watcher'))
+ .option('-l, --azure-locations [azure-locations]', $('azure locations option value'))
+ .option('-c, --country [country]', $('country option value'))
+ .option('-a, --state [state]', $('state option value'))
+ .option('-i, --city [city]', $('city option value'))
+ .option('-s, --subscription <subscription>', $('the subscription identifier'))
+ .execute(function(resourceGroup, name, options, _) {
+ resourceGroup = cli.interaction.promptIfNotGiven($('resource group : '), resourceGroup, _);
+ name = cli.interaction.promptIfNotGiven($('name : '), name, _);
+
+ var subscription = profile.current.getSubscription(options.subscription);
+ var networkManagementClient = utils.createNetworkManagementClient(subscription);
+
+ var networkWatcher;
+
+ var progress = cli.interaction.progress(util.format($('Looking up the network watcher "%s"'), name));
+ try {
+ networkWatcher = networkManagementClient.networkWatchers.get(resourceGroup, name, null, _);
+ } catch (e) {
+ if (e.statusCode === 404) {
+ networkWatcher = null;
+ } else {
+ throw e;
+ }
+ } finally {
+ progress.end();
+ }
+
+ if (!networkWatcher) {
+ throw new Error(util.format($('a network watcher with name "%s" not found in the resource group "%s"'), name, resourceGroup));
+ }
+ var parameters = {};
+ if(options.azureLocations) {
+ parameters.azureLocations = generatorUtils.splitStringByCharacter(options.azureLocations, ',');
+ }
+
+ if(options.country) {
+ parameters.country = options.country;
+ }
+
+ if(options.state) {
+ parameters.state = options.state;
+ }
+
+ if(options.city) {
+ parameters.city = options.city;
+ }
+
+ generatorUtils.removeEmptyObjects(parameters);
+ progress = cli.interaction.progress(util.format($('Performing list available providers operation on a network watcher "%s"'), name));
+ try {
+ networkWatcher = networkManagementClient.networkWatchers.listAvailableProviders(resourceGroup, name, parameters, _);
+ } finally {
+ progress.end();
+ }
+
+ cli.interaction.formatOutput(networkWatcher, generatorUtils.traverse);
+ });
+
networkWatchers.command('configure-flow-log [resource-group] [name] [target] [storage-id] [enable]')
.description($('Perform set flow log configuration operation on a network watcher'))
.usage('[options] <resource-group> <name> <target> <storage-id> <enable>')
@@ -138,7 +138,7 @@ exports.init = function (cli) {
}
if(options.zones) {
- parameters.zones = options.zones.split(',');
+ parameters.zones = generatorUtils.splitStringByCharacter(options.zones, ',');
}
if(options.tags && utils.argHasValue(options.tags)) {
@@ -198,7 +198,7 @@ exports.init = function (cli) {
}
if(options.addressPrefixes) {
parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = [];
- parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes.concat(options.addressPrefixes.split(','));
+ parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes.concat(generatorUtils.splitStringByCharacter(options.addressPrefixes, ','));
}
if(!parameters.bgpSettings) {
@@ -338,7 +338,7 @@ exports.init = function (cli) {
} else {
parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = [];
}
- parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes.concat(options.addressPrefixes.split(','));
+ parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes = parameters.vpnClientConfiguration.vpnClientAddressPool.addressPrefixes.concat(generatorUtils.splitStringByCharacter(options.addressPrefixes, ','));
}
if(!parameters.bgpSettings) {
Oops, something went wrong.

0 comments on commit 57d082a

Please sign in to comment.