@@ -502,7 +502,7 @@ public VirtualNetworkGatewayContext GetGateway(string vnetName)
502
502
State = ( ProvisioningState ) Enum . Parse ( typeof ( ProvisioningState ) , response . State , true ) ,
503
503
VIPAddress = response . VipAddress ,
504
504
DefaultSite = ( response . DefaultSite != null ? response . DefaultSite . Name : null ) ,
505
- GatewaySKU = response . GatewaySKU ,
505
+ GatewaySKU = response . GatewaySKU ,
506
506
} ;
507
507
PopulateOperationContext ( response . RequestId , gatewayContext ) ;
508
508
@@ -1097,6 +1097,13 @@ public GetVirtualNetworkGatewayContext GetVirtualNetworkGateway(string gatewayId
1097
1097
SubnetId = response . SubnetId ,
1098
1098
EnableBgp = response . EnableBgp . ToString ( ) ,
1099
1099
} ;
1100
+
1101
+ if ( response . BgpSettings != null )
1102
+ {
1103
+ gatewayContext . Asn = response . BgpSettings . Asn ;
1104
+ gatewayContext . BgpPeeringAddress = response . BgpSettings . BgpPeeringAddress ;
1105
+ gatewayContext . PeerWeight = response . BgpSettings . PeerWeight ;
1106
+ }
1100
1107
PopulateOperationContext ( response . RequestId , gatewayContext ) ;
1101
1108
1102
1109
return gatewayContext ;
@@ -1123,6 +1130,7 @@ public GetVirtualNetworkGatewayConnectionContext GetVirtualNetworkGatewayConnect
1123
1130
GatewayConnectionType = response . GatewayConnectionType ,
1124
1131
RoutingWeight = response . RoutingWeight ,
1125
1132
SharedKey = response . SharedKey ,
1133
+ EnableBgp = response . EnableBgp . ToString ( ) ,
1126
1134
} ;
1127
1135
PopulateOperationContext ( response . RequestId , gatewayContext ) ;
1128
1136
@@ -1145,6 +1153,14 @@ public GetLocalNetworkGatewayContext GetLocalNetworkGateway(string gatewayId)
1145
1153
IpAddress = response . IpAddress ,
1146
1154
AddressSpace = response . AddressSpace . ToList ( ) ,
1147
1155
} ;
1156
+
1157
+ if ( response . BgpSettings != null )
1158
+ {
1159
+ gatewayContext . Asn = response . BgpSettings . Asn ;
1160
+ gatewayContext . BgpPeeringAddress = response . BgpSettings . BgpPeeringAddress ;
1161
+ gatewayContext . PeerWeight = response . BgpSettings . PeerWeight ;
1162
+ }
1163
+
1148
1164
PopulateOperationContext ( response . RequestId , gatewayContext ) ;
1149
1165
1150
1166
return gatewayContext ;
@@ -1164,6 +1180,7 @@ public IEnumerable<GetVirtualNetworkGatewayConnectionContext> ListVirtualNetwork
1164
1180
GatewayConnectionType = connection . GatewayConnectionType ,
1165
1181
RoutingWeight = connection . RoutingWeight ,
1166
1182
SharedKey = connection . SharedKey ,
1183
+ EnableBgp = connection . EnableBgp . ToString ( ) ,
1167
1184
} ;
1168
1185
} ) ;
1169
1186
PopulateOperationContext ( response . RequestId , connections ) ;
@@ -1195,6 +1212,9 @@ public IEnumerable<GetVirtualNetworkGatewayContext> ListVirtualNetworkGateways()
1195
1212
VnetId = virtualNetworkGateway . VnetId ,
1196
1213
SubnetId = virtualNetworkGateway . SubnetId ,
1197
1214
EnableBgp = virtualNetworkGateway . EnableBgp . ToString ( ) ,
1215
+ Asn = virtualNetworkGateway . BgpSettings != null ? virtualNetworkGateway . BgpSettings . Asn : 0 ,
1216
+ BgpPeeringAddress = virtualNetworkGateway . BgpSettings != null ? virtualNetworkGateway . BgpSettings . BgpPeeringAddress : "" ,
1217
+ PeerWeight = virtualNetworkGateway . BgpSettings != null ? virtualNetworkGateway . BgpSettings . PeerWeight : 0
1198
1218
} ;
1199
1219
} ) ;
1200
1220
PopulateOperationContext ( response . RequestId , virtualNetworkGateways ) ;
@@ -1215,6 +1235,9 @@ public IEnumerable<GetLocalNetworkGatewayContext> ListLocalNetworkGateways()
1215
1235
GatewayName = localNetworkGateway . GatewayName ,
1216
1236
IpAddress = localNetworkGateway . IpAddress ,
1217
1237
AddressSpace = localNetworkGateway . AddressSpace . ToList ( ) ,
1238
+ Asn = localNetworkGateway . BgpSettings . Asn ,
1239
+ BgpPeeringAddress = localNetworkGateway . BgpSettings . BgpPeeringAddress ,
1240
+ PeerWeight = localNetworkGateway . BgpSettings . PeerWeight ,
1218
1241
} ;
1219
1242
} ) ;
1220
1243
PopulateOperationContext ( response . RequestId , localNetworkGateways ) ;
@@ -1249,7 +1272,8 @@ public SharedKeyContext GetSharedKeyV2(string gatewayId, string connectedentityI
1249
1272
return sharedKeyContext ;
1250
1273
}
1251
1274
1252
- public GatewayGetOperationStatusResponse CreateVirtualNetworkGateway ( string vnetName , string gatewayName , string gatewayType , string gatewaySKU , string location , string vnetId )
1275
+ public GatewayGetOperationStatusResponse CreateVirtualNetworkGateway ( string vnetName , string gatewayName , string gatewayType , string gatewaySKU , string location , string vnetId ,
1276
+ uint Asn , int PeerWeight )
1253
1277
{
1254
1278
VirtualNetworkGatewayCreateParameters parameters = new VirtualNetworkGatewayCreateParameters ( )
1255
1279
{
@@ -1258,13 +1282,18 @@ public GatewayGetOperationStatusResponse CreateVirtualNetworkGateway(string vnet
1258
1282
GatewayType = gatewayType ,
1259
1283
Location = location ,
1260
1284
VnetId = vnetId ,
1285
+ BgpSettings = ( Asn > 0 || PeerWeight > 0 ) ? new BgpSettings {
1286
+ Asn = Asn ,
1287
+ BgpPeeringAddress = "" , // We don't allow changing the gateway's BgpPeeringAddress
1288
+ PeerWeight = PeerWeight
1289
+ } : null ,
1261
1290
} ;
1262
1291
1263
1292
return client . Gateways . CreateVirtualNetworkGateway ( vnetName , parameters ) ;
1264
1293
}
1265
1294
1266
1295
public GatewayGetOperationStatusResponse CreateVirtualNetworkGatewayConnection ( string connectedEntityId , string gatewayConnectionName , string gatewayConnectionType ,
1267
- int routingWeight , string sharedKey , Guid virtualNetworkGatewayId )
1296
+ int routingWeight , string sharedKey , Guid virtualNetworkGatewayId , bool EnableBgp )
1268
1297
{
1269
1298
GatewayConnectionCreateParameters parameters = new GatewayConnectionCreateParameters ( )
1270
1299
{
@@ -1273,19 +1302,26 @@ public GatewayGetOperationStatusResponse CreateVirtualNetworkGatewayConnection(s
1273
1302
GatewayConnectionType = gatewayConnectionType ,
1274
1303
VirtualNetworkGatewayId = virtualNetworkGatewayId ,
1275
1304
RoutingWeight = routingWeight ,
1276
- SharedKey = sharedKey ,
1305
+ SharedKey = sharedKey ,
1306
+ EnableBgp = EnableBgp ,
1277
1307
} ;
1278
1308
1279
1309
return client . Gateways . CreateGatewayConnection ( parameters ) ;
1280
1310
}
1281
1311
1282
- public LocalNetworkGatewayCreateResponse CreateLocalNetworkGateway ( string gatewayName , string ipAddress , List < string > addressSpace )
1312
+ public LocalNetworkGatewayCreateResponse CreateLocalNetworkGateway ( string gatewayName , string ipAddress , List < string > addressSpace ,
1313
+ uint Asn , string BgpPeeringAddress , int PeerWeight )
1283
1314
{
1284
1315
LocalNetworkGatewayCreateParameters parameters = new LocalNetworkGatewayCreateParameters ( )
1285
1316
{
1286
1317
AddressSpace = addressSpace ,
1287
1318
GatewayName = gatewayName ,
1288
1319
IpAddress = ipAddress ,
1320
+ BgpSettings = Asn > 0 ? new BgpSettings {
1321
+ Asn = Asn ,
1322
+ BgpPeeringAddress = BgpPeeringAddress ,
1323
+ PeerWeight = PeerWeight ,
1324
+ } : null ,
1289
1325
} ;
1290
1326
1291
1327
return client . Gateways . CreateLocalNetworkGateway ( parameters ) ;
@@ -1340,21 +1376,27 @@ public GatewayGetOperationStatusResponse ResizeVirtualNetworkGateway(string gate
1340
1376
return client . Gateways . ResizeVirtualNetworkGateway ( gatewayId , parameters ) ;
1341
1377
}
1342
1378
1343
- public GatewayGetOperationStatusResponse UpdateVirtualNetworkGatewayConnection ( string gatewayId , string connectedentityId , int routingWeight , string sharedKey )
1379
+ public GatewayGetOperationStatusResponse UpdateVirtualNetworkGatewayConnection ( string gatewayId , string connectedentityId , int routingWeight , string sharedKey , bool EnableBgp )
1344
1380
{
1345
1381
UpdateGatewayConnectionParameters parameters = new UpdateGatewayConnectionParameters ( )
1346
1382
{
1347
1383
RoutingWeight = routingWeight ,
1348
1384
SharedKey = sharedKey ,
1385
+ EnableBgp = EnableBgp ,
1349
1386
} ;
1350
1387
return client . Gateways . UpdateGatewayConnection ( gatewayId , connectedentityId , parameters ) ;
1351
1388
}
1352
1389
1353
- public AzureOperationResponse UpdateLocalNetworkGateway ( string gatewayId , List < string > addressSpace )
1390
+ public AzureOperationResponse UpdateLocalNetworkGateway ( string gatewayId , List < string > addressSpace , uint Asn , string BgpPeeringAddress , int PeerWeight )
1354
1391
{
1355
1392
UpdateLocalNetworkGatewayParameters parameters = new UpdateLocalNetworkGatewayParameters ( )
1356
1393
{
1357
1394
AddressSpace = addressSpace ,
1395
+ BgpSettings = ( Asn > 0 || PeerWeight > 0 || ! string . IsNullOrEmpty ( BgpPeeringAddress ) ) ? new BgpSettings {
1396
+ Asn = Asn ,
1397
+ BgpPeeringAddress = BgpPeeringAddress ,
1398
+ PeerWeight = PeerWeight ,
1399
+ } : null ,
1358
1400
} ;
1359
1401
1360
1402
return client . Gateways . UpdateLocalNetworkGateway ( gatewayId , parameters ) ;
0 commit comments