diff --git a/lib/services/networkManagement2/lib/models/connectionMonitorsQueryResultItem.js b/lib/services/networkManagement2/lib/models/connectionMonitorsQueryResultItem.js new file mode 100644 index 0000000000..6986e4f073 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/connectionMonitorsQueryResultItem.js @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Results of query particular connection monitor. + * + */ +class ConnectionMonitorsQueryResultItem { + /** + * Create a ConnectionMonitorsQueryResultItem. + * @member {string} [resourceId] Connection monitor resource ID. + * @member {object} [report] + * @member {string} [report.sourceStatus] Status of connection monitor + * source. Possible values include: 'Uknown', 'Active', 'Inactive' + * @member {array} [report.states] Information about connection states. + */ + constructor() { + } + + /** + * Defines the metadata of ConnectionMonitorsQueryResultItem + * + * @returns {object} metadata of ConnectionMonitorsQueryResultItem + * + */ + mapper() { + return { + required: false, + serializedName: 'ConnectionMonitorsQueryResultItem', + type: { + name: 'Composite', + className: 'ConnectionMonitorsQueryResultItem', + modelProperties: { + resourceId: { + required: false, + serializedName: 'resourceId', + type: { + name: 'String' + } + }, + report: { + required: false, + serializedName: 'report', + type: { + name: 'Composite', + className: 'ConnectionMonitorQueryResult' + } + } + } + } + }; + } +} + +module.exports = ConnectionMonitorsQueryResultItem; diff --git a/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js b/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js index ccf3aeec06..134fcd5235 100644 --- a/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js +++ b/lib/services/networkManagement2/lib/models/connectionStateSnapshot.js @@ -25,6 +25,11 @@ class ConnectionStateSnapshot { * @member {date} [endTime] The end time of the connection snapshot. * @member {string} [evaluationState] Connectivity analysis evaluation state. * Possible values include: 'NotStarted', 'InProgress', 'Completed' + * @member {number} [avgLatencyInMs] Average latency in ms. + * @member {number} [minLatencyInMs] Minimum latency in ms. + * @member {number} [maxLatencyInMs] Maximum latency in ms. + * @member {number} [probesSent] The number of sent probes. + * @member {number} [probesFailed] The number of failed probes. * @member {array} [hops] List of hops between the source and the * destination. */ @@ -73,6 +78,41 @@ class ConnectionStateSnapshot { name: 'String' } }, + avgLatencyInMs: { + required: false, + serializedName: 'avgLatencyInMs', + type: { + name: 'Number' + } + }, + minLatencyInMs: { + required: false, + serializedName: 'minLatencyInMs', + type: { + name: 'Number' + } + }, + maxLatencyInMs: { + required: false, + serializedName: 'maxLatencyInMs', + type: { + name: 'Number' + } + }, + probesSent: { + required: false, + serializedName: 'probesSent', + type: { + name: 'Number' + } + }, + probesFailed: { + required: false, + serializedName: 'probesFailed', + type: { + name: 'Number' + } + }, hops: { required: false, readOnly: true, diff --git a/lib/services/networkManagement2/lib/models/errorResponse.js b/lib/services/networkManagement2/lib/models/errorResponse.js new file mode 100644 index 0000000000..89e4677830 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/errorResponse.js @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The error object. + * + */ +class ErrorResponse { + /** + * Create a ErrorResponse. + * @member {object} [error] Error. + * @member {string} [error.code] + * @member {string} [error.target] + * @member {string} [error.message] + */ + constructor() { + } + + /** + * Defines the metadata of ErrorResponse + * + * @returns {object} metadata of ErrorResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'ErrorResponse', + type: { + name: 'Composite', + className: 'ErrorResponse', + modelProperties: { + error: { + required: false, + serializedName: 'error', + type: { + name: 'Composite', + className: 'ErrorDetails' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js b/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js new file mode 100644 index 0000000000..9f82902ea9 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/evaluatedNetworkSecurityGroup.js @@ -0,0 +1,85 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Results of network security group evaluation. + * + */ +class EvaluatedNetworkSecurityGroup { + /** + * Create a EvaluatedNetworkSecurityGroup. + * @member {string} [networkSecurityGroupId] Network security group ID. + * @member {object} [matchedRule] + * @member {string} [matchedRule.ruleName] Name of the matched network + * security rule. + * @member {string} [matchedRule.action] The network traffic is allowed or + * denied. Possible values are 'Allow' and 'Deny'. + * @member {array} [rulesEvaluationResult] List of network security rules + * evaluation results. + */ + constructor() { + } + + /** + * Defines the metadata of EvaluatedNetworkSecurityGroup + * + * @returns {object} metadata of EvaluatedNetworkSecurityGroup + * + */ + mapper() { + return { + required: false, + serializedName: 'EvaluatedNetworkSecurityGroup', + type: { + name: 'Composite', + className: 'EvaluatedNetworkSecurityGroup', + modelProperties: { + networkSecurityGroupId: { + required: false, + serializedName: 'networkSecurityGroupId', + type: { + name: 'String' + } + }, + matchedRule: { + required: false, + serializedName: 'matchedRule', + type: { + name: 'Composite', + className: 'MatchedRule' + } + }, + rulesEvaluationResult: { + required: false, + readOnly: true, + serializedName: 'rulesEvaluationResult', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkSecurityRulesEvaluationResultElementType', + type: { + name: 'Composite', + className: 'NetworkSecurityRulesEvaluationResult' + } + } + } + } + } + } + }; + } +} + +module.exports = EvaluatedNetworkSecurityGroup; diff --git a/lib/services/networkManagement2/lib/models/index.d.ts b/lib/services/networkManagement2/lib/models/index.d.ts index dc2fde51e5..1b4552f3d9 100644 --- a/lib/services/networkManagement2/lib/models/index.d.ts +++ b/lib/services/networkManagement2/lib/models/index.d.ts @@ -4137,6 +4137,21 @@ export interface EffectiveRouteListResult { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the ErrorResponse class. + * @constructor + * The error object. + * + * @member {object} [error] Error. + * @member {string} [error.code] + * @member {string} [error.target] + * @member {string} [error.message] + */ +export interface ErrorResponse { + error?: ErrorDetails; +} + /** * @class * Initializes a new instance of the NetworkWatcher class. @@ -5351,6 +5366,11 @@ export interface ConnectionMonitorResult extends BaseResource { * @member {date} [endTime] The end time of the connection snapshot. * @member {string} [evaluationState] Connectivity analysis evaluation state. * Possible values include: 'NotStarted', 'InProgress', 'Completed' + * @member {number} [avgLatencyInMs] Average latency in ms. + * @member {number} [minLatencyInMs] Minimum latency in ms. + * @member {number} [maxLatencyInMs] Maximum latency in ms. + * @member {number} [probesSent] The number of sent probes. + * @member {number} [probesFailed] The number of failed probes. * @member {array} [hops] List of hops between the source and the destination. */ export interface ConnectionStateSnapshot { @@ -5358,6 +5378,11 @@ export interface ConnectionStateSnapshot { startTime?: Date; endTime?: Date; evaluationState?: string; + avgLatencyInMs?: number; + minLatencyInMs?: number; + maxLatencyInMs?: number; + probesSent?: number; + probesFailed?: number; readonly hops?: ConnectivityHop[]; } @@ -5376,6 +5401,200 @@ export interface ConnectionMonitorQueryResult { states?: ConnectionStateSnapshot[]; } +/** + * @class + * Initializes a new instance of the TrafficQuery class. + * @constructor + * Parameters to compare with network configuration. + * + * @member {string} direction The direction of the traffic. Accepted values are + * 'Inbound' and 'Outbound'. Possible values include: 'Inbound', 'Outbound' + * @member {string} protocol Protocol to be verified on. Accepted values are + * '*', TCP, UDP. + * @member {string} source Traffic source. Accepted values are '*', IP + * Address/CIDR, Service Tag. + * @member {string} destination Traffic destination. Accepted values are: '*', + * IP Address/CIDR, Service Tag. + * @member {string} destinationPort Traffice destination port. Accepted values + * are '*', port (for example, 3389) and port range (for example, 80-100). + */ +export interface TrafficQuery { + direction: string; + protocol: string; + source: string; + destination: string; + destinationPort: string; +} + +/** + * @class + * Initializes a new instance of the NetworkConfigurationDiagnosticParameters class. + * @constructor + * Parameters to get network configuration diagnostic. + * + * @member {string} targetResourceId The ID of the target resource to perform + * network configuration diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + * @member {array} queries List of traffic queries. + */ +export interface NetworkConfigurationDiagnosticParameters { + targetResourceId: string; + queries: TrafficQuery[]; +} + +/** + * @class + * Initializes a new instance of the MatchedRule class. + * @constructor + * Matched rule. + * + * @member {string} [ruleName] Name of the matched network security rule. + * @member {string} [action] The network traffic is allowed or denied. Possible + * values are 'Allow' and 'Deny'. + */ +export interface MatchedRule { + ruleName?: string; + action?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkSecurityRulesEvaluationResult class. + * @constructor + * Network security rules evaluation result. + * + * @member {string} [name] Name of the network security rule. + * @member {boolean} [protocolMatched] Value indicating whether protocol is + * matched. + * @member {boolean} [sourceMatched] Value indicating whether source is + * matched. + * @member {boolean} [sourcePortMatched] Value indicating whether source port + * is matched. + * @member {boolean} [destinationMatched] Value indicating whether destination + * is matched. + * @member {boolean} [destinationPortMatched] Value indicating whether + * destination port is matched. + */ +export interface NetworkSecurityRulesEvaluationResult { + name?: string; + protocolMatched?: boolean; + sourceMatched?: boolean; + sourcePortMatched?: boolean; + destinationMatched?: boolean; + destinationPortMatched?: boolean; +} + +/** + * @class + * Initializes a new instance of the EvaluatedNetworkSecurityGroup class. + * @constructor + * Results of network security group evaluation. + * + * @member {string} [networkSecurityGroupId] Network security group ID. + * @member {object} [matchedRule] + * @member {string} [matchedRule.ruleName] Name of the matched network security + * rule. + * @member {string} [matchedRule.action] The network traffic is allowed or + * denied. Possible values are 'Allow' and 'Deny'. + * @member {array} [rulesEvaluationResult] List of network security rules + * evaluation results. + */ +export interface EvaluatedNetworkSecurityGroup { + networkSecurityGroupId?: string; + matchedRule?: MatchedRule; + readonly rulesEvaluationResult?: NetworkSecurityRulesEvaluationResult[]; +} + +/** + * @class + * Initializes a new instance of the NetworkSecurityGroupResult class. + * @constructor + * Network configuration diagnostic result corresponded provided traffic query. + * + * @member {string} [securityRuleAccessResult] The network traffic is allowed + * or denied. Possible values are 'Allow' and 'Deny'. Possible values include: + * 'Allow', 'Deny' + * @member {array} [evaluatedNetworkSecurityGroups] List of results network + * security groups diagnostic. + */ +export interface NetworkSecurityGroupResult { + securityRuleAccessResult?: string; + readonly evaluatedNetworkSecurityGroups?: EvaluatedNetworkSecurityGroup[]; +} + +/** + * @class + * Initializes a new instance of the NetworkConfigurationDiagnosticResult class. + * @constructor + * Network configuration diagnostic result corresponded to provided traffic + * query. + * + * @member {object} [trafficQuery] + * @member {string} [trafficQuery.direction] The direction of the traffic. + * Accepted values are 'Inbound' and 'Outbound'. Possible values include: + * 'Inbound', 'Outbound' + * @member {string} [trafficQuery.protocol] Protocol to be verified on. + * Accepted values are '*', TCP, UDP. + * @member {string} [trafficQuery.source] Traffic source. Accepted values are + * '*', IP Address/CIDR, Service Tag. + * @member {string} [trafficQuery.destination] Traffic destination. Accepted + * values are: '*', IP Address/CIDR, Service Tag. + * @member {string} [trafficQuery.destinationPort] Traffice destination port. + * Accepted values are '*', port (for example, 3389) and port range (for + * example, 80-100). + * @member {object} [networkSecurityGroupResult] + * @member {string} [networkSecurityGroupResult.securityRuleAccessResult] The + * network traffic is allowed or denied. Possible values are 'Allow' and + * 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} [networkSecurityGroupResult.evaluatedNetworkSecurityGroups] + * List of results network security groups diagnostic. + */ +export interface NetworkConfigurationDiagnosticResult { + trafficQuery?: TrafficQuery; + networkSecurityGroupResult?: NetworkSecurityGroupResult; +} + +/** + * @class + * Initializes a new instance of the NetworkConfigurationDiagnosticResponse class. + * @constructor + * Results of network configuration diagnostic on the target resource. + * + * @member {array} [results] List of network configuration diagnostic results. + */ +export interface NetworkConfigurationDiagnosticResponse { + readonly results?: NetworkConfigurationDiagnosticResult[]; +} + +/** + * @class + * Initializes a new instance of the QueryConnectionMonitorsParameters class. + * @constructor + * Parameters to query connection monitors. + * + * @member {array} [connectionMonitorIds] List of connection monitors ID. + */ +export interface QueryConnectionMonitorsParameters { + connectionMonitorIds?: string[]; +} + +/** + * @class + * Initializes a new instance of the ConnectionMonitorsQueryResultItem class. + * @constructor + * Results of query particular connection monitor. + * + * @member {string} [resourceId] Connection monitor resource ID. + * @member {object} [report] + * @member {string} [report.sourceStatus] Status of connection monitor source. + * Possible values include: 'Uknown', 'Active', 'Inactive' + * @member {array} [report.states] Information about connection states. + */ +export interface ConnectionMonitorsQueryResultItem { + resourceId?: string; + report?: ConnectionMonitorQueryResult; +} + /** * @class * Initializes a new instance of the OperationDisplay class. @@ -7201,6 +7420,18 @@ export interface SecurityRuleListResult extends Array { export interface NetworkWatcherListResult extends Array { } +/** + * @class + * Initializes a new instance of the QueryConnectionMonitorsResponse class. + * @constructor + * Results of query connection monitors. + * + * @member {string} [nextLink] URL to get the next set of results. + */ +export interface QueryConnectionMonitorsResponse extends Array { + nextLink?: string; +} + /** * @class * Initializes a new instance of the PacketCaptureListResult class. diff --git a/lib/services/networkManagement2/lib/models/index.js b/lib/services/networkManagement2/lib/models/index.js index bd50b1261c..a83ece2d6b 100644 --- a/lib/services/networkManagement2/lib/models/index.js +++ b/lib/services/networkManagement2/lib/models/index.js @@ -123,6 +123,7 @@ exports.EffectiveNetworkSecurityGroup = require('./effectiveNetworkSecurityGroup exports.EffectiveNetworkSecurityGroupListResult = require('./effectiveNetworkSecurityGroupListResult'); exports.EffectiveRoute = require('./effectiveRoute'); exports.EffectiveRouteListResult = require('./effectiveRouteListResult'); +exports.ErrorResponse = require('./errorResponse'); exports.NetworkWatcher = require('./networkWatcher'); exports.TopologyParameters = require('./topologyParameters'); exports.TopologyAssociation = require('./topologyAssociation'); @@ -180,6 +181,16 @@ exports.ConnectionMonitor = require('./connectionMonitor'); exports.ConnectionMonitorResult = require('./connectionMonitorResult'); exports.ConnectionStateSnapshot = require('./connectionStateSnapshot'); exports.ConnectionMonitorQueryResult = require('./connectionMonitorQueryResult'); +exports.TrafficQuery = require('./trafficQuery'); +exports.NetworkConfigurationDiagnosticParameters = require('./networkConfigurationDiagnosticParameters'); +exports.MatchedRule = require('./matchedRule'); +exports.NetworkSecurityRulesEvaluationResult = require('./networkSecurityRulesEvaluationResult'); +exports.EvaluatedNetworkSecurityGroup = require('./evaluatedNetworkSecurityGroup'); +exports.NetworkSecurityGroupResult = require('./networkSecurityGroupResult'); +exports.NetworkConfigurationDiagnosticResult = require('./networkConfigurationDiagnosticResult'); +exports.NetworkConfigurationDiagnosticResponse = require('./networkConfigurationDiagnosticResponse'); +exports.QueryConnectionMonitorsParameters = require('./queryConnectionMonitorsParameters'); +exports.ConnectionMonitorsQueryResultItem = require('./connectionMonitorsQueryResultItem'); exports.OperationDisplay = require('./operationDisplay'); exports.Availability = require('./availability'); exports.Dimension = require('./dimension'); @@ -256,6 +267,7 @@ exports.NetworkInterfaceLoadBalancerListResult = require('./networkInterfaceLoad exports.NetworkSecurityGroupListResult = require('./networkSecurityGroupListResult'); exports.SecurityRuleListResult = require('./securityRuleListResult'); exports.NetworkWatcherListResult = require('./networkWatcherListResult'); +exports.QueryConnectionMonitorsResponse = require('./queryConnectionMonitorsResponse'); exports.PacketCaptureListResult = require('./packetCaptureListResult'); exports.ConnectionMonitorListResult = require('./connectionMonitorListResult'); exports.OperationListResult = require('./operationListResult'); diff --git a/lib/services/networkManagement2/lib/models/matchedRule.js b/lib/services/networkManagement2/lib/models/matchedRule.js new file mode 100644 index 0000000000..ec9d7d44cd --- /dev/null +++ b/lib/services/networkManagement2/lib/models/matchedRule.js @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Matched rule. + * + */ +class MatchedRule { + /** + * Create a MatchedRule. + * @member {string} [ruleName] Name of the matched network security rule. + * @member {string} [action] The network traffic is allowed or denied. + * Possible values are 'Allow' and 'Deny'. + */ + constructor() { + } + + /** + * Defines the metadata of MatchedRule + * + * @returns {object} metadata of MatchedRule + * + */ + mapper() { + return { + required: false, + serializedName: 'MatchedRule', + type: { + name: 'Composite', + className: 'MatchedRule', + modelProperties: { + ruleName: { + required: false, + serializedName: 'ruleName', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MatchedRule; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js new file mode 100644 index 0000000000..d8b7285f4f --- /dev/null +++ b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticParameters.js @@ -0,0 +1,72 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Parameters to get network configuration diagnostic. + * + */ +class NetworkConfigurationDiagnosticParameters { + /** + * Create a NetworkConfigurationDiagnosticParameters. + * @member {string} targetResourceId The ID of the target resource to perform + * network configuration diagnostic. Valid options are VM, NetworkInterface, + * VMSS/NetworkInterface and Application Gateway. + * @member {array} queries List of traffic queries. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkConfigurationDiagnosticParameters + * + * @returns {object} metadata of NetworkConfigurationDiagnosticParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkConfigurationDiagnosticParameters', + type: { + name: 'Composite', + className: 'NetworkConfigurationDiagnosticParameters', + modelProperties: { + targetResourceId: { + required: true, + serializedName: 'targetResourceId', + type: { + name: 'String' + } + }, + queries: { + required: true, + serializedName: 'queries', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TrafficQueryElementType', + type: { + name: 'Composite', + className: 'TrafficQuery' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkConfigurationDiagnosticParameters; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js new file mode 100644 index 0000000000..1b6db15851 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResponse.js @@ -0,0 +1,64 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Results of network configuration diagnostic on the target resource. + * + */ +class NetworkConfigurationDiagnosticResponse { + /** + * Create a NetworkConfigurationDiagnosticResponse. + * @member {array} [results] List of network configuration diagnostic + * results. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkConfigurationDiagnosticResponse + * + * @returns {object} metadata of NetworkConfigurationDiagnosticResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkConfigurationDiagnosticResponse', + type: { + name: 'Composite', + className: 'NetworkConfigurationDiagnosticResponse', + modelProperties: { + results: { + required: false, + readOnly: true, + serializedName: 'results', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkConfigurationDiagnosticResultElementType', + type: { + name: 'Composite', + className: 'NetworkConfigurationDiagnosticResult' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkConfigurationDiagnosticResponse; diff --git a/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js new file mode 100644 index 0000000000..b5fb39e166 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/networkConfigurationDiagnosticResult.js @@ -0,0 +1,83 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network configuration diagnostic result corresponded to provided traffic + * query. + * + */ +class NetworkConfigurationDiagnosticResult { + /** + * Create a NetworkConfigurationDiagnosticResult. + * @member {object} [trafficQuery] + * @member {string} [trafficQuery.direction] The direction of the traffic. + * Accepted values are 'Inbound' and 'Outbound'. Possible values include: + * 'Inbound', 'Outbound' + * @member {string} [trafficQuery.protocol] Protocol to be verified on. + * Accepted values are '*', TCP, UDP. + * @member {string} [trafficQuery.source] Traffic source. Accepted values are + * '*', IP Address/CIDR, Service Tag. + * @member {string} [trafficQuery.destination] Traffic destination. Accepted + * values are: '*', IP Address/CIDR, Service Tag. + * @member {string} [trafficQuery.destinationPort] Traffice destination port. + * Accepted values are '*', port (for example, 3389) and port range (for + * example, 80-100). + * @member {object} [networkSecurityGroupResult] + * @member {string} [networkSecurityGroupResult.securityRuleAccessResult] The + * network traffic is allowed or denied. Possible values are 'Allow' and + * 'Deny'. Possible values include: 'Allow', 'Deny' + * @member {array} + * [networkSecurityGroupResult.evaluatedNetworkSecurityGroups] List of + * results network security groups diagnostic. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkConfigurationDiagnosticResult + * + * @returns {object} metadata of NetworkConfigurationDiagnosticResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkConfigurationDiagnosticResult', + type: { + name: 'Composite', + className: 'NetworkConfigurationDiagnosticResult', + modelProperties: { + trafficQuery: { + required: false, + serializedName: 'trafficQuery', + type: { + name: 'Composite', + className: 'TrafficQuery' + } + }, + networkSecurityGroupResult: { + required: false, + serializedName: 'networkSecurityGroupResult', + type: { + name: 'Composite', + className: 'NetworkSecurityGroupResult' + } + } + } + } + }; + } +} + +module.exports = NetworkConfigurationDiagnosticResult; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js b/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js new file mode 100644 index 0000000000..3157a203fe --- /dev/null +++ b/lib/services/networkManagement2/lib/models/networkSecurityGroupResult.js @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Network configuration diagnostic result corresponded provided traffic query. + * + */ +class NetworkSecurityGroupResult { + /** + * Create a NetworkSecurityGroupResult. + * @member {string} [securityRuleAccessResult] The network traffic is allowed + * or denied. Possible values are 'Allow' and 'Deny'. Possible values + * include: 'Allow', 'Deny' + * @member {array} [evaluatedNetworkSecurityGroups] List of results network + * security groups diagnostic. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkSecurityGroupResult + * + * @returns {object} metadata of NetworkSecurityGroupResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkSecurityGroupResult', + type: { + name: 'Composite', + className: 'NetworkSecurityGroupResult', + modelProperties: { + securityRuleAccessResult: { + required: false, + serializedName: 'securityRuleAccessResult', + type: { + name: 'String' + } + }, + evaluatedNetworkSecurityGroups: { + required: false, + readOnly: true, + serializedName: 'evaluatedNetworkSecurityGroups', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'EvaluatedNetworkSecurityGroupElementType', + type: { + name: 'Composite', + className: 'EvaluatedNetworkSecurityGroup' + } + } + } + } + } + } + }; + } +} + +module.exports = NetworkSecurityGroupResult; diff --git a/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js b/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js new file mode 100644 index 0000000000..86f808efb3 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/networkSecurityRulesEvaluationResult.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Network security rules evaluation result. + * + */ +class NetworkSecurityRulesEvaluationResult { + /** + * Create a NetworkSecurityRulesEvaluationResult. + * @member {string} [name] Name of the network security rule. + * @member {boolean} [protocolMatched] Value indicating whether protocol is + * matched. + * @member {boolean} [sourceMatched] Value indicating whether source is + * matched. + * @member {boolean} [sourcePortMatched] Value indicating whether source port + * is matched. + * @member {boolean} [destinationMatched] Value indicating whether + * destination is matched. + * @member {boolean} [destinationPortMatched] Value indicating whether + * destination port is matched. + */ + constructor() { + } + + /** + * Defines the metadata of NetworkSecurityRulesEvaluationResult + * + * @returns {object} metadata of NetworkSecurityRulesEvaluationResult + * + */ + mapper() { + return { + required: false, + serializedName: 'NetworkSecurityRulesEvaluationResult', + type: { + name: 'Composite', + className: 'NetworkSecurityRulesEvaluationResult', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + protocolMatched: { + required: false, + serializedName: 'protocolMatched', + type: { + name: 'Boolean' + } + }, + sourceMatched: { + required: false, + serializedName: 'sourceMatched', + type: { + name: 'Boolean' + } + }, + sourcePortMatched: { + required: false, + serializedName: 'sourcePortMatched', + type: { + name: 'Boolean' + } + }, + destinationMatched: { + required: false, + serializedName: 'destinationMatched', + type: { + name: 'Boolean' + } + }, + destinationPortMatched: { + required: false, + serializedName: 'destinationPortMatched', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = NetworkSecurityRulesEvaluationResult; diff --git a/lib/services/networkManagement2/lib/models/queryConnectionMonitorsParameters.js b/lib/services/networkManagement2/lib/models/queryConnectionMonitorsParameters.js new file mode 100644 index 0000000000..f5535cec59 --- /dev/null +++ b/lib/services/networkManagement2/lib/models/queryConnectionMonitorsParameters.js @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Parameters to query connection monitors. + * + */ +class QueryConnectionMonitorsParameters { + /** + * Create a QueryConnectionMonitorsParameters. + * @member {array} [connectionMonitorIds] List of connection monitors ID. + */ + constructor() { + } + + /** + * Defines the metadata of QueryConnectionMonitorsParameters + * + * @returns {object} metadata of QueryConnectionMonitorsParameters + * + */ + mapper() { + return { + required: false, + serializedName: 'QueryConnectionMonitorsParameters', + type: { + name: 'Composite', + className: 'QueryConnectionMonitorsParameters', + modelProperties: { + connectionMonitorIds: { + required: false, + serializedName: 'connectionMonitorIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = QueryConnectionMonitorsParameters; diff --git a/lib/services/networkManagement2/lib/models/queryConnectionMonitorsResponse.js b/lib/services/networkManagement2/lib/models/queryConnectionMonitorsResponse.js new file mode 100644 index 0000000000..8ac61e32ac --- /dev/null +++ b/lib/services/networkManagement2/lib/models/queryConnectionMonitorsResponse.js @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Results of query connection monitors. + */ +class QueryConnectionMonitorsResponse extends Array { + /** + * Create a QueryConnectionMonitorsResponse. + * @member {string} [nextLink] URL to get the next set of results. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of QueryConnectionMonitorsResponse + * + * @returns {object} metadata of QueryConnectionMonitorsResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'QueryConnectionMonitorsResponse', + type: { + name: 'Composite', + className: 'QueryConnectionMonitorsResponse', + modelProperties: { + value: { + required: false, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnectionMonitorsQueryResultItemElementType', + type: { + name: 'Composite', + className: 'ConnectionMonitorsQueryResultItem' + } + } + } + }, + nextLink: { + required: false, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = QueryConnectionMonitorsResponse; diff --git a/lib/services/networkManagement2/lib/models/trafficQuery.js b/lib/services/networkManagement2/lib/models/trafficQuery.js new file mode 100644 index 0000000000..29bbed73ae --- /dev/null +++ b/lib/services/networkManagement2/lib/models/trafficQuery.js @@ -0,0 +1,91 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Parameters to compare with network configuration. + * + */ +class TrafficQuery { + /** + * Create a TrafficQuery. + * @member {string} direction The direction of the traffic. Accepted values + * are 'Inbound' and 'Outbound'. Possible values include: 'Inbound', + * 'Outbound' + * @member {string} protocol Protocol to be verified on. Accepted values are + * '*', TCP, UDP. + * @member {string} source Traffic source. Accepted values are '*', IP + * Address/CIDR, Service Tag. + * @member {string} destination Traffic destination. Accepted values are: + * '*', IP Address/CIDR, Service Tag. + * @member {string} destinationPort Traffice destination port. Accepted + * values are '*', port (for example, 3389) and port range (for example, + * 80-100). + */ + constructor() { + } + + /** + * Defines the metadata of TrafficQuery + * + * @returns {object} metadata of TrafficQuery + * + */ + mapper() { + return { + required: false, + serializedName: 'TrafficQuery', + type: { + name: 'Composite', + className: 'TrafficQuery', + modelProperties: { + direction: { + required: true, + serializedName: 'direction', + type: { + name: 'String' + } + }, + protocol: { + required: true, + serializedName: 'protocol', + type: { + name: 'String' + } + }, + source: { + required: true, + serializedName: 'source', + type: { + name: 'String' + } + }, + destination: { + required: true, + serializedName: 'destination', + type: { + name: 'String' + } + }, + destinationPort: { + required: true, + serializedName: 'destinationPort', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TrafficQuery; diff --git a/lib/services/networkManagement2/lib/operations/connectionMonitors.js b/lib/services/networkManagement2/lib/operations/connectionMonitors.js index a8ea0a1960..2f872d65be 100644 --- a/lib/services/networkManagement2/lib/operations/connectionMonitors.js +++ b/lib/services/networkManagement2/lib/operations/connectionMonitors.js @@ -239,12 +239,13 @@ function _get(resourceGroupName, networkWatcherName, connectionMonitorName, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -665,12 +666,13 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -865,12 +867,13 @@ function _beginCreateOrUpdate(resourceGroupName, networkWatcherName, connectionM try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1031,12 +1034,13 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, connectionMon try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1163,12 +1167,13 @@ function _beginStop(resourceGroupName, networkWatcherName, connectionMonitorName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1295,12 +1300,13 @@ function _beginStart(resourceGroupName, networkWatcherName, connectionMonitorNam try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1430,12 +1436,13 @@ function _beginQuery(resourceGroupName, networkWatcherName, connectionMonitorNam try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/networkManagement2/lib/operations/index.d.ts b/lib/services/networkManagement2/lib/operations/index.d.ts index 1b50dafa65..4362865f0f 100644 --- a/lib/services/networkManagement2/lib/operations/index.d.ts +++ b/lib/services/networkManagement2/lib/operations/index.d.ts @@ -16940,6 +16940,156 @@ export interface NetworkWatchers { listAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + /** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkConfigurationDiagnosticResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkConfigurationDiagnosticResponse} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, callback: ServiceCallback): void; + getNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + queryConnectionMonitorsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QueryConnectionMonitorsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + queryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + queryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, callback: ServiceCallback): void; + queryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + /** * Deletes the specified network watcher resource. * @@ -17989,6 +18139,272 @@ export interface NetworkWatchers { beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, callback: ServiceCallback): void; beginListAvailableProviders(resourceGroupName: string, networkWatcherName: string, parameters: models.AvailableProvidersListParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginGetNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkConfigurationDiagnosticResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkConfigurationDiagnosticResponse} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, callback: ServiceCallback): void; + beginGetNetworkConfigurationDiagnostic(resourceGroupName: string, networkWatcherName: string, parameters: models.NetworkConfigurationDiagnosticParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginQueryConnectionMonitorsWithHttpOperationResponse(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QueryConnectionMonitorsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginQueryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginQueryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, callback: ServiceCallback): void; + beginQueryConnectionMonitors(resourceGroupName: string, networkWatcherName: string, parameters: models.QueryConnectionMonitorsParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + queryConnectionMonitorsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QueryConnectionMonitorsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + queryConnectionMonitorsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + queryConnectionMonitorsNext(nextPageLink: string, callback: ServiceCallback): void; + queryConnectionMonitorsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginQueryConnectionMonitorsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {QueryConnectionMonitorsResponse} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginQueryConnectionMonitorsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginQueryConnectionMonitorsNext(nextPageLink: string, callback: ServiceCallback): void; + beginQueryConnectionMonitorsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** diff --git a/lib/services/networkManagement2/lib/operations/networkWatchers.js b/lib/services/networkManagement2/lib/operations/networkWatchers.js index c744d25aae..268e14327c 100644 --- a/lib/services/networkManagement2/lib/operations/networkWatchers.js +++ b/lib/services/networkManagement2/lib/operations/networkWatchers.js @@ -146,12 +146,13 @@ function _createOrUpdate(resourceGroupName, networkWatcherName, parameters, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -306,12 +307,13 @@ function _get(resourceGroupName, networkWatcherName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -534,12 +536,13 @@ function _updateTags(resourceGroupName, networkWatcherName, parameters, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -672,12 +675,13 @@ function _list(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -804,12 +808,13 @@ function _listAll(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -978,12 +983,13 @@ function _getTopology(resourceGroupName, networkWatcherName, parameters, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2002,6 +2008,179 @@ function _listAvailableProviders(resourceGroupName, networkWatcherName, paramete }); } + +/** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkConfigurationDiagnosticResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _queryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + /** * Deletes the specified network watcher resource. * @@ -2104,12 +2283,13 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2279,12 +2459,13 @@ function _beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2470,12 +2651,13 @@ function _beginGetNextHop(resourceGroupName, networkWatcherName, parameters, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2653,12 +2835,13 @@ function _beginGetVMSecurityRules(resourceGroupName, networkWatcherName, paramet try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2842,12 +3025,13 @@ function _beginGetTroubleshooting(resourceGroupName, networkWatcherName, paramet try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3025,12 +3209,13 @@ function _beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, p try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3244,12 +3429,13 @@ function _beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, pa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3429,12 +3615,13 @@ function _beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameter try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3649,12 +3836,13 @@ function _beginCheckConnectivity(resourceGroupName, networkWatcherName, paramete try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3852,12 +4040,13 @@ function _beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4044,12 +4233,13 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4101,62 +4291,1109 @@ function _beginListAvailableProviders(resourceGroupName, networkWatcherName, par }); } -/** Class representing a NetworkWatchers. */ -class NetworkWatchers { - /** - * Create a NetworkWatchers. - * @param {NetworkManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._createOrUpdate = _createOrUpdate; - this._get = _get; - this._deleteMethod = _deleteMethod; - this._updateTags = _updateTags; - this._list = _list; - this._listAll = _listAll; - this._getTopology = _getTopology; - this._verifyIPFlow = _verifyIPFlow; - this._getNextHop = _getNextHop; - this._getVMSecurityRules = _getVMSecurityRules; - this._getTroubleshooting = _getTroubleshooting; - this._getTroubleshootingResult = _getTroubleshootingResult; - this._setFlowLogConfiguration = _setFlowLogConfiguration; - this._getFlowLogStatus = _getFlowLogStatus; - this._checkConnectivity = _checkConnectivity; - this._getAzureReachabilityReport = _getAzureReachabilityReport; - this._listAvailableProviders = _listAvailableProviders; - this._beginDeleteMethod = _beginDeleteMethod; - this._beginVerifyIPFlow = _beginVerifyIPFlow; - this._beginGetNextHop = _beginGetNextHop; - this._beginGetVMSecurityRules = _beginGetVMSecurityRules; - this._beginGetTroubleshooting = _beginGetTroubleshooting; - this._beginGetTroubleshootingResult = _beginGetTroubleshootingResult; - this._beginSetFlowLogConfiguration = _beginSetFlowLogConfiguration; - this._beginGetFlowLogStatus = _beginGetFlowLogStatus; - this._beginCheckConnectivity = _beginCheckConnectivity; - this._beginGetAzureReachabilityReport = _beginGetAzureReachabilityReport; - this._beginListAvailableProviders = _beginListAvailableProviders; +/** + * Get network configuration diagnostic. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); } - /** - * Creates or updates a network watcher in the specified resource group. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the network watcher - * resource. - * - * @param {string} [parameters.etag] A unique read-only string that changes + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/networkConfigurationDiagnostic'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['NetworkConfigurationDiagnosticParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkConfigurationDiagnosticResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkConfigurationDiagnosticResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Query connection monitors. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2018-06-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (networkWatcherName === null || networkWatcherName === undefined || typeof networkWatcherName.valueOf() !== 'string') { + throw new Error('networkWatcherName cannot be null or undefined and it must be of type string.'); + } + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/networkWatchers/{networkWatcherName}/queryConnectionMonitors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{networkWatcherName}', encodeURIComponent(networkWatcherName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['QueryConnectionMonitorsParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _queryConnectionMonitorsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginQueryConnectionMonitorsNext(nextPageLink, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * Query connection monitors. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link QueryConnectionMonitorsResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginQueryConnectionMonitorsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['QueryConnectionMonitorsResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a NetworkWatchers. */ +class NetworkWatchers { + /** + * Create a NetworkWatchers. + * @param {NetworkManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._createOrUpdate = _createOrUpdate; + this._get = _get; + this._deleteMethod = _deleteMethod; + this._updateTags = _updateTags; + this._list = _list; + this._listAll = _listAll; + this._getTopology = _getTopology; + this._verifyIPFlow = _verifyIPFlow; + this._getNextHop = _getNextHop; + this._getVMSecurityRules = _getVMSecurityRules; + this._getTroubleshooting = _getTroubleshooting; + this._getTroubleshootingResult = _getTroubleshootingResult; + this._setFlowLogConfiguration = _setFlowLogConfiguration; + this._getFlowLogStatus = _getFlowLogStatus; + this._checkConnectivity = _checkConnectivity; + this._getAzureReachabilityReport = _getAzureReachabilityReport; + this._listAvailableProviders = _listAvailableProviders; + this._getNetworkConfigurationDiagnostic = _getNetworkConfigurationDiagnostic; + this._queryConnectionMonitors = _queryConnectionMonitors; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginVerifyIPFlow = _beginVerifyIPFlow; + this._beginGetNextHop = _beginGetNextHop; + this._beginGetVMSecurityRules = _beginGetVMSecurityRules; + this._beginGetTroubleshooting = _beginGetTroubleshooting; + this._beginGetTroubleshootingResult = _beginGetTroubleshootingResult; + this._beginSetFlowLogConfiguration = _beginSetFlowLogConfiguration; + this._beginGetFlowLogStatus = _beginGetFlowLogStatus; + this._beginCheckConnectivity = _beginCheckConnectivity; + this._beginGetAzureReachabilityReport = _beginGetAzureReachabilityReport; + this._beginListAvailableProviders = _beginListAvailableProviders; + this._beginGetNetworkConfigurationDiagnostic = _beginGetNetworkConfigurationDiagnostic; + this._beginQueryConnectionMonitors = _beginQueryConnectionMonitors; + this._queryConnectionMonitorsNext = _queryConnectionMonitorsNext; + this._beginQueryConnectionMonitorsNext = _beginQueryConnectionMonitorsNext; + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes + * whenever the resource is updated. + * + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Creates or updates a network watcher in the specified resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the network watcher + * resource. + * + * @param {string} [parameters.etag] A unique read-only string that changes * whenever the resource is updated. * - * @param {string} [parameters.id] Resource ID. + * @param {string} [parameters.id] Resource ID. + * + * @param {string} [parameters.location] Resource location. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkWatcher} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the specified network watcher by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkWatcher} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, networkWatcherName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Deletes the specified network watcher resource. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); + } + } + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateTagsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates a network watcher tags. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters supplied to update network watcher + * tags. + * + * @param {object} [parameters.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkWatcher} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcher} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets all network watchers by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. * - * @param {string} [parameters.location] Resource location. + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. * - * @param {object} [parameters.tags] Resource tags. + * {Promise} A promise is returned + * + * @resolve {NetworkWatcherListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(resourceGroupName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(resourceGroupName, options, optionalCallback); + } + } + + /** + * Gets all network watchers by subscription. * * @param {object} [options] Optional Parameters. * @@ -4165,15 +5402,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + listAllWithHttpOperationResponse(options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._listAll(options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4184,23 +5421,122 @@ class NetworkWatchers { } /** - * Creates or updates a network watcher in the specified resource group. + * Gets all network watchers by subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkWatcherListResult} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkWatcherListResult} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listAll(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listAll(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAll(options, optionalCallback); + } + } + + /** + * Gets the current network topology by resource group. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the network watcher + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet * resource. * - * @param {string} [parameters.etag] A unique read-only string that changes - * whenever the resource is updated. + * @param {string} [parameters.targetSubnet.id] Resource ID. * - * @param {string} [parameters.id] Resource ID. + * @param {object} [options] Optional Parameters. * - * @param {string} [parameters.location] Resource location. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [parameters.tags] Resource tags. + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getTopologyWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the current network topology by resource group. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the representation of + * topology. + * + * @param {string} [parameters.targetResourceGroupName] The name of the target + * resource group to perform topology on. + * + * @param {object} [parameters.targetVirtualNetwork] The reference of the + * Virtual Network resource. + * + * @param {object} [parameters.targetSubnet] The reference of the Subnet + * resource. + * + * @param {string} [parameters.targetSubnet.id] Resource ID. * * @param {object} [options] Optional Parameters. * @@ -4214,7 +5550,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {Topology} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4223,13 +5559,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * See {@link Topology} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4238,24 +5574,55 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._createOrUpdate(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the specified network watcher by resource group. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4263,30 +5630,61 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + verifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher. + * + * @param {object} parameters Parameters that define the IP flow to be + * verified. + * + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. + * + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' + * + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' + * + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. + * + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @reject {Error} - The error object. - */ - getWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * Gets the specified network watcher by resource group. + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -4300,7 +5698,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {VerificationIPFlowResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4309,13 +5707,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * See {@link VerificationIPFlowResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - get(resourceGroupName, networkWatcherName, options, optionalCallback) { + verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4324,24 +5723,38 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._get(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._get(resourceGroupName, networkWatcherName, options, optionalCallback); + return self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Deletes the specified network watcher resource. + * Gets the next hop from the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4349,15 +5762,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + getNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4368,12 +5781,26 @@ class NetworkWatchers { } /** - * Deletes the specified network watcher resource. + * Gets the next hop from the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * + * @param {object} parameters Parameters that define the source and destination + * endpoint. + * + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. + * + * @param {string} parameters.sourceIPAddress The source IP address. + * + * @param {string} parameters.destinationIPAddress The destination IP address. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4386,7 +5813,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {NextHopResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4394,13 +5821,14 @@ class NetworkWatchers { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NextHopResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback) { + getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4409,28 +5837,28 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._deleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._deleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); + return self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Updates a network watcher tags. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters supplied to update network watcher - * tags. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -4439,15 +5867,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateTagsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + getVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4458,16 +5886,16 @@ class NetworkWatchers { } /** - * Updates a network watcher tags. + * Gets the configured and effective security group rules on the specified VM. * * @param {string} resourceGroupName The name of the resource group. * * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters supplied to update network watcher - * tags. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {object} [parameters.tags] Resource tags. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -4481,7 +5909,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NetworkWatcher} - The deserialized result object. + * @resolve {SecurityGroupViewResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4490,13 +5918,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcher} for more information. + * See {@link SecurityGroupViewResult} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4505,22 +5934,36 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateTags(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateTags(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets all network watchers by resource group. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4528,15 +5971,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listWithHttpOperationResponse(resourceGroupName, options) { + getTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { + self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4547,10 +5990,24 @@ class NetworkWatchers { } /** - * Gets all network watchers by resource group. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. + * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4563,7 +6020,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4572,14 +6029,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} for more - * information. + * See {@link TroubleshootingResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - list(resourceGroupName, options, optionalCallback) { + getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4588,19 +6044,29 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(resourceGroupName, options, (err, result, request, response) => { + self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(resourceGroupName, options, optionalCallback); + return self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets all network watchers by subscription. + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -4609,15 +6075,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listAllWithHttpOperationResponse(options) { + getTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listAll(options, (err, result, request, response) => { + self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4628,7 +6094,17 @@ class NetworkWatchers { } /** - * Gets all network watchers by subscription. + * Get the last completed troubleshooting result on a specified resource + * + * @param {string} resourceGroupName The name of the resource group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. + * + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -4642,7 +6118,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NetworkWatcherListResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4651,14 +6127,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkWatcherListResult} for more - * information. + * See {@link TroubleshootingResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listAll(options, optionalCallback) { + getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4667,37 +6142,65 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listAll(options, (err, result, request, response) => { + self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listAll(options, optionalCallback); + return self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the current network topology by resource group. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the representation of - * topology. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. + * + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace * - * @param {string} [parameters.targetSubnet.id] Resource ID. + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -4706,15 +6209,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getTopologyWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4725,25 +6228,53 @@ class NetworkWatchers { } /** - * Gets the current network topology by resource group. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the representation of - * topology. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} [parameters.targetResourceGroupName] The name of the target - * resource group to perform topology on. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {object} [parameters.targetVirtualNetwork] The reference of the - * Virtual Network resource. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {object} [parameters.targetSubnet] The reference of the Subnet - * resource. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {string} [parameters.targetSubnet.id] Resource ID. + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -4757,7 +6288,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {Topology} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4766,13 +6297,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Topology} for more information. + * See {@link FlowLogInformation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4781,54 +6312,31 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getTopology(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getTopology(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -4837,15 +6345,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - verifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + getFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4856,42 +6364,19 @@ class NetworkWatchers { } /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. - * - * @param {string} resourceGroupName The name of the resource group. - * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -4905,7 +6390,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {VerificationIPFlowResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4914,14 +6399,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} for more - * information. + * See {@link FlowLogInformation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4930,37 +6414,65 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._verifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the next hop from the specified VM. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. + * @param {object} parameters.source * - * @param {string} parameters.sourceIPAddress The source IP address. + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -4969,15 +6481,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + checkConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -4988,25 +6500,53 @@ class NetworkWatchers { } /** - * Gets the next hop from the specified VM. + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. + * + * @param {string} resourceGroupName The name of the network watcher resource + * group. + * + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. + * @param {object} [parameters.protocolConfiguration] * - * @param {string} parameters.sourceIPAddress The source IP address. + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -5020,7 +6560,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NextHopResult} - The deserialized result object. + * @resolve {ConnectivityInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5029,13 +6569,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} for more information. + * See {@link ConnectivityInformation} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5044,28 +6585,48 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the configured and effective security group rules on the specified VM. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -5074,15 +6635,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5093,16 +6654,36 @@ class NetworkWatchers { } /** - * Gets the configured and effective security group rules on the specified VM. + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -5116,7 +6697,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {SecurityGroupViewResult} - The deserialized result object. + * @resolve {AzureReachabilityReport} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5125,14 +6706,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} for more + * See {@link AzureReachabilityReport} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5141,35 +6722,37 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Initiate troubleshooting on a specified resource + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {object} parameters Parameters that scope the list of available + * providers. * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {array} [parameters.azureLocations] A list of Azure regions. * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {string} [parameters.country] The country for available providers + * list. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -5178,15 +6761,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + listAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5197,23 +6780,25 @@ class NetworkWatchers { } /** - * Initiate troubleshooting on a specified resource + * Lists all available internet service providers for a specified Azure region. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {object} parameters Parameters that scope the list of available + * providers. * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {array} [parameters.azureLocations] A list of Azure regions. * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {string} [parameters.country] The country for available providers + * list. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -5227,7 +6812,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {AvailableProvidersList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5236,13 +6821,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * See {@link AvailableProvidersList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5251,29 +6837,32 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Get the last completed troubleshooting result on a specified resource + * Get network configuration diagnostic. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. * * @param {object} [options] Optional Parameters. * @@ -5282,15 +6871,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + getNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5301,17 +6890,20 @@ class NetworkWatchers { } /** - * Get the last completed troubleshooting result on a specified resource + * Get network configuration diagnostic. * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. * * @param {object} [options] Optional Parameters. * @@ -5325,7 +6917,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {NetworkConfigurationDiagnosticResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5333,81 +6925,46 @@ class NetworkWatchers { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); - } - } - - /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.flowAnalyticsConfiguration] + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + } + } + + /** + * Query connection monitors. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace + * @param {object} parameters Parameters to get network configuration + * diagnostic. + * + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. * * @param {object} [options] Optional Parameters. * @@ -5416,15 +6973,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - setFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + queryConnectionMonitorsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._queryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5435,53 +6992,17 @@ class NetworkWatchers { } /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * Query connection monitors. * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. * * @param {object} [options] Optional Parameters. * @@ -5495,7 +7016,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5504,13 +7025,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * See {@link QueryConnectionMonitorsResponse} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + queryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5519,31 +7041,23 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._queryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._setFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._queryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. + * Deletes the specified network watcher resource. * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. + * @param {string} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -5552,15 +7066,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5571,19 +7085,11 @@ class NetworkWatchers { } /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. + * Deletes the specified network watcher resource. * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. + * @param {string} networkWatcherName The name of the network watcher. * * @param {object} [options] Optional Parameters. * @@ -5597,7 +7103,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5605,14 +7111,13 @@ class NetworkWatchers { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5621,65 +7126,54 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); } } /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. + * @param {string} resourceGroupName The name of the resource group. * - * @param {object} parameters.destination + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {object} [parameters.protocolConfiguration] + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -5688,15 +7182,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - checkConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5707,53 +7201,42 @@ class NetworkWatchers { } /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. + * Verify IP flow from the specified VM to a location given the currently + * configured NSG rules. * - * @param {object} parameters.destination + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. + * @param {object} parameters Parameters that define the IP flow to be + * verified. * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform next-hop on. * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' + * @param {string} parameters.direction The direction of the packet represented + * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' * - * @param {object} [parameters.protocolConfiguration] + * @param {string} parameters.protocol Protocol to be verified on. Possible + * values include: 'TCP', 'UDP' * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * @param {string} parameters.localPort The local port. Acceptable values are a + * single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} parameters.remotePort The remote port. Acceptable values are + * a single integer in the range (0-65535). Support for * for the source port, + * which depends on the direction. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {string} parameters.localIPAddress The local IP address. Acceptable + * values are valid IPv4 addresses. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable + * values are valid IPv4 addresses. + * + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of them, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -5767,7 +7250,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {ConnectivityInformation} - The deserialized result object. + * @resolve {VerificationIPFlowResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5776,14 +7259,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} for more + * See {@link VerificationIPFlowResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5792,48 +7275,37 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._checkConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation + * Gets the next hop from the specified VM. * - * @param {string} parameters.providerLocation.country The name of the country. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.providerLocation.state] The name of the state. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. + * @param {object} parameters Parameters that define the source and destination + * endpoint. * - * @param {array} [parameters.providers] List of Internet service providers. + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} parameters.sourceIPAddress The source IP address. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} parameters.destinationIPAddress The destination IP address. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -5842,15 +7314,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5861,36 +7333,25 @@ class NetworkWatchers { } /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation + * Gets the next hop from the specified VM. * - * @param {string} parameters.providerLocation.country The name of the country. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.providerLocation.state] The name of the state. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. + * @param {object} parameters Parameters that define the source and destination + * endpoint. * - * @param {array} [parameters.providers] List of Internet service providers. + * @param {string} parameters.targetResourceId The resource identifier of the + * target resource against which the action is to be performed. * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. + * @param {string} parameters.sourceIPAddress The source IP address. * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. + * @param {string} parameters.destinationIPAddress The destination IP address. * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has + * multiple NICs and IP forwarding is enabled on any of the nics, then this + * parameter must be specified. Otherwise optional). * * @param {object} [options] Optional Parameters. * @@ -5904,7 +7365,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {AzureReachabilityReport} - The deserialized result object. + * @resolve {NextHopResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -5913,14 +7374,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} for more - * information. + * See {@link NextHopResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -5929,37 +7389,28 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. + * Gets the configured and effective security group rules on the specified VM. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -5968,15 +7419,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -5987,25 +7438,16 @@ class NetworkWatchers { } /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. + * Gets the configured and effective security group rules on the specified VM. * - * @param {array} [parameters.azureLocations] A list of Azure regions. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.country] The country for available providers - * list. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {string} [parameters.state] The state for available providers list. + * @param {object} parameters Parameters that define the VM to check security + * groups for. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} parameters.targetResourceId ID of the target VM. * * @param {object} [options] Optional Parameters. * @@ -6019,7 +7461,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {AvailableProvidersList} - The deserialized result object. + * @resolve {SecurityGroupViewResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6028,14 +7470,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} for more + * See {@link SecurityGroupViewResult} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6044,23 +7486,35 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Deletes the specified network watcher resource. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -6069,15 +7523,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginDeleteMethodWithHttpOperationResponse(resourceGroupName, networkWatcherName, options) { + beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6088,11 +7542,23 @@ class NetworkWatchers { } /** - * Deletes the specified network watcher resource. + * Initiate troubleshooting on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. + * + * @param {object} parameters Parameters that define the resource to + * troubleshoot. + * + * @param {string} parameters.targetResourceId The target resource to + * troubleshoot. + * + * @param {string} parameters.storageId The ID for the storage account to save + * the troubleshoot result. + * + * @param {string} parameters.storagePath The path to the blob to save the + * troubleshoot result in. * * @param {object} [options] Optional Parameters. * @@ -6106,7 +7572,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6114,13 +7580,14 @@ class NetworkWatchers { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link TroubleshootingResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback) { + beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6129,54 +7596,29 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, (err, result, request, response) => { + self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginDeleteMethod(resourceGroupName, networkWatcherName, options, optionalCallback); + return self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * Get the last completed troubleshooting result on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -6185,15 +7627,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginVerifyIPFlowWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6204,42 +7646,17 @@ class NetworkWatchers { } /** - * Verify IP flow from the specified VM to a location given the currently - * configured NSG rules. + * Get the last completed troubleshooting result on a specified resource * * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher. - * - * @param {object} parameters Parameters that define the IP flow to be - * verified. - * - * @param {string} parameters.targetResourceId The ID of the target resource to - * perform next-hop on. - * - * @param {string} parameters.direction The direction of the packet represented - * as a 5-tuple. Possible values include: 'Inbound', 'Outbound' - * - * @param {string} parameters.protocol Protocol to be verified on. Possible - * values include: 'TCP', 'UDP' - * - * @param {string} parameters.localPort The local port. Acceptable values are a - * single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.remotePort The remote port. Acceptable values are - * a single integer in the range (0-65535). Support for * for the source port, - * which depends on the direction. - * - * @param {string} parameters.localIPAddress The local IP address. Acceptable - * values are valid IPv4 addresses. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {string} parameters.remoteIPAddress The remote IP address. Acceptable - * values are valid IPv4 addresses. + * @param {object} parameters Parameters that define the resource to query the + * troubleshooting result. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of them, then this - * parameter must be specified. Otherwise optional). + * @param {string} parameters.targetResourceId The target resource ID to query + * the troubleshooting result. * * @param {object} [options] Optional Parameters. * @@ -6253,7 +7670,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {VerificationIPFlowResult} - The deserialized result object. + * @resolve {TroubleshootingResult} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6262,14 +7679,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VerificationIPFlowResult} for more - * information. + * See {@link TroubleshootingResult} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6278,37 +7694,65 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginVerifyIPFlow(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the next hop from the specified VM. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {string} parameters.sourceIPAddress The source IP address. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -6317,15 +7761,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetNextHopWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6336,25 +7780,53 @@ class NetworkWatchers { } /** - * Gets the next hop from the specified VM. + * Configures flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the source and destination - * endpoint. + * @param {object} parameters Parameters that define the configuration of flow + * log. * - * @param {string} parameters.targetResourceId The resource identifier of the - * target resource against which the action is to be performed. + * @param {string} parameters.targetResourceId The ID of the resource to + * configure for flow log and traffic analytics (optional) . * - * @param {string} parameters.sourceIPAddress The source IP address. + * @param {string} parameters.storageId ID of the storage account which is used + * to store the flow log. * - * @param {string} parameters.destinationIPAddress The destination IP address. + * @param {boolean} parameters.enabled Flag to enable/disable flow logging. * - * @param {string} [parameters.targetNicResourceId] The NIC ID. (If VM has - * multiple NICs and IP forwarding is enabled on any of the nics, then this - * parameter must be specified. Otherwise optional). + * @param {object} [parameters.retentionPolicy] + * + * @param {number} [parameters.retentionPolicy.days] Number of days to retain + * flow log records. + * + * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable + * retention. + * + * @param {object} [parameters.flowAnalyticsConfiguration] + * + * @param {object} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * + * @param {boolean} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled + * Flag to enable/disable traffic analytics. + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId + * The resource guid of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion + * The location of the attached workspace + * + * @param {string} + * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId + * Resource Id of the attached workspace * * @param {object} [options] Optional Parameters. * @@ -6368,7 +7840,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {NextHopResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6377,13 +7849,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NextHopResult} for more information. + * See {@link FlowLogInformation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6392,28 +7864,31 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetNextHop(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the configured and effective security group rules on the specified VM. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -6422,15 +7897,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetVMSecurityRulesWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6441,16 +7916,19 @@ class NetworkWatchers { } /** - * Gets the configured and effective security group rules on the specified VM. + * Queries status of flow log and traffic analytics (optional) on a specified + * resource. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * - * @param {string} networkWatcherName The name of the network watcher. + * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the VM to check security - * groups for. + * @param {object} parameters Parameters that define a resource to query flow + * log and traffic analytics (optional) status. * - * @param {string} parameters.targetResourceId ID of the target VM. + * @param {string} parameters.targetResourceId The target resource where + * getting the flow log and traffic analytics (optional) status. * * @param {object} [options] Optional Parameters. * @@ -6464,7 +7942,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {SecurityGroupViewResult} - The deserialized result object. + * @resolve {FlowLogInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6473,14 +7951,13 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SecurityGroupViewResult} for more - * information. + * See {@link FlowLogInformation} for more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6489,35 +7966,65 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetVMSecurityRules(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Initiate troubleshooting on a specified resource + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. + * + * @param {object} parameters.source + * + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. + * + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -6526,15 +8033,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetTroubleshootingWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginCheckConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6545,23 +8052,53 @@ class NetworkWatchers { } /** - * Initiate troubleshooting on a specified resource + * Verifies the possibility of establishing a direct TCP connection from a + * virtual machine to a given endpoint including another VM or an arbitrary + * remote server. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to - * troubleshoot. + * @param {object} parameters Parameters that determine how the connectivity + * check will be performed. * - * @param {string} parameters.targetResourceId The target resource to - * troubleshoot. + * @param {object} parameters.source * - * @param {string} parameters.storageId The ID for the storage account to save - * the troubleshoot result. + * @param {string} parameters.source.resourceId The ID of the resource from + * which a connectivity check will be initiated. * - * @param {string} parameters.storagePath The path to the blob to save the - * troubleshoot result in. + * @param {number} [parameters.source.port] The source port from which a + * connectivity check will be performed. + * + * @param {object} parameters.destination + * + * @param {string} [parameters.destination.resourceId] The ID of the resource + * to which a connection attempt will be made. + * + * @param {string} [parameters.destination.address] The IP address or URI the + * resource to which a connection attempt will be made. + * + * @param {number} [parameters.destination.port] Port on which check + * connectivity will be performed. + * + * @param {string} [parameters.protocol] Network protocol. Possible values + * include: 'Tcp', 'Http', 'Https', 'Icmp' + * + * @param {object} [parameters.protocolConfiguration] + * + * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * + * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] + * HTTP method. Possible values include: 'Get' + * + * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] + * List of HTTP headers. + * + * @param {array} + * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid + * status codes. * * @param {object} [options] Optional Parameters. * @@ -6575,7 +8112,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {ConnectivityInformation} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6584,13 +8121,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * See {@link ConnectivityInformation} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6599,29 +8137,48 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetTroubleshooting(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Get the last completed troubleshooting result on a specified resource + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -6630,15 +8187,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetTroubleshootingResultWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6649,17 +8206,36 @@ class NetworkWatchers { } /** - * Get the last completed troubleshooting result on a specified resource + * Gets the relative latency score for internet service providers from a + * specified location to Azure regions. * - * @param {string} resourceGroupName The name of the resource group. + * @param {string} resourceGroupName The name of the network watcher resource + * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the resource to query the - * troubleshooting result. + * @param {object} parameters Parameters that determine Azure reachability + * report configuration. * - * @param {string} parameters.targetResourceId The target resource ID to query - * the troubleshooting result. + * @param {object} parameters.providerLocation + * + * @param {string} parameters.providerLocation.country The name of the country. + * + * @param {string} [parameters.providerLocation.state] The name of the state. + * + * @param {string} [parameters.providerLocation.city] The name of the city or + * town. + * + * @param {array} [parameters.providers] List of Internet service providers. + * + * @param {array} [parameters.azureLocations] Optional Azure regions to scope + * the query to. + * + * @param {date} parameters.startTime The start time for the Azure reachability + * report. + * + * @param {date} parameters.endTime The end time for the Azure reachability + * report. * * @param {object} [options] Optional Parameters. * @@ -6673,7 +8249,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {TroubleshootingResult} - The deserialized result object. + * @resolve {AzureReachabilityReport} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6682,13 +8258,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link TroubleshootingResult} for more information. + * See {@link AzureReachabilityReport} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6697,65 +8274,37 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetTroubleshootingResult(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. + * Lists all available internet service providers for a specified Azure region. * * @param {string} resourceGroupName The name of the network watcher resource * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration + * @param {object} parameters Parameters that scope the list of available + * providers. * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. + * @param {array} [parameters.azureLocations] A list of Azure regions. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace + * @param {string} [parameters.country] The country for available providers + * list. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace + * @param {string} [parameters.state] The state for available providers list. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -6764,15 +8313,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginSetFlowLogConfigurationWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6783,53 +8332,25 @@ class NetworkWatchers { } /** - * Configures flow log and traffic analytics (optional) on a specified - * resource. + * Lists all available internet service providers for a specified Azure region. * * @param {string} resourceGroupName The name of the network watcher resource * group. * * @param {string} networkWatcherName The name of the network watcher resource. * - * @param {object} parameters Parameters that define the configuration of flow - * log. - * - * @param {string} parameters.targetResourceId The ID of the resource to - * configure for flow log and traffic analytics (optional) . - * - * @param {string} parameters.storageId ID of the storage account which is used - * to store the flow log. - * - * @param {boolean} parameters.enabled Flag to enable/disable flow logging. - * - * @param {object} [parameters.retentionPolicy] - * - * @param {number} [parameters.retentionPolicy.days] Number of days to retain - * flow log records. - * - * @param {boolean} [parameters.retentionPolicy.enabled] Flag to enable/disable - * retention. - * - * @param {object} [parameters.flowAnalyticsConfiguration] - * - * @param {object} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration - * - * @param {boolean} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.enabled - * Flag to enable/disable traffic analytics. + * @param {object} parameters Parameters that scope the list of available + * providers. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceId - * The resource guid of the attached workspace + * @param {array} [parameters.azureLocations] A list of Azure regions. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceRegion - * The location of the attached workspace + * @param {string} [parameters.country] The country for available providers + * list. * - * @param {string} - * parameters.flowAnalyticsConfiguration.networkWatcherFlowAnalyticsConfiguration.workspaceResourceId - * Resource Id of the attached workspace + * @param {string} [parameters.state] The state for available providers list. + * + * @param {string} [parameters.city] The city or town for available providers + * list. * * @param {object} [options] Optional Parameters. * @@ -6843,7 +8364,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {AvailableProvidersList} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6852,13 +8373,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * See {@link AvailableProvidersList} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6867,31 +8389,32 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginSetFlowLogConfiguration(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. + * Get network configuration diagnostic. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. * * @param {object} [options] Optional Parameters. * @@ -6900,15 +8423,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetFlowLogStatusWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginGetNetworkConfigurationDiagnosticWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -6919,19 +8442,20 @@ class NetworkWatchers { } /** - * Queries status of flow log and traffic analytics (optional) on a specified - * resource. + * Get network configuration diagnostic. * - * @param {string} resourceGroupName The name of the network watcher resource - * group. + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} networkWatcherName The name of the network watcher resource. + * @param {string} networkWatcherName The name of the network watcher. * - * @param {object} parameters Parameters that define a resource to query flow - * log and traffic analytics (optional) status. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {string} parameters.targetResourceId The target resource where - * getting the flow log and traffic analytics (optional) status. + * @param {string} parameters.targetResourceId The ID of the target resource to + * perform network configuration diagnostic. Valid options are VM, + * NetworkInterface, VMSS/NetworkInterface and Application Gateway. + * + * @param {array} parameters.queries List of traffic queries. * * @param {object} [options] Optional Parameters. * @@ -6945,7 +8469,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {FlowLogInformation} - The deserialized result object. + * @resolve {NetworkConfigurationDiagnosticResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -6954,13 +8478,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FlowLogInformation} for more information. + * See {@link NetworkConfigurationDiagnosticResponse} for + * more information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -6969,65 +8494,29 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetFlowLogStatus(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginGetNetworkConfigurationDiagnostic(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. + * Query connection monitors. * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] - * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} networkWatcherName The name of the network watcher. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. * * @param {object} [options] Optional Parameters. * @@ -7036,15 +8525,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginCheckConnectivityWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginQueryConnectionMonitorsWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7055,53 +8544,17 @@ class NetworkWatchers { } /** - * Verifies the possibility of establishing a direct TCP connection from a - * virtual machine to a given endpoint including another VM or an arbitrary - * remote server. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine how the connectivity - * check will be performed. - * - * @param {object} parameters.source - * - * @param {string} parameters.source.resourceId The ID of the resource from - * which a connectivity check will be initiated. - * - * @param {number} [parameters.source.port] The source port from which a - * connectivity check will be performed. - * - * @param {object} parameters.destination - * - * @param {string} [parameters.destination.resourceId] The ID of the resource - * to which a connection attempt will be made. - * - * @param {string} [parameters.destination.address] The IP address or URI the - * resource to which a connection attempt will be made. - * - * @param {number} [parameters.destination.port] Port on which check - * connectivity will be performed. - * - * @param {string} [parameters.protocol] Network protocol. Possible values - * include: 'Tcp', 'Http', 'Https', 'Icmp' - * - * @param {object} [parameters.protocolConfiguration] + * Query connection monitors. * - * @param {object} [parameters.protocolConfiguration.hTTPConfiguration] + * @param {string} resourceGroupName The name of the resource group. * - * @param {string} [parameters.protocolConfiguration.hTTPConfiguration.method] - * HTTP method. Possible values include: 'Get' + * @param {string} networkWatcherName The name of the network watcher. * - * @param {array} [parameters.protocolConfiguration.hTTPConfiguration.headers] - * List of HTTP headers. + * @param {object} parameters Parameters to get network configuration + * diagnostic. * - * @param {array} - * [parameters.protocolConfiguration.hTTPConfiguration.validStatusCodes] Valid - * status codes. + * @param {array} [parameters.connectionMonitorIds] List of connection monitors + * ID. * * @param {object} [options] Optional Parameters. * @@ -7115,7 +8568,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {ConnectivityInformation} - The deserialized result object. + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7124,14 +8577,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ConnectivityInformation} for more + * See {@link QueryConnectionMonitorsResponse} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7140,48 +8593,22 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginCheckConnectivity(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginQueryConnectionMonitors(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); } } /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. + * Query connection monitors. * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7190,15 +8617,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginGetAzureReachabilityReportWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + queryConnectionMonitorsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._queryConnectionMonitorsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7209,36 +8636,10 @@ class NetworkWatchers { } /** - * Gets the relative latency score for internet service providers from a - * specified location to Azure regions. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that determine Azure reachability - * report configuration. - * - * @param {object} parameters.providerLocation - * - * @param {string} parameters.providerLocation.country The name of the country. + * Query connection monitors. * - * @param {string} [parameters.providerLocation.state] The name of the state. - * - * @param {string} [parameters.providerLocation.city] The name of the city or - * town. - * - * @param {array} [parameters.providers] List of Internet service providers. - * - * @param {array} [parameters.azureLocations] Optional Azure regions to scope - * the query to. - * - * @param {date} parameters.startTime The start time for the Azure reachability - * report. - * - * @param {date} parameters.endTime The end time for the Azure reachability - * report. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7252,7 +8653,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {AzureReachabilityReport} - The deserialized result object. + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7261,14 +8662,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AzureReachabilityReport} for more + * See {@link QueryConnectionMonitorsResponse} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + queryConnectionMonitorsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7277,37 +8678,22 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._queryConnectionMonitorsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginGetAzureReachabilityReport(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._queryConnectionMonitorsNext(nextPageLink, options, optionalCallback); } } /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. + * Query connection monitors. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7316,15 +8702,15 @@ class NetworkWatchers { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginListAvailableProvidersWithHttpOperationResponse(resourceGroupName, networkWatcherName, parameters, options) { + beginQueryConnectionMonitorsNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginQueryConnectionMonitorsNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -7335,25 +8721,10 @@ class NetworkWatchers { } /** - * Lists all available internet service providers for a specified Azure region. - * - * @param {string} resourceGroupName The name of the network watcher resource - * group. - * - * @param {string} networkWatcherName The name of the network watcher resource. - * - * @param {object} parameters Parameters that scope the list of available - * providers. - * - * @param {array} [parameters.azureLocations] A list of Azure regions. - * - * @param {string} [parameters.country] The country for available providers - * list. - * - * @param {string} [parameters.state] The state for available providers list. + * Query connection monitors. * - * @param {string} [parameters.city] The city or town for available providers - * list. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -7367,7 +8738,7 @@ class NetworkWatchers { * * {Promise} A promise is returned * - * @resolve {AvailableProvidersList} - The deserialized result object. + * @resolve {QueryConnectionMonitorsResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -7376,14 +8747,14 @@ class NetworkWatchers { * {Error} err - The Error object if an error occurred, null otherwise. * * {object} [result] - The deserialized result object if an error did not occur. - * See {@link AvailableProvidersList} for more + * See {@link QueryConnectionMonitorsResponse} for more * information. * * {object} [request] - The HTTP Request object if an error did not occur. * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback) { + beginQueryConnectionMonitorsNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -7392,14 +8763,14 @@ class NetworkWatchers { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, (err, result, request, response) => { + self._beginQueryConnectionMonitorsNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginListAvailableProviders(resourceGroupName, networkWatcherName, parameters, options, optionalCallback); + return self._beginQueryConnectionMonitorsNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/networkManagement2/lib/operations/packetCaptures.js b/lib/services/networkManagement2/lib/operations/packetCaptures.js index 089c5b1985..eb78788596 100644 --- a/lib/services/networkManagement2/lib/operations/packetCaptures.js +++ b/lib/services/networkManagement2/lib/operations/packetCaptures.js @@ -235,12 +235,13 @@ function _get(resourceGroupName, networkWatcherName, packetCaptureName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -591,12 +592,13 @@ function _list(resourceGroupName, networkWatcherName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -789,12 +791,13 @@ function _beginCreate(resourceGroupName, networkWatcherName, packetCaptureName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -937,12 +940,13 @@ function _beginDeleteMethod(resourceGroupName, networkWatcherName, packetCapture try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1068,12 +1072,13 @@ function _beginStop(resourceGroupName, networkWatcherName, packetCaptureName, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1202,12 +1207,13 @@ function _beginGetStatus(resourceGroupName, networkWatcherName, packetCaptureNam try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['ErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) {