Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR network/resource-manager] Updated NetworkConfigurationDiagnostic API + example #3601

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class EvaluatedNetworkSecurityGroup {
/**
* Create a EvaluatedNetworkSecurityGroup.
* @member {string} [networkSecurityGroupId] Network security group ID.
* @member {string} [appliedTo] Resource ID of nic or subnet to which network
* security group is applied.
* @member {object} [matchedRule]
* @member {string} [matchedRule.ruleName] Name of the matched network
* security rule.
Expand Down Expand Up @@ -50,6 +52,13 @@ class EvaluatedNetworkSecurityGroup {
name: 'String'
}
},
appliedTo: {
required: false,
serializedName: 'appliedTo',
type: {
name: 'String'
}
},
matchedRule: {
required: false,
serializedName: 'matchedRule',
Expand Down
39 changes: 23 additions & 16 deletions lib/services/networkManagement2/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7776,7 +7776,7 @@ export interface ConnectionMonitorQueryResult {

/**
* @class
* Initializes a new instance of the TrafficQuery class.
* Initializes a new instance of the NetworkConfigurationDiagnosticProfile class.
* @constructor
* Parameters to compare with network configuration.
*
Expand All @@ -7791,7 +7791,7 @@ export interface ConnectionMonitorQueryResult {
* @member {string} destinationPort Traffice destination port. Accepted values
* are '*', port (for example, 3389) and port range (for example, 80-100).
*/
export interface TrafficQuery {
export interface NetworkConfigurationDiagnosticProfile {
direction: string;
protocol: string;
source: string;
Expand All @@ -7808,11 +7808,15 @@ export interface TrafficQuery {
* @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.
* @member {string} [verbosityLevel] Verbosity level. Accepted values are
* 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum',
* 'Full'
* @member {array} profiles List of network configuration diagnostic profiles.
*/
export interface NetworkConfigurationDiagnosticParameters {
targetResourceId: string;
queries: TrafficQuery[];
verbosityLevel?: string;
profiles: NetworkConfigurationDiagnosticProfile[];
}

/**
Expand Down Expand Up @@ -7864,6 +7868,8 @@ export interface NetworkSecurityRulesEvaluationResult {
* Results of network security group evaluation.
*
* @member {string} [networkSecurityGroupId] Network security group ID.
* @member {string} [appliedTo] Resource ID of nic or subnet to which network
* security group is applied.
* @member {object} [matchedRule]
* @member {string} [matchedRule.ruleName] Name of the matched network security
* rule.
Expand All @@ -7874,6 +7880,7 @@ export interface NetworkSecurityRulesEvaluationResult {
*/
export interface EvaluatedNetworkSecurityGroup {
networkSecurityGroupId?: string;
appliedTo?: string;
matchedRule?: MatchedRule;
readonly rulesEvaluationResult?: NetworkSecurityRulesEvaluationResult[];
}
Expand Down Expand Up @@ -7902,17 +7909,17 @@ export interface NetworkSecurityGroupResult {
* 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.
* @member {object} [profile]
* @member {string} [profile.direction] The direction of the traffic. Accepted
* values are 'Inbound' and 'Outbound'. Possible values include: 'Inbound',
* 'Outbound'
* @member {string} [profile.protocol] Protocol to be verified on. Accepted
* values are '*', TCP, UDP.
* @member {string} [profile.source] Traffic source. Accepted values are '*',
* IP Address/CIDR, Service Tag.
* @member {string} [profile.destination] Traffic destination. Accepted values
* are: '*', IP Address/CIDR, Service Tag.
* @member {string} [profile.destinationPort] Traffice destination port.
* Accepted values are '*', port (for example, 3389) and port range (for
* example, 80-100).
* @member {object} [networkSecurityGroupResult]
Expand All @@ -7923,7 +7930,7 @@ export interface NetworkSecurityGroupResult {
* List of results network security groups diagnostic.
*/
export interface NetworkConfigurationDiagnosticResult {
trafficQuery?: TrafficQuery;
profile?: NetworkConfigurationDiagnosticProfile;
networkSecurityGroupResult?: NetworkSecurityGroupResult;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/services/networkManagement2/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ exports.ConnectionMonitor = require('./connectionMonitor');
exports.ConnectionMonitorResult = require('./connectionMonitorResult');
exports.ConnectionStateSnapshot = require('./connectionStateSnapshot');
exports.ConnectionMonitorQueryResult = require('./connectionMonitorQueryResult');
exports.TrafficQuery = require('./trafficQuery');
exports.NetworkConfigurationDiagnosticProfile = require('./networkConfigurationDiagnosticProfile');
exports.NetworkConfigurationDiagnosticParameters = require('./networkConfigurationDiagnosticParameters');
exports.MatchedRule = require('./matchedRule');
exports.NetworkSecurityRulesEvaluationResult = require('./networkSecurityRulesEvaluationResult');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class 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.
* @member {string} [verbosityLevel] Verbosity level. Accepted values are
* 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal', 'Minimum',
* 'Full'
* @member {array} profiles List of network configuration diagnostic
* profiles.
*/
constructor() {
}
Expand All @@ -46,17 +50,24 @@ class NetworkConfigurationDiagnosticParameters {
name: 'String'
}
},
queries: {
verbosityLevel: {
required: false,
serializedName: 'verbosityLevel',
type: {
name: 'String'
}
},
profiles: {
required: true,
serializedName: 'queries',
serializedName: 'profiles',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'TrafficQueryElementType',
serializedName: 'NetworkConfigurationDiagnosticProfileElementType',
type: {
name: 'Composite',
className: 'TrafficQuery'
className: 'NetworkConfigurationDiagnosticProfile'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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 NetworkConfigurationDiagnosticProfile {
/**
* Create a NetworkConfigurationDiagnosticProfile.
* @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 NetworkConfigurationDiagnosticProfile
*
* @returns {object} metadata of NetworkConfigurationDiagnosticProfile
*
*/
mapper() {
return {
required: false,
serializedName: 'NetworkConfigurationDiagnosticProfile',
type: {
name: 'Composite',
className: 'NetworkConfigurationDiagnosticProfile',
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 = NetworkConfigurationDiagnosticProfile;
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@
class NetworkConfigurationDiagnosticResult {
/**
* Create a NetworkConfigurationDiagnosticResult.
* @member {object} [trafficQuery]
* @member {string} [trafficQuery.direction] The direction of the traffic.
* @member {object} [profile]
* @member {string} [profile.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
* @member {string} [profile.protocol] Protocol to be verified on. Accepted
* values are '*', TCP, UDP.
* @member {string} [profile.source] Traffic source. Accepted values are '*',
* IP Address/CIDR, Service Tag.
* @member {string} [profile.destination] Traffic destination. Accepted
* values are: '*', IP Address/CIDR, Service Tag.
* @member {string} [trafficQuery.destinationPort] Traffice destination port.
* @member {string} [profile.destinationPort] Traffice destination port.
* Accepted values are '*', port (for example, 3389) and port range (for
* example, 80-100).
* @member {object} [networkSecurityGroupResult]
Expand Down Expand Up @@ -56,12 +56,12 @@ class NetworkConfigurationDiagnosticResult {
name: 'Composite',
className: 'NetworkConfigurationDiagnosticResult',
modelProperties: {
trafficQuery: {
profile: {
required: false,
serializedName: 'trafficQuery',
serializedName: 'profile',
type: {
name: 'Composite',
className: 'TrafficQuery'
className: 'NetworkConfigurationDiagnosticProfile'
}
},
networkSecurityGroupResult: {
Expand Down
28 changes: 24 additions & 4 deletions lib/services/networkManagement2/lib/operations/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21799,7 +21799,12 @@ export interface NetworkWatchers {
* perform network configuration diagnostic. Valid options are VM,
* NetworkInterface, VMSS/NetworkInterface and Application Gateway.
*
* @param {array} parameters.queries List of traffic queries.
* @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values
* are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal',
* 'Minimum', 'Full'
*
* @param {array} parameters.profiles List of network configuration diagnostic
* profiles.
*
* @param {object} [options] Optional Parameters.
*
Expand Down Expand Up @@ -21828,7 +21833,12 @@ export interface NetworkWatchers {
* perform network configuration diagnostic. Valid options are VM,
* NetworkInterface, VMSS/NetworkInterface and Application Gateway.
*
* @param {array} parameters.queries List of traffic queries.
* @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values
* are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal',
* 'Minimum', 'Full'
*
* @param {array} parameters.profiles List of network configuration diagnostic
* profiles.
*
* @param {object} [options] Optional Parameters.
*
Expand Down Expand Up @@ -22928,7 +22938,12 @@ export interface NetworkWatchers {
* perform network configuration diagnostic. Valid options are VM,
* NetworkInterface, VMSS/NetworkInterface and Application Gateway.
*
* @param {array} parameters.queries List of traffic queries.
* @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values
* are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal',
* 'Minimum', 'Full'
*
* @param {array} parameters.profiles List of network configuration diagnostic
* profiles.
*
* @param {object} [options] Optional Parameters.
*
Expand Down Expand Up @@ -22957,7 +22972,12 @@ export interface NetworkWatchers {
* perform network configuration diagnostic. Valid options are VM,
* NetworkInterface, VMSS/NetworkInterface and Application Gateway.
*
* @param {array} parameters.queries List of traffic queries.
* @param {string} [parameters.verbosityLevel] Verbosity level. Accepted values
* are 'Normal', 'Minimum', 'Full'. Possible values include: 'Normal',
* 'Minimum', 'Full'
*
* @param {array} parameters.profiles List of network configuration diagnostic
* profiles.
*
* @param {object} [options] Optional Parameters.
*
Expand Down
Loading