Skip to content

Commit

Permalink
[ANM] Remove $ from $Skiptoken and restructure Hub and NetworkGroups (#…
Browse files Browse the repository at this point in the history
…15840)

* Add ResourceGuid to NetworkManager

* add list by config

* Revert "Add ResourceGuid to NetworkManager"

This reverts commit 4e07577.

* resourceGuid

* [NetworkManager] Remove discriminator from ActiveConfiguration

* revert change

* fix format

* Fix as commnets

* fix test

* Update Example

* Split current APIs

* Fix lintdiff

* fix as commnets

* small change and update default package id

* remove subnet level api

* remove $ fro $skiptoken

* Change hub and groupids

* fix bug

* fix prettier

* Fix as comments

* Fix type
  • Loading branch information
yanfa317 authored Sep 1, 2021
1 parent ef04da1 commit 7814e86
Show file tree
Hide file tree
Showing 32 changed files with 134 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"regions": [
"westus"
],
"$skipToken": "fakeSkipTokenCode"
"skipToken": "fakeSkipTokenCode"
}
},
"responses": {
Expand All @@ -24,7 +24,12 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"hubs": [
{
"resourceId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"isGlobal": "True",
"deleteExistingPeering": "True",
"appliesToGroups": [
Expand All @@ -43,10 +48,10 @@
"properties": {
"displayName": "My Network Group",
"description": "A group for all test Virtual Networks",
"memberType": "VirtualNetwork",
"memberType": "Microsoft.Network/virtualNetworks",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
}
],
"conditionalMembership": "",
Expand All @@ -56,7 +61,7 @@
]
}
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"regions": [
"westus"
],
"$skipToken": "fakeSkipTokenCode"
"skipToken": "fakeSkipTokenCode"
}
},
"responses": {
Expand Down Expand Up @@ -64,10 +64,10 @@
"properties": {
"displayName": "My Network Group",
"description": "A group for all test Virtual Networks",
"memberType": "VirtualNetwork",
"memberType": "Microsoft.Network/virtualNetworks",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
}
],
"conditionalMembership": "",
Expand All @@ -77,7 +77,7 @@
]
}
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"regions": [
"westus"
],
"$skipToken": "fakeSkipTokenCode"
"skipToken": "fakeSkipTokenCode"
}
},
"responses": {
Expand Down Expand Up @@ -61,10 +61,10 @@
"properties": {
"displayName": "My Network Group",
"description": "A group for all test Virtual Networks",
"memberType": "VirtualNetwork",
"memberType": "Microsoft.Network/virtualNetworks",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
}
],
"conditionalMembership": "",
Expand All @@ -74,7 +74,7 @@
]
}
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"body": {
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection",
"name": "testRuleCollection",
"type": "Microsoft.Network/networkManagers/securityAdminConfigurations/RuleCollections",
"type": "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef5",
"createdByType": "User",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityAdminConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection",
"name": "testRuleCollection",
"type": "Microsoft.Network/networkManagers/securityAdminConfigurations/RuleCollections",
"type": "Microsoft.Network/networkManagers/securityAdminConfigurations/ruleCollections",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef5",
"createdByType": "User",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"body": {
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManager/testNetworkManager/securityConfigurations/myTestSecurityConfig",
"name": "myTestSecurityConfig",
"type": "Microsoft.Network/networkManagers/securityConfigurations",
"type": "Microsoft.Network/networkManagers/securityAdminConfigurations",
"systemData": {
"createdBy": "b69a9388-9488-4534-b470-7ec6d41beef5",
"createdByType": "User",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"hubs": [
{
"resourceId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"isGlobal": "True",
"deleteExistingPeering": "True",
"appliesToGroups": [
{
"networkGroupId": "/subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1",
"networkGroupId": "/subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1",
"useHubGateway": "True",
"groupConnectivity": "None",
"isGlobal": "False"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,17 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "subscriptions/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"hubs": [
{
"resourceId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"deleteExistingPeering": "True",
"isGlobal": "True",
"appliesToGroups": [
{
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/groups/group1",
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/netwrokGroups/group1",
"useHubGateway": "True",
"groupConnectivity": "None",
"isGlobal": "False"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"hubs": [
{
"resourceId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"deleteExistingPeering": "True",
"isGlobal": "True",
"appliesToGroups": [
{
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkManagerGroups/group1",
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1",
"useHubGateway": "True",
"groupConnectivity": "None",
"isGlobal": "False"
Expand All @@ -43,7 +48,12 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Connectivity Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"hubs": [
{
"resourceId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"deleteExistingPeering": "True",
"isGlobal": "True",
"appliesToGroups": [
Expand Down Expand Up @@ -75,12 +85,17 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"hubs": [
{
"resourceId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myTestConnectivityConfig",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"deleteExistingPeering": "True",
"isGlobal": "True",
"appliesToGroups": [
{
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkManagerGroups/group1",
"networkGroupId": "subscriptions/subscriptionA/resourceGroups/myResourceGroup/providers/Microsoft.Network/networkManagers/testNetworkManager/networkGroups/group1",
"useHubGateway": "True",
"groupConnectivity": "None",
"isGlobal": "False"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"200": {
"body": {
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/SecurityUserConfigurations/Policy1/ruleCollections/testRuleCollection/rules/SampleUserRule",
"type": "Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules",
"type": "Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections/rules",
"name": "SampleDefaultUserRule",
"kind": "Default",
"systemData": {
Expand Down Expand Up @@ -59,7 +59,7 @@
"201": {
"body": {
"id": "/subscriptions/subId/resourceGroups/rg1/providers/Microsoft.Network/networkManagers/testNetworkManager/securityUserConfigurations/myTestSecurityConfig/ruleCollections/testRuleCollection/rules/SampleDefaultUserRule",
"type": "Microsoft.Network/networkManagers/SecurityUserConfigurations/ruleCollections/rules",
"type": "Microsoft.Network/networkManagers/securityUserConfigurations/ruleCollections/rules",
"name": "SampleDefaultUserRule",
"kind": "Default",
"systemData": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"Connectivity",
"AdminPolicy"
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
},
"responses": {
Expand Down Expand Up @@ -44,7 +44,7 @@
"errorMessage": ""
}
],
"$skipToken": "NextFakeSkipTokenCode"
"skipToken": "NextFakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"resourceGroupName": "myResourceGroup",
"virtualNetworkName": "testVirtualNetwork",
"parameters": {
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
},
"responses": {
Expand All @@ -19,7 +19,12 @@
"displayName": "myTestConnectivityConfig",
"description": "Sample Configuration",
"connectivityTopology": "HubAndSpoke",
"hubId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"hubs": [
{
"resourceId": "/subscriptionB/resourceGroups/myResourceGroup/providers/Microsoft.Network/virtualNetworks/myHubVnet",
"resourceType": "Microsoft.Network/virtualNetworks"
}
],
"isGlobal": "True",
"deleteExistingPeering": "True",
"appliesToGroups": [
Expand All @@ -38,10 +43,10 @@
"properties": {
"displayName": "My Network Group",
"description": "A group for all test Virtual Networks",
"memberType": "VirtualNetwork",
"memberType": "Microsoft.Network/virtualNetworks",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
}
],
"conditionalMembership": "",
Expand All @@ -51,7 +56,7 @@
]
}
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"resourceGroupName": "myResourceGroup",
"virtualNetworkName": "testVirtualNetwork",
"parameters": {
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
},
"responses": {
Expand Down Expand Up @@ -62,7 +62,7 @@
"memberType": "VirtualNetwork",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetwork/vnet1"
}
],
"conditionalMembership": "",
Expand All @@ -72,7 +72,7 @@
]
}
],
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"networkManagerName": "testNetworkManager",
"networkGroupName": "TestNetworkGroup",
"parameters": {
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
},
"responses": {
Expand All @@ -20,7 +20,7 @@
"membershipType": "Static"
}
],
"$skipToken": "NextFakeSkipTokenCode"
"skipToken": "NextFakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"networkManagerName": "testNetworkManager",
"parameters": {
"conditionalMembers": "location='useast2'",
"$skipToken": "FakeSkipTokenCode"
"skipToken": "FakeSkipTokenCode"
}
},
"responses": {
Expand All @@ -20,7 +20,7 @@
"membershipType": "Static"
}
],
"$skipToken": "NextFakeSkipTokenCode"
"skipToken": "NextFakeSkipTokenCode"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"memberType": "VirtualNetwork",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1",
"subnetId": ""
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"
}
],
"conditionalMembership": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"memberType": "VirtualNetwork",
"groupMembers": [
{
"vnetId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"
"resourceId": "/subscriptions/subscriptionC/resourceGroup/rg1/providers/Microsoft.Network/virtualnetworks/vnet1"
}
],
"conditionalMembership": "",
Expand Down
Loading

0 comments on commit 7814e86

Please sign in to comment.