From 0b42be6ea2978cdbb6fb8064a8fcb56fb85577a8 Mon Sep 17 00:00:00 2001 From: Hari Prasad Perabattula Date: Fri, 26 Mar 2021 12:29:33 +0530 Subject: [PATCH] Feature: Address space update in peered vNets (#13521) * Adding new fields and operation to support the address space update in peered vNets Adding new fields and operation to support the address space update in peered vNets * Adding the new query param in the example As per the review comment, adding the new query param in the example request response of swagger. * Adding the new query param in examples Adding the new query param in examples * Restricting the sync param Restricting the sync param to hold only true as value. We never need to send false. Co-authored-by: Hari Prasad Perabattula --- .../examples/VirtualNetworkPeeringCreate.json | 12 +++ .../examples/VirtualNetworkPeeringGet.json | 6 ++ .../examples/VirtualNetworkPeeringList.json | 12 +++ .../examples/VirtualNetworkPeeringSync.json | 87 +++++++++++++++++++ .../stable/2021-02-01/virtualNetwork.json | 37 +++++++- 5 files changed, 153 insertions(+), 1 deletion(-) create mode 100644 specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringSync.json diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringCreate.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringCreate.json index 2b770668af93..8268858612a0 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringCreate.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringCreate.json @@ -35,11 +35,17 @@ "12.0.0.0/8" ] }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, "remoteBgpCommunities": { "virtualNetworkCommunity": "12076:20002", "regionalCommunity": "12076:50004" }, "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", "provisioningState": "Succeeded" } } @@ -61,11 +67,17 @@ "12.0.0.0/8" ] }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, "remoteBgpCommunities": { "virtualNetworkCommunity": "12076:20002", "regionalCommunity": "12076:50004" }, "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", "provisioningState": "Succeeded" } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringGet.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringGet.json index b186a832de4e..7ac6c2cff159 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringGet.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringGet.json @@ -24,11 +24,17 @@ "12.0.0.0/8" ] }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, "remoteBgpCommunities": { "virtualNetworkCommunity": "12076:20002", "regionalCommunity": "12076:50004" }, "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", "provisioningState": "Succeeded" } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringList.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringList.json index 36c9d81f2df2..b23b2fc305b8 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringList.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringList.json @@ -25,11 +25,17 @@ "12.0.0.0/8" ] }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, "remoteBgpCommunities": { "virtualNetworkCommunity": "12076:20002", "regionalCommunity": "12076:50004" }, "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", "provisioningState": "Succeeded" } }, @@ -49,11 +55,17 @@ "13.0.0.0/8" ] }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "13.0.0.0/8" + ] + }, "remoteBgpCommunities": { "virtualNetworkCommunity": "12076:20003", "regionalCommunity": "12076:50004" }, "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", "provisioningState": "Succeeded" } } diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringSync.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringSync.json new file mode 100644 index 000000000000..1d908a7f9510 --- /dev/null +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/examples/VirtualNetworkPeeringSync.json @@ -0,0 +1,87 @@ +{ + "parameters": { + "virtualNetworkPeeringName": "peer", + "virtualNetworkName": "vnet1", + "resourceGroupName": "peerTest", + "syncRemoteAddressSpace": "true", + "api-version": "2021-02-01", + "subscriptionId": "subid", + "VirtualNetworkPeeringParameters": { + "properties": { + "allowVirtualNetworkAccess": true, + "allowForwardedTraffic": true, + "allowGatewayTransit": false, + "useRemoteGateways": false, + "remoteVirtualNetwork": { + "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2" + } + } + } + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer", + "name": "peer", + "properties": { + "allowVirtualNetworkAccess": true, + "allowForwardedTraffic": true, + "allowGatewayTransit": false, + "useRemoteGateways": false, + "remoteVirtualNetwork": { + "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2" + }, + "remoteAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, + "remoteBgpCommunities": { + "virtualNetworkCommunity": "12076:20002", + "regionalCommunity": "12076:50004" + }, + "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", + "provisioningState": "Succeeded" + } + } + }, + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet1/virtualNetworkPeerings/peer", + "name": "peer", + "properties": { + "allowVirtualNetworkAccess": true, + "allowForwardedTraffic": true, + "allowGatewayTransit": false, + "useRemoteGateways": false, + "remoteVirtualNetwork": { + "id": "/subscriptions/subid/resourceGroups/peerTest/providers/Microsoft.Network/virtualNetworks/vnet2" + }, + "remoteAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, + "remoteVirtualNetworkAddressSpace": { + "addressPrefixes": [ + "12.0.0.0/8" + ] + }, + "remoteBgpCommunities": { + "virtualNetworkCommunity": "12076:20002", + "regionalCommunity": "12076:50004" + }, + "peeringState": "Initiated", + "peeringSyncLevel": "FullyInSync", + "provisioningState": "Succeeded" + } + } + } + } +} diff --git a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/virtualNetwork.json b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/virtualNetwork.json index 8de69f2098bb..5cecc843076a 100644 --- a/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/virtualNetwork.json +++ b/specification/network/resource-manager/Microsoft.Network/stable/2021-02-01/virtualNetwork.json @@ -1038,6 +1038,20 @@ }, "description": "Parameters supplied to the create or update virtual network peering operation." }, + { + "name": "syncRemoteAddressSpace", + "in": "query", + "required": false, + "type": "string", + "enum": [ + "true" + ], + "x-ms-enum": { + "name": "SyncRemoteAddressSpace", + "modelAsString": true + }, + "description": "Parameter indicates the intention to sync the peering with the current address space on the remote vNet after it's updated." + }, { "$ref": "./network.json#/parameters/ApiVersionParameter" }, @@ -1068,6 +1082,9 @@ "x-ms-examples": { "Create peering": { "$ref": "./examples/VirtualNetworkPeeringCreate.json" + }, + "Sync Peering": { + "$ref": "./examples/VirtualNetworkPeeringSync.json" } }, "x-ms-long-running-operation": true, @@ -1568,7 +1585,11 @@ }, "remoteAddressSpace": { "$ref": "#/definitions/AddressSpace", - "description": "The reference to the remote virtual network address space." + "description": "The reference to the address space peered with the remote virtual network." + }, + "remoteVirtualNetworkAddressSpace": { + "$ref": "#/definitions/AddressSpace", + "description": "The reference to the current address space of the remote virtual network." }, "remoteBgpCommunities": { "$ref": "#/definitions/VirtualNetworkBgpCommunities", @@ -1588,6 +1609,20 @@ "modelAsString": true } }, + "peeringSyncLevel": { + "type": "string", + "description": "The peering sync status of the virtual network peering.", + "enum": [ + "FullyInSync", + "RemoteNotInSync", + "LocalNotInSync", + "LocalAndRemoteNotInSync" + ], + "x-ms-enum": { + "name": "VirtualNetworkPeeringLevel", + "modelAsString": true + } + }, "provisioningState": { "readOnly": true, "$ref": "./network.json#/definitions/ProvisioningState",