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

[AutoPR network/resource-manager] Add PUT and PATCH operations for HubVirtualNetworkConnections #4707

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 @@ -105,7 +105,7 @@ class ApplicationGateway extends models['Resource'] {
* application gateway resource.
* @property {object} [autoscaleConfiguration] Autoscale Configuration.
* @property {number} [autoscaleConfiguration.minCapacity] Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
* @property {number} [autoscaleConfiguration.maxCapacity] Upper bound on
* number of Application Gateway capacity
* @property {string} [resourceGuid] Resource GUID property of the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ApplicationGatewayAutoscaleConfiguration {
/**
* Create a ApplicationGatewayAutoscaleConfiguration.
* @property {number} minCapacity Lower bound on number of Application
* Gateway instances
* Gateway capacity
* @property {number} [maxCapacity] Upper bound on number of Application
* Gateway capacity
*/
Expand All @@ -43,7 +43,7 @@ class ApplicationGatewayAutoscaleConfiguration {
required: true,
serializedName: 'minCapacity',
constraints: {
InclusiveMinimum: 2
InclusiveMinimum: 0
},
type: {
name: 'Number'
Expand Down
2 changes: 1 addition & 1 deletion lib/services/networkManagement2/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2065,7 +2065,7 @@ export interface ApplicationGatewayWebApplicationFirewallConfiguration {
*/
export interface ApplicationGatewayAutoscaleConfiguration {
/**
* Lower bound on number of Application Gateway instances
* Lower bound on number of Application Gateway capacity
*/
minCapacity: number;
/**
Expand Down
26 changes: 17 additions & 9 deletions lib/services/networkManagement2/lib/networkManagementClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export default class NetworkManagementClient extends AzureServiceClient {
*
* @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
*
* @param {string} resourceGroupName - The resource group name of the Microsoft Azure resource.
*
* @param {string} virtualHubName - The name of the Virtual Hub resource.
*
* @param {string} connectionName - The name of the connection resource.
*
* @param {string} [baseUri] - The base URI of the service.
*
* @param {object} [options] - The parameter options
Expand All @@ -41,12 +47,18 @@ export default class NetworkManagementClient extends AzureServiceClient {
* @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*
*/
constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions);
constructor(credentials: ServiceClientCredentials, subscriptionId: string, resourceGroupName: string, virtualHubName: string, connectionName: string, baseUri?: string, options?: AzureServiceClientOptions);

credentials: ServiceClientCredentials;

subscriptionId: string;

resourceGroupName: string;

virtualHubName: string;

connectionName: string;

acceptLanguage: string;

longRunningOperationRetryTimeout: number;
Expand Down Expand Up @@ -191,8 +203,6 @@ export default class NetworkManagementClient extends AzureServiceClient {
/**
* Gives the supported security providers for the virtual wan.
*
* @param {string} resourceGroupName The resource group name.
*
* @param {string} virtualWANName The name of the VirtualWAN for which
* supported security providers are needed.
*
Expand All @@ -207,13 +217,11 @@ export default class NetworkManagementClient extends AzureServiceClient {
*
* @reject {Error|ServiceError} - The error object.
*/
supportedSecurityProvidersWithHttpOperationResponse(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.VirtualWanSecurityProviders>>;
supportedSecurityProvidersWithHttpOperationResponse(virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<HttpOperationResponse<models.VirtualWanSecurityProviders>>;

/**
* Gives the supported security providers for the virtual wan.
*
* @param {string} resourceGroupName The resource group name.
*
* @param {string} virtualWANName The name of the VirtualWAN for which
* supported security providers are needed.
*
Expand Down Expand Up @@ -245,9 +253,9 @@ export default class NetworkManagementClient extends AzureServiceClient {
*
* {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur.
*/
supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.VirtualWanSecurityProviders>;
supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, callback: ServiceCallback<models.VirtualWanSecurityProviders>): void;
supportedSecurityProviders(resourceGroupName: string, virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.VirtualWanSecurityProviders>): void;
supportedSecurityProviders(virtualWANName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise<models.VirtualWanSecurityProviders>;
supportedSecurityProviders(virtualWANName: string, callback: ServiceCallback<models.VirtualWanSecurityProviders>): void;
supportedSecurityProviders(virtualWANName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback<models.VirtualWanSecurityProviders>): void;
}

export { NetworkManagementClient, models as NetworkManagementModels };
41 changes: 25 additions & 16 deletions lib/services/networkManagement2/lib/networkManagementClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,8 +172,6 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback)
/**
* Gives the supported security providers for the virtual wan.
*
* @param {string} resourceGroupName The resource group name.
*
* @param {string} virtualWANName The name of the VirtualWAN for which
* supported security providers are needed.
*
Expand All @@ -196,7 +194,7 @@ function _checkDnsNameAvailability(location, domainNameLabel, options, callback)
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
function _supportedSecurityProviders(resourceGroupName, virtualWANName, options, callback) {
function _supportedSecurityProviders(virtualWANName, options, callback) {
/* jshint validthis: true */
let client = this;
if(!callback && typeof options === 'function') {
Expand All @@ -212,8 +210,8 @@ function _supportedSecurityProviders(resourceGroupName, virtualWANName, options,
if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') {
throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.');
}
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 (this.resourceGroupName === null || this.resourceGroupName === undefined || typeof this.resourceGroupName.valueOf() !== 'string') {
throw new Error('this.resourceGroupName cannot be null or undefined and it must be of type string.');
}
if (virtualWANName === null || virtualWANName === undefined || typeof virtualWANName.valueOf() !== 'string') {
throw new Error('virtualWANName cannot be null or undefined and it must be of type string.');
Expand All @@ -229,7 +227,7 @@ function _supportedSecurityProviders(resourceGroupName, virtualWANName, options,
let baseUrl = this.baseUri;
let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualWans/{virtualWANName}/supportedSecurityProviders';
requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName));
requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(this.resourceGroupName));
requestUrl = requestUrl.replace('{virtualWANName}', encodeURIComponent(virtualWANName));
let queryParameters = [];
queryParameters.push('api-version=' + encodeURIComponent(apiVersion));
Expand Down Expand Up @@ -321,6 +319,9 @@ class NetworkManagementClient extends ServiceClient {
* Create a NetworkManagementClient.
* @param {credentials} credentials - Credentials needed for the client to connect to Azure.
* @param {string} subscriptionId - The subscription credentials which uniquely identify the Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.
* @param {string} resourceGroupName - The resource group name of the Microsoft Azure resource.
* @param {string} virtualHubName - The name of the Virtual Hub resource.
* @param {string} connectionName - The name of the connection resource.
* @param {string} [baseUri] - The base URI of the service.
* @param {object} [options] - The parameter options
* @param {Array} [options.filters] - Filters to be added to the request pipeline
Expand All @@ -331,13 +332,22 @@ class NetworkManagementClient extends ServiceClient {
* @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30.
* @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true.
*/
constructor(credentials, subscriptionId, baseUri, options) {
constructor(credentials, subscriptionId, resourceGroupName, virtualHubName, connectionName, baseUri, options) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}
if (subscriptionId === null || subscriptionId === undefined) {
throw new Error('\'subscriptionId\' cannot be null.');
}
if (resourceGroupName === null || resourceGroupName === undefined) {
throw new Error('\'resourceGroupName\' cannot be null.');
}
if (virtualHubName === null || virtualHubName === undefined) {
throw new Error('\'virtualHubName\' cannot be null.');
}
if (connectionName === null || connectionName === undefined) {
throw new Error('\'connectionName\' cannot be null.');
}

if (!options) options = {};

Expand All @@ -352,6 +362,9 @@ class NetworkManagementClient extends ServiceClient {
}
this.credentials = credentials;
this.subscriptionId = subscriptionId;
this.resourceGroupName = resourceGroupName;
this.virtualHubName = virtualHubName;
this.connectionName = connectionName;

let packageInfo = this.getPackageJsonInfo(__dirname);
this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
Expand Down Expand Up @@ -532,8 +545,6 @@ class NetworkManagementClient extends ServiceClient {
/**
* Gives the supported security providers for the virtual wan.
*
* @param {string} resourceGroupName The resource group name.
*
* @param {string} virtualWANName The name of the VirtualWAN for which
* supported security providers are needed.
*
Expand All @@ -548,11 +559,11 @@ class NetworkManagementClient extends ServiceClient {
*
* @reject {Error} - The error object.
*/
supportedSecurityProvidersWithHttpOperationResponse(resourceGroupName, virtualWANName, options) {
supportedSecurityProvidersWithHttpOperationResponse(virtualWANName, options) {
let client = this;
let self = this;
return new Promise((resolve, reject) => {
self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, (err, result, request, response) => {
self._supportedSecurityProviders(virtualWANName, options, (err, result, request, response) => {
let httpOperationResponse = new msRest.HttpOperationResponse(request, response);
httpOperationResponse.body = result;
if (err) { reject(err); }
Expand All @@ -565,8 +576,6 @@ class NetworkManagementClient extends ServiceClient {
/**
* Gives the supported security providers for the virtual wan.
*
* @param {string} resourceGroupName The resource group name.
*
* @param {string} virtualWANName The name of the VirtualWAN for which
* supported security providers are needed.
*
Expand Down Expand Up @@ -598,7 +607,7 @@ class NetworkManagementClient extends ServiceClient {
*
* {stream} [response] - The HTTP Response stream if an error did not occur.
*/
supportedSecurityProviders(resourceGroupName, virtualWANName, options, optionalCallback) {
supportedSecurityProviders(virtualWANName, options, optionalCallback) {
let client = this;
let self = this;
if (!optionalCallback && typeof options === 'function') {
Expand All @@ -607,14 +616,14 @@ class NetworkManagementClient extends ServiceClient {
}
if (!optionalCallback) {
return new Promise((resolve, reject) => {
self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, (err, result, request, response) => {
self._supportedSecurityProviders(virtualWANName, options, (err, result, request, response) => {
if (err) { reject(err); }
else { resolve(result); }
return;
});
});
} else {
return self._supportedSecurityProviders(resourceGroupName, virtualWANName, options, optionalCallback);
return self._supportedSecurityProviders(virtualWANName, options, optionalCallback);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ function _get(resourceGroupName, applicationGatewayName, options, callback) {
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down Expand Up @@ -2256,7 +2256,7 @@ function _beginDeleteMethod(resourceGroupName, applicationGatewayName, options,
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down Expand Up @@ -3763,7 +3763,7 @@ class ApplicationGateways {
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down Expand Up @@ -3964,7 +3964,7 @@ class ApplicationGateways {
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down Expand Up @@ -5348,7 +5348,7 @@ class ApplicationGateways {
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down Expand Up @@ -5549,7 +5549,7 @@ class ApplicationGateways {
* @param {object} [parameters.autoscaleConfiguration] Autoscale Configuration.
*
* @param {number} parameters.autoscaleConfiguration.minCapacity Lower bound on
* number of Application Gateway instances
* number of Application Gateway capacity
*
* @param {number} [parameters.autoscaleConfiguration.maxCapacity] Upper bound
* on number of Application Gateway capacity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ function _get(resourceGroupName, circuitName, peeringName, connectionName, optio
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down Expand Up @@ -659,7 +659,7 @@ function _beginDeleteMethod(resourceGroupName, circuitName, peeringName, connect
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down Expand Up @@ -1222,7 +1222,7 @@ class ExpressRouteCircuitConnections {
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down Expand Up @@ -1289,7 +1289,7 @@ class ExpressRouteCircuitConnections {
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down Expand Up @@ -1569,7 +1569,7 @@ class ExpressRouteCircuitConnections {
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down Expand Up @@ -1636,7 +1636,7 @@ class ExpressRouteCircuitConnections {
* connection.
*
* @param {object} expressRouteCircuitConnectionParameters Parameters supplied
* to the create or update express route circuit circuit connection operation.
* to the create or update express route circuit connection operation.
*
* @param {object}
* [expressRouteCircuitConnectionParameters.expressRouteCircuitPeering]
Expand Down
Loading