Skip to content

Commit

Permalink
Feature: Address space update in peered vNets (#13521)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
harics24 and Hari Prasad Perabattula authored Mar 26, 2021
1 parent febc72a commit 0b42be6
Show file tree
Hide file tree
Showing 5 changed files with 153 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand All @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
},
Expand All @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 0b42be6

Please sign in to comment.