diff --git a/src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj b/src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj index 8e49e90440e9..b76cba7fc69e 100644 --- a/src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj +++ b/src/CosmosDB/CosmosDB.Test/CosmosDB.Test.csproj @@ -5,6 +5,6 @@ - + \ No newline at end of file diff --git a/src/CosmosDB/CosmosDB.Test/SessionRecords/Microsoft.Azure.Commands.CosmosDB.Test.ScenarioTests.ScenarioTest.AccountTests/TestPrivateEndpoint.json b/src/CosmosDB/CosmosDB.Test/SessionRecords/Microsoft.Azure.Commands.CosmosDB.Test.ScenarioTests.ScenarioTest.AccountTests/TestPrivateEndpoint.json index 28c82876b504..0cdf9d7abf0d 100644 --- a/src/CosmosDB/CosmosDB.Test/SessionRecords/Microsoft.Azure.Commands.CosmosDB.Test.ScenarioTests.ScenarioTest.AccountTests/TestPrivateEndpoint.json +++ b/src/CosmosDB/CosmosDB.Test/SessionRecords/Microsoft.Azure.Commands.CosmosDB.Test.ScenarioTests.ScenarioTest.AccountTests/TestPrivateEndpoint.json @@ -67,8 +67,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -127,8 +127,8 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -191,8 +191,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -261,8 +261,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ZpcnR1YWxOZXR3b3Jrcy92bmV0UEU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"11.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"peSubnet\"\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": false\r\n },\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { @@ -299,7 +299,7 @@ "5e0b1602-4445-4a87-901e-dac08f0c632d" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/5e0b1602-4445-4a87-901e-dac08f0c632d?api-version=2019-12-01" + "https://management.azure.com/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/5e0b1602-4445-4a87-901e-dac08f0c632d?api-version=2020-03-01" ], "x-ms-correlation-request-id": [ "b8419665-a4b1-48a4-b6ec-d484a3441a2b" @@ -343,8 +343,8 @@ "StatusCode": 201 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/5e0b1602-4445-4a87-901e-dac08f0c632d?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvNWUwYjE2MDItNDQ0NS00YTg3LTkwMWUtZGFjMDhmMGM2MzJkP2FwaS12ZXJzaW9uPTIwMTktMTItMDE=", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/5e0b1602-4445-4a87-901e-dac08f0c632d?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvNWUwYjE2MDItNDQ0NS00YTg3LTkwMWUtZGFjMDhmMGM2MzJkP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -404,8 +404,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -464,8 +464,8 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -528,8 +528,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -598,8 +598,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/privateEndpoints/mype?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Jlc291cmNlR3JvdXBzL0Nvc21vc0RCUmVzb3VyY2VHcm91cDk1MDcvcHJvdmlkZXJzL01pY3Jvc29mdC5OZXR3b3JrL3ByaXZhdGVFbmRwb2ludHMvbXlwZT9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"subnet\": {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"peSubnet\",\r\n \"id\": \"/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.Network/virtualNetworks/vnetPE/subnets/peSubnet\"\r\n },\r\n \"privateLinkServiceConnections\": [],\r\n \"manualPrivateLinkServiceConnections\": [\r\n {\r\n \"properties\": {\r\n \"privateLinkServiceId\": \"/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/resourceGroups/CosmosDBResourceGroup9507/providers/Microsoft.DocumentDB/databaseAccounts/db9934121\",\r\n \"groupIds\": [\r\n \"Sql\"\r\n ]\r\n },\r\n \"name\": \"plsConnection\"\r\n }\r\n ]\r\n },\r\n \"location\": \"East US\"\r\n}", "RequestHeaders": { @@ -636,7 +636,7 @@ "9c02754f-ffc3-487f-a72f-6c2d6cf8488c" ], "Azure-AsyncOperation": [ - "https://management.azure.com/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2019-12-01" + "https://management.azure.com/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2020-03-01" ], "x-ms-correlation-request-id": [ "803d1f74-d6a7-4d94-ad49-c252ee4b0872" @@ -680,8 +680,8 @@ "StatusCode": 201 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMTktMTItMDE=", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -744,8 +744,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMTktMTItMDE=", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -808,8 +808,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMTktMTItMDE=", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -872,8 +872,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMTktMTItMDE=", + "RequestUri": "/subscriptions/12053b8f-cab5-4f5c-9c1a-870580142abd/providers/Microsoft.Network/locations/eastus/operations/9c02754f-ffc3-487f-a72f-6c2d6cf8488c?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvMTIwNTNiOGYtY2FiNS00ZjVjLTljMWEtODcwNTgwMTQyYWJkL3Byb3ZpZGVycy9NaWNyb3NvZnQuTmV0d29yay9sb2NhdGlvbnMvZWFzdHVzL29wZXJhdGlvbnMvOWMwMjc1NGYtZmZjMy00ODdmLWE3MmYtNmMyZDZjZjg0ODhjP2FwaS12ZXJzaW9uPTIwMjAtMDMtMDE=", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { diff --git a/src/Monitor/Monitor.Test/Monitor.Test.csproj b/src/Monitor/Monitor.Test/Monitor.Test.csproj index 6d68926fdd7a..504f23d0ccd9 100644 --- a/src/Monitor/Monitor.Test/Monitor.Test.csproj +++ b/src/Monitor/Monitor.Test/Monitor.Test.csproj @@ -13,7 +13,7 @@ - + diff --git a/src/Monitor/Monitor.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.PrivateLinkScopeTests/TestPrivateLinkScopeCRUD.json b/src/Monitor/Monitor.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.PrivateLinkScopeTests/TestPrivateLinkScopeCRUD.json index f7d48017d8e8..0b8828e134b5 100644 --- a/src/Monitor/Monitor.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.PrivateLinkScopeTests/TestPrivateLinkScopeCRUD.json +++ b/src/Monitor/Monitor.Test/SessionRecords/Microsoft.Azure.Commands.Insights.Test.ScenarioTests.PrivateLinkScopeTests/TestPrivateLinkScopeCRUD.json @@ -1003,8 +1003,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1063,8 +1063,8 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1127,8 +1127,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1197,8 +1197,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1267,8 +1267,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDE5LTEyLTAx", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvdmlydHVhbE5ldHdvcmtzL3BzODk1Mz9hcGktdmVyc2lvbj0yMDIwLTAzLTAx", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"addressSpace\": {\r\n \"addressPrefixes\": [\r\n \"11.0.0.0/16\"\r\n ]\r\n },\r\n \"subnets\": [\r\n {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"ps1552\"\r\n }\r\n ],\r\n \"virtualNetworkPeerings\": [],\r\n \"enableDdosProtection\": false\r\n },\r\n \"location\": \"eastus2euap\"\r\n}", "RequestHeaders": { @@ -1410,8 +1410,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1470,8 +1470,8 @@ "StatusCode": 404 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1534,8 +1534,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "GET", "RequestBody": "", "RequestHeaders": { @@ -1604,8 +1604,8 @@ "StatusCode": 200 }, { - "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2019-12-01", - "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAxOS0xMi0wMQ==", + "RequestUri": "/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/privateEndpoints/ps5125?api-version=2020-03-01", + "EncodedRequestUri": "L3N1YnNjcmlwdGlvbnMvNTc5NDdjYjUtYWFkZC00YjZjLTllOGUtMjdmNTQ1YmI3YmY1L3Jlc291cmNlR3JvdXBzL3BzNjA1NC9wcm92aWRlcnMvTWljcm9zb2Z0Lk5ldHdvcmsvcHJpdmF0ZUVuZHBvaW50cy9wczUxMjU/YXBpLXZlcnNpb249MjAyMC0wMy0wMQ==", "RequestMethod": "PUT", "RequestBody": "{\r\n \"properties\": {\r\n \"subnet\": {\r\n \"properties\": {\r\n \"addressPrefix\": \"11.0.1.0/24\",\r\n \"addressPrefixes\": [],\r\n \"serviceEndpoints\": [],\r\n \"serviceEndpointPolicies\": [],\r\n \"delegations\": [],\r\n \"privateEndpointNetworkPolicies\": \"Disabled\",\r\n \"privateLinkServiceNetworkPolicies\": \"Enabled\"\r\n },\r\n \"name\": \"ps1552\",\r\n \"id\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/Microsoft.Network/virtualNetworks/ps8953/subnets/ps1552\"\r\n },\r\n \"privateLinkServiceConnections\": [],\r\n \"manualPrivateLinkServiceConnections\": [\r\n {\r\n \"properties\": {\r\n \"privateLinkServiceId\": \"/subscriptions/57947cb5-aadd-4b6c-9e8e-27f545bb7bf5/resourceGroups/ps6054/providers/microsoft.insights/privatelinkscopes/ps5901\",\r\n \"groupIds\": [\r\n \"azuremonitor\"\r\n ]\r\n },\r\n \"name\": \"ps5042\"\r\n }\r\n ]\r\n },\r\n \"location\": \"eastus2euap\"\r\n}", "RequestHeaders": { diff --git a/src/Network/Network.Test/NrpTeamAlias.cs b/src/Network/Network.Test/NrpTeamAlias.cs index a973e5bb581b..125bd40a6499 100644 --- a/src/Network/Network.Test/NrpTeamAlias.cs +++ b/src/Network/Network.Test/NrpTeamAlias.cs @@ -59,5 +59,8 @@ class NrpTeamAlias // Azure NRP bastion dev team public const string bastion = "bastion"; + + // Azure Network IPAM dev team + public const string ipam = "ipamdev"; } } diff --git a/src/Network/Network.Test/ScenarioTests/IpAllocationTests.cs b/src/Network/Network.Test/ScenarioTests/IpAllocationTests.cs new file mode 100644 index 000000000000..58af31cc6122 --- /dev/null +++ b/src/Network/Network.Test/ScenarioTests/IpAllocationTests.cs @@ -0,0 +1,36 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Network.Test.ScenarioTests; +using Microsoft.WindowsAzure.Commands.ScenarioTest; +using Xunit; + +namespace Commands.Network.Test.ScenarioTests +{ + public class IpAllocationTests : NetworkTestRunner + { + public IpAllocationTests(Xunit.Abstractions.ITestOutputHelper output) + : base(output) + { + } + + [Fact(Skip = "IpAllocation need manually onboard.")] + [Trait(Category.AcceptanceType, Category.CheckIn)] + [Trait(Category.Owner, NrpTeamAlias.ipam)] + public void TestIpAllocationBasicOperations() + { + TestRunner.RunTestScript(string.Format("Test-IpAllocation")); + } + } +} diff --git a/src/Network/Network.Test/ScenarioTests/IpAllocationTests.ps1 b/src/Network/Network.Test/ScenarioTests/IpAllocationTests.ps1 new file mode 100644 index 000000000000..75097020d000 --- /dev/null +++ b/src/Network/Network.Test/ScenarioTests/IpAllocationTests.ps1 @@ -0,0 +1,57 @@ +#---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +function Check-CmdletReturnType +{ + param($cmdletName, $cmdletReturn) + + $cmdletData = Get-Command $cmdletName + Assert-NotNull $cmdletData + [array]$cmdletReturnTypes = $cmdletData.OutputType.Name | Foreach-Object { return ($_ -replace "Microsoft.Azure.Commands.Network.Models.","") } + [array]$cmdletReturnTypes = $cmdletReturnTypes | Foreach-Object { return ($_ -replace "System.","") } + $realReturnType = $cmdletReturn.GetType().Name -replace "Microsoft.Azure.Commands.Network.Models.","" + return $cmdletReturnTypes -contains $realReturnType +} + +<# +.SYNOPSIS +Test creating new IpGroups +#> +function Test-IpAllocation +{ + # Setup + $rgname = Get-ResourceGroupName + $rglocation = Get-ProviderLocation ResourceManagement "westus" + $location = Get-ProviderLocation ResourceManagement "westus" + $IpGroupsName = Get-ResourceName + + try + { + # IpAllocation resource need manually onboard by subscription + $subId = Get-SubscriptionIdFromResourceGroup $rgname; + $vnetId = '/subscriptions/' + $subId + '/resourceGroups/' + $rgname + '/providers/Microsoft.Network/virtualNetworks/HypernetVnet1'; + + $ipAllocationName = 'testIpAllocation' + New-AzIpAllocation -ResourceName $ipAllocationName -ResourceGroupName $rgname -Location $rglocation -IpAllocationType Hypernet -PrefixLength 29 -PrefixType IPV4 -IpAllocationTag @{"VNetID"=$vnetId;"SubnetName"="HypernetSubnet1"} + + Set-AzIpAllocation -Name $ipAllocationName -ResourceGroupName $rgname -Tag @{'testtag'='tetsvalue'} + + Remove-AzIpAllocation -Name $ipAllocationName -ResourceGroupName $rgname + } + finally + { + # Cleanup + Clean-ResourceGroup $rgname + } +} diff --git a/src/Network/Network/Az.Network.psd1 b/src/Network/Network/Az.Network.psd1 index cdc621aeb040..204b6e2b7075 100644 --- a/src/Network/Network/Az.Network.psd1 +++ b/src/Network/Network/Az.Network.psd1 @@ -465,8 +465,12 @@ CmdletsToExport = 'Add-AzApplicationGatewayAuthenticationCertificate', 'Get-AzVirtualRouter', 'Add-AzVirtualRouterPeer', 'Update-AzVirtualRouterPeer', 'Remove-AzVirtualRouterPeer', 'Get-AzVirtualRouterPeer', 'New-AzIpGroup', 'Remove-AzIpGroup', - 'Get-AzIpGroup', 'Set-AzIpGroup', - 'New-AzIpConfigurationBgpPeeringAddressObject' + 'Get-AzIpGroup', 'Set-AzIpGroup', + 'New-AzIpConfigurationBgpPeeringAddressObject', + 'New-AzIpAllocation', + 'Get-AzIpAllocation', + 'Remove-AzIpAllocation', + 'Set-AzIpAllocation' # Variables to export from this module # VariablesToExport = @() diff --git a/src/Network/Network/ChangeLog.md b/src/Network/Network/ChangeLog.md index 55a0c2bfa929..b9cec1bdb7cd 100644 --- a/src/Network/Network/ChangeLog.md +++ b/src/Network/Network/ChangeLog.md @@ -37,6 +37,25 @@ * Updated cmdlets to enable setting of DPD Timeout on Virtual Network Gateway Connections. - New-AzVirtualNetworkGatewayConnection - Set-AzVirtualNetworkGatewayConnection +* Added resource type IpAllocation +* Added properties to Subnet + - Added property 'IpAllocations' as type of PSResourceId to PSIpAllocation +* Added properties to Virtual Network + - Added property 'IpAllocations' as type of PSResourceId to PSIpAllocation +* Added support for IpAllocation resource + - New cmdlet added: + - Get-AzIpAllocation + - New-AzIpAllocation + - Remove-AzIpAllocation + - Get-AzIpAllocation + - Updated `New-AzVirtualNetwork` + - Added another optional parameter IpAllocations to specify the IpAllocation + - Updated `New-AzVirtualNetworkSubnetConfig` + - Added another optional parameter IpAllocations to specify the IpAllocation + - Updated `Set-AzVirtualNetworkSubnetConfig` + - Added another optional parameter IpAllocations to specify the IpAllocation + - Updated `Add-AzVirtualNetworkSubnetConfig` + - Added another optional parameter IpAllocations to specify the IpAllocation ## Version 2.4.0 * Updated cmdlets to allow cross-tenant VirtualHubVnetConnections diff --git a/src/Network/Network/Common/NetworkResourceManagerProfile.cs b/src/Network/Network/Common/NetworkResourceManagerProfile.cs index 7381fc585427..a1456887e5f5 100644 --- a/src/Network/Network/Common/NetworkResourceManagerProfile.cs +++ b/src/Network/Network/Common/NetworkResourceManagerProfile.cs @@ -1323,6 +1323,10 @@ private static void Initialize() // IpGroup cfg.CreateMap(); cfg.CreateMap(); + + // IpAllocation + cfg.CreateMap(); + cfg.CreateMap(); }); _mapper = config.CreateMapper(); diff --git a/src/Network/Network/IpAllocation/GetAzureIpAllocationCommand.cs b/src/Network/Network/IpAllocation/GetAzureIpAllocationCommand.cs new file mode 100644 index 000000000000..c9277454233c --- /dev/null +++ b/src/Network/Network/IpAllocation/GetAzureIpAllocationCommand.cs @@ -0,0 +1,114 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; +using Microsoft.Rest.Azure; +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Management.Network; +using Microsoft.Azure.Management.Network.Models; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using AutoMapper; +using CNM = Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; +using Microsoft.WindowsAzure.Commands.Utilities.Common; + +namespace Microsoft.Azure.Commands.Network +{ + [Cmdlet("Get", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IpAllocation"), OutputType(typeof(PSIpAllocation))] + public class GetAzureIpAllocationCommand : IpAllocationBaseCmdlet + { + private const string ListParameterSet = "ListParameterSet"; + private const string GetByNameParameterSet = "GetByNameParameterSet"; + private const string GetByResourceIdParameterSet = "GetByResourceIdParameterSet"; + + [Parameter( + Mandatory = true, + HelpMessage = "The resource group name.", + ParameterSetName = GetByNameParameterSet)] + [Parameter( + Mandatory = false, + HelpMessage = "The resource group name.", + ParameterSetName = ListParameterSet)] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Alias("ResourceName")] + [Parameter( + Mandatory = true, + HelpMessage = "The resource name.", + ParameterSetName = GetByNameParameterSet)] + [ResourceNameCompleter("Microsoft.Network/ipAllocation", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + HelpMessage = "IpAllocation Id", + ParameterSetName = GetByResourceIdParameterSet, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + public string ResourceId { get; set; } + + public override void Execute() + { + + base.Execute(); + + if (this.IsParameterBound(c => c.ResourceId)) + { + var resourceIdentifier = new ResourceIdentifier(this.ResourceId); + this.ResourceGroupName = resourceIdentifier.ResourceGroupName; + this.Name = resourceIdentifier.ResourceName; + } + + if (ShouldGetByName(ResourceGroupName, Name)) + { + var allocation = this.GetIpAllocation(this.ResourceGroupName, this.Name); + + WriteObject(allocation); + } + else + { + IPage allocationPage; + if (ShouldListByResourceGroup(ResourceGroupName, Name)) + { + allocationPage = this.IpAllocationClient.ListByResourceGroup(this.ResourceGroupName); + } + else + { + allocationPage = this.IpAllocationClient.List(); + } + + // Get all resources by polling on next page link + var allocationList = ListNextLink.GetAllResourcesByPollingNextLink(allocationPage, this.IpAllocationClient.ListNext); + + var psAllocations = new List(); + foreach (var allocation in allocationList) + { + var psAllocation = this.ToPsIpAllocation(allocation); + psAllocation.ResourceGroupName = NetworkBaseCmdlet.GetResourceGroup(psAllocation.Id); + psAllocations.Add(psAllocation); + } + + WriteObject(TopLevelWildcardFilter(ResourceGroupName, Name, psAllocations), true); + } + } + } +} diff --git a/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs b/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs new file mode 100644 index 000000000000..40d3cd08d93e --- /dev/null +++ b/src/Network/Network/IpAllocation/IpAllocationBaseCmdlet.cs @@ -0,0 +1,76 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using AutoMapper; +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; +using Microsoft.Azure.Management.Network; +using Microsoft.Azure.Management.Network.Models; +using System.Net; + +namespace Microsoft.Azure.Commands.Network +{ + public abstract class IpAllocationBaseCmdlet : NetworkBaseCmdlet + { + public IIpAllocationsOperations IpAllocationClient + { + get + { + return NetworkClient.NetworkManagementClient.IpAllocations; + } + } + + public bool IsIpAllocationPresent(string resourceGroupName, string name) + { + try + { + GetIpAllocation(resourceGroupName, name); + } + catch (Microsoft.Rest.Azure.CloudException exception) + { + if (exception.Response.StatusCode == HttpStatusCode.NotFound) + { + // Resource is not present + return false; + } + + throw; + } + + return true; + } + + public PSIpAllocation GetIpAllocation(string resourceGroupName, string name, string expandResource = null) + { + var allocation = this.IpAllocationClient.Get(resourceGroupName, name, expandResource); + + var psIpAllocation = NetworkResourceManagerProfile.Mapper.Map(allocation); + psIpAllocation.ResourceGroupName = resourceGroupName; + + psIpAllocation.Tag = + TagsConversionHelper.CreateTagHashtable(allocation.Tags); + + return psIpAllocation; + } + + public PSIpAllocation ToPsIpAllocation(Microsoft.Azure.Management.Network.Models.IpAllocation allocation) + { + var psIpAllocation = NetworkResourceManagerProfile.Mapper.Map(allocation); + + psIpAllocation.Tag = TagsConversionHelper.CreateTagHashtable(allocation.Tags); + + return psIpAllocation; + } + } +} \ No newline at end of file diff --git a/src/Network/Network/IpAllocation/NewAzureIpAllocationCommand.cs b/src/Network/Network/IpAllocation/NewAzureIpAllocationCommand.cs new file mode 100644 index 000000000000..9d7a3bbf58a9 --- /dev/null +++ b/src/Network/Network/IpAllocation/NewAzureIpAllocationCommand.cs @@ -0,0 +1,154 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using AutoMapper; +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; +using Microsoft.Azure.Management.Network; +using System.Collections; +using System.Collections.Generic; +using System.Management.Automation; +using MNM = Microsoft.Azure.Management.Network.Models; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; +using System.Linq; + +namespace Microsoft.Azure.Commands.Network +{ + [Cmdlet("New", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IpAllocation", SupportsShouldProcess = true), OutputType(typeof(PSIpAllocation))] + public class NewAzureIpAllocationCommand : IpAllocationBaseCmdlet + { + [Alias("ResourceName")] + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource name.")] + [ValidateNotNullOrEmpty] + public virtual string Name { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public virtual string ResourceGroupName { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "location.")] + [LocationCompleter("Microsoft.Network/ipAllocation")] + [ValidateNotNullOrEmpty] + public virtual string Location { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The type of the IP allocation")] + [ValidateSet("Hypernet", "Undefined", IgnoreCase = true)] + [ValidateNotNullOrEmpty] + public string IpAllocationType { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The prefix of the IP allocation")] + public string Prefix { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The prefix length of the IP allocation")] + public int? PrefixLength { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The prefix type of the IP allocation")] + [ValidateSet("IPV4", "IPV6", IgnoreCase = true)] + public string PrefixType { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The ipam allocation ID of the IP allocation")] + public string IpamAllocationId { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The allocation tags of the IP allocation")] + public Hashtable IpAllocationTag { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "A hashtable which represents resource tags.")] + public Hashtable Tag { get; set; } + + [Parameter( + Mandatory = false, + HelpMessage = "Do not ask for confirmation if you want to override a resource")] + public SwitchParameter Force { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void Execute() + { + base.Execute(); + var present = IsIpAllocationPresent(ResourceGroupName, Name); + ConfirmAction( + Force.IsPresent, + string.Format(Properties.Resources.OverwritingResource, Name), + Properties.Resources.CreatingResourceMessage, + Name, + () => + { + var allocation = CreateIpAllocation(); + WriteObject(allocation); + }, + () => present); + } + + private PSIpAllocation CreateIpAllocation() + { + var allocation = new PSIpAllocation + { + Name = Name, + ResourceGroupName = ResourceGroupName, + Location = Location, + IpAllocationType = IpAllocationType, + Prefix = Prefix, + PrefixLength = PrefixLength, + PrefixType = PrefixType, + IpamAllocationId = IpamAllocationId + }; + + // Map to the sdk object + var allocationModel = NetworkResourceManagerProfile.Mapper.Map(allocation); + allocationModel.AllocationTags = TagsConversionHelper.CreateTagDictionary(this.IpAllocationTag, validate: true); + + allocationModel.Tags = TagsConversionHelper.CreateTagDictionary(this.Tag, validate: true); + + // Execute the Create IpALlocation call + IpAllocationClient.CreateOrUpdate(ResourceGroupName, Name, allocationModel); + + var getIpAllocation = GetIpAllocation(ResourceGroupName, Name); + + return getIpAllocation; + } + } +} diff --git a/src/Network/Network/IpAllocation/RemoveAzureIpAllocationCommand.cs b/src/Network/Network/IpAllocation/RemoveAzureIpAllocationCommand.cs new file mode 100644 index 000000000000..ec34e1083ff9 --- /dev/null +++ b/src/Network/Network/IpAllocation/RemoveAzureIpAllocationCommand.cs @@ -0,0 +1,106 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Management.Network; +using Microsoft.Azure.Management.Network.Models; +using System.Management.Automation; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; + +namespace Microsoft.Azure.Commands.Network +{ + [Cmdlet("Remove", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IpAllocation", SupportsShouldProcess = true), OutputType(typeof(bool))] + public class RemoveAzureIpAllocationCommand : IpAllocationBaseCmdlet + { + private const string DeleteByNameParameterSet = "DeleteByNameParameterSet"; + private const string DeleteByInputObjectParameterSet = "DeleteByInputObjectParameterSet"; + private const string DeleteByResourceIdParameterSet = "DeleteByResourceIdParameterSet"; + + [Alias("ResourceName")] + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + ParameterSetName = DeleteByNameParameterSet, + HelpMessage = "The resource name.")] + [ResourceNameCompleter("Microsoft.Network/ipAllocation", "ResourceGroupName")] + [ValidateNotNullOrEmpty] + public virtual string Name { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipelineByPropertyName = true, + ParameterSetName = DeleteByNameParameterSet, + HelpMessage = "The resource group name.")] + [ResourceGroupCompleter] + [ValidateNotNullOrEmpty] + public virtual string ResourceGroupName { get; set; } + + [Parameter(Mandatory = true, + ValueFromPipeline = true, + ParameterSetName = DeleteByInputObjectParameterSet)] + [ValidateNotNull] + public PSTopLevelResource InputObject { get; set; } + + [Parameter(Mandatory = true, + ValueFromPipelineByPropertyName = true, + ParameterSetName = DeleteByResourceIdParameterSet)] + [ValidateNotNullOrEmpty] + public string ResourceId { get; set; } + + [Parameter( + Mandatory = false, + HelpMessage = "Do not ask for confirmation.")] + public SwitchParameter Force { get; set; } + + [Parameter(Mandatory = false)] + public SwitchParameter PassThru { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void Execute() + { + base.Execute(); + + if (this.IsParameterBound(c => c.InputObject)) + { + this.ResourceGroupName = this.InputObject.ResourceGroupName; + this.Name = this.InputObject.Name; + } + + if (this.IsParameterBound(c => c.ResourceId)) + { + var resourceIdentifier = new ResourceIdentifier(this.ResourceId); + this.ResourceGroupName = resourceIdentifier.ResourceGroupName; + this.Name = resourceIdentifier.ResourceName; + } + + ConfirmAction( + Force.IsPresent, + string.Format(Properties.Resources.RemovingResource, Name), + Properties.Resources.RemoveResourceMessage, + Name, + () => + { + this.IpAllocationClient.Delete(this.ResourceGroupName, this.Name); + if (PassThru) + { + WriteObject(true); + } + }); + } + } +} diff --git a/src/Network/Network/IpAllocation/SetAzureIpAllocationCommand.cs b/src/Network/Network/IpAllocation/SetAzureIpAllocationCommand.cs new file mode 100644 index 000000000000..5b0aa9352d1d --- /dev/null +++ b/src/Network/Network/IpAllocation/SetAzureIpAllocationCommand.cs @@ -0,0 +1,132 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +using Microsoft.Azure.Commands.Network.Models; +using Microsoft.Azure.Commands.ResourceManager.Common.Tags; +using Microsoft.Azure.Management.Network; +using Microsoft.Azure.Management.Network.Models; +using MNM = Microsoft.Azure.Management.Network.Models; +using System.Management.Automation; +using Microsoft.Azure.Commands.ResourceManager.Common.ArgumentCompleters; +using Microsoft.WindowsAzure.Commands.Utilities.Common; +using Microsoft.Azure.Management.Internal.Resources.Utilities.Models; +using System; +using System.Collections; +using System.Net; +using Microsoft.WindowsAzure.Commands.Common.CustomAttributes; + +namespace Microsoft.Azure.Commands.Network +{ + [Cmdlet("Set", ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "IpAllocation"), OutputType(typeof(PSIpAllocation))] + public class SetAzureIpAllocationCommand : IpAllocationBaseCmdlet + { + private const string SetByNameParameterSet = "SetByNameParameterSet"; + private const string SetByInputObjectParameterSet = "SetByInputObjectParameterSet"; + private const string SetByResourceIdParameterSet = "SetByResourceIdParameterSet"; + + [Parameter(Mandatory = true, ParameterSetName = SetByNameParameterSet)] + [ValidateNotNullOrEmpty] + public string ResourceGroupName { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = SetByNameParameterSet)] + [ValidateNotNullOrEmpty] + public string Name { get; set; } + + [Parameter( + Mandatory = true, + HelpMessage = "IpAllocation Id", + ParameterSetName = SetByResourceIdParameterSet, + ValueFromPipelineByPropertyName = true)] + [ValidateNotNullOrEmpty] + [Alias("IpAllocationId")] + public string ResourceId { get; set; } + + [Parameter( + Mandatory = true, + ValueFromPipeline = true, + ParameterSetName = SetByInputObjectParameterSet, + HelpMessage = "The IpAllocation")] + [Alias("IpAllocation")] + public PSIpAllocation InputObject { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "The allocation tags of the IP allocation")] + public Hashtable IpAllocationTag { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "A hashtable which represents resource tags.")] + public Hashtable Tag { get; set; } + + [Parameter(Mandatory = false, HelpMessage = "Run cmdlet in the background")] + public SwitchParameter AsJob { get; set; } + + public override void Execute() + { + base.Execute(); + + if (this.IsParameterBound(c => c.InputObject)) + { + this.ResourceGroupName = this.InputObject.ResourceGroupName; + this.Name = this.InputObject.Name; + } + + if (this.IsParameterBound(c => c.ResourceId)) + { + var resourceIdentifier = new ResourceIdentifier(this.ResourceId); + this.ResourceGroupName = resourceIdentifier.ResourceGroupName; + this.Name = resourceIdentifier.ResourceName; + } + + if (!this.IsIpAllocationPresent(this.ResourceGroupName, this.Name)) + { + throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound); + } + try + { + if (this.InputObject == null) + { + var ipAllocation = GetIpAllocation(this.ResourceGroupName, this.Name); + this.InputObject = NetworkResourceManagerProfile.Mapper.Map(ipAllocation); + this.InputObject.ResourceGroupName = this.ResourceGroupName; + this.InputObject.Name = this.Name; + } + } + catch (Microsoft.Rest.Azure.CloudException exception) + { + if (exception.Response.StatusCode == HttpStatusCode.NotFound) + { + // Resource is not present + throw new ArgumentException(Microsoft.Azure.Commands.Network.Properties.Resources.ResourceNotFound); + } + + throw; + } + + // Map to the sdk object + var allocationModel = NetworkResourceManagerProfile.Mapper.Map(this.InputObject); + allocationModel.AllocationTags = TagsConversionHelper.CreateTagDictionary(IpAllocationTag, validate: true); + allocationModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true); + + // Execute the Update VirtualNetwork call + this.IpAllocationClient.CreateOrUpdate(this.InputObject.ResourceGroupName, this.InputObject.Name, allocationModel); + + var getVirtualNetwork = this.GetIpAllocation(this.InputObject.ResourceGroupName, this.InputObject.Name); + WriteObject(getVirtualNetwork); + } + } +} diff --git a/src/Network/Network/Models/PSIpAllocation.cs b/src/Network/Network/Models/PSIpAllocation.cs new file mode 100644 index 000000000000..f7fa6309057c --- /dev/null +++ b/src/Network/Network/Models/PSIpAllocation.cs @@ -0,0 +1,51 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- + +namespace Microsoft.Azure.Commands.Network.Models +{ + using System.Collections.Generic; + using Microsoft.Azure.Management.Internal.Network.Common; + using Newtonsoft.Json; + + public class PSIpAllocation : PSTopLevelResource, IResourceReference + { + public string IpAllocationType { get; set; } + + public string Prefix { get; set; } + + public int? PrefixLength { get; set; } + + public string PrefixType { get; set; } + + public string IpamAllocationId { get; set; } + + public IDictionary AllocationTags { get; set; } + + public PSSubnet Subnet { get; set; } + + public PSVirtualNetwork VirtualNetwork { get; set; } + + [JsonIgnore] + public string SubnetText + { + get { return JsonConvert.SerializeObject(Subnet, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } + } + + [JsonIgnore] + public string VirtualNetworkText + { + get { return JsonConvert.SerializeObject(VirtualNetwork, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } + } + } +} diff --git a/src/Network/Network/Models/PSSubnet.cs b/src/Network/Network/Models/PSSubnet.cs index eb6b00a0c4ff..fd655d834f76 100644 --- a/src/Network/Network/Models/PSSubnet.cs +++ b/src/Network/Network/Models/PSSubnet.cs @@ -68,6 +68,9 @@ public class PSSubnet : PSChildResource [Ps1Xml(Target = ViewControl.Table)] public string PrivateLinkServiceNetworkPolicies { get; set; } + [JsonProperty(Order = 1)] + public List IpAllocations { get; set; } + [JsonIgnore] public string IpConfigurationsText { @@ -162,5 +165,11 @@ public string DelegationsText { get { return JsonConvert.SerializeObject(Delegations, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } + + [JsonIgnore] + public string IpAllocationsText + { + get { return JsonConvert.SerializeObject(IpAllocations, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } + } } } diff --git a/src/Network/Network/Models/PSVirtualNetwork.cs b/src/Network/Network/Models/PSVirtualNetwork.cs index 50b3f37493ad..05180bc882b9 100644 --- a/src/Network/Network/Models/PSVirtualNetwork.cs +++ b/src/Network/Network/Models/PSVirtualNetwork.cs @@ -40,6 +40,8 @@ public class PSVirtualNetwork : PSTopLevelResource, IResourceReference, IVirtual public PSResourceId DdosProtectionPlan { get; set; } + public List IpAllocations { get; set; } + [JsonIgnore] public string AddressSpaceText { @@ -81,5 +83,11 @@ public string DdosProtectionPlanText { get { return JsonConvert.SerializeObject(DdosProtectionPlan, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } } + + [JsonIgnore] + public string IpAllocationsText + { + get { return JsonConvert.SerializeObject(IpAllocations, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); } + } } } diff --git a/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs b/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs index 0b27c1fe3729..cc642f24f02a 100644 --- a/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs +++ b/src/Network/Network/VirtualNetwork/NewAzureVirtualNetworkCommand.cs @@ -95,6 +95,12 @@ public class NewAzureVirtualNetworkCommand : VirtualNetworkBaseCmdlet HelpMessage = "Reference to the DDoS protection plan resource associated with the virtual network.")] public string DdosProtectionPlanId { get; set; } + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "IpAllocation")] + public PSIpAllocation[] IpAllocation { get; set; } + [Parameter( Mandatory = false, HelpMessage = "Do not ask for confirmation if you want to override a resource")] @@ -149,9 +155,18 @@ private PSVirtualNetwork CreateVirtualNetwork() } // Map to the sdk object - var vnetModel = NetworkResourceManagerProfile.Mapper.Map(vnet); + var vnetModel = NetworkResourceManagerProfile.Mapper.Map(vnet); vnetModel.Tags = TagsConversionHelper.CreateTagDictionary(Tag, validate: true); + if (this.IpAllocation != null) + { + foreach (var ipAllocation in this.IpAllocation) + { + var ipAllocationReference = new MNM.SubResource(ipAllocation.Id); + vnetModel.IpAllocations.Add(ipAllocationReference); + } + } + // Execute the Create VirtualNetwork call VirtualNetworkClient.CreateOrUpdate(ResourceGroupName, Name, vnetModel); diff --git a/src/Network/Network/VirtualNetwork/Subnet/AddAzureVirtualNetworkSubnetConfigCommand.cs b/src/Network/Network/VirtualNetwork/Subnet/AddAzureVirtualNetworkSubnetConfigCommand.cs index 8e66f0b7b4f9..79480529c371 100644 --- a/src/Network/Network/VirtualNetwork/Subnet/AddAzureVirtualNetworkSubnetConfigCommand.cs +++ b/src/Network/Network/VirtualNetwork/Subnet/AddAzureVirtualNetworkSubnetConfigCommand.cs @@ -71,6 +71,14 @@ public override void Execute() subnet.Name = this.Name; subnet.AddressPrefix = this.AddressPrefix?.ToList(); + if (this.IpAllocation != null) + { + foreach (var allocation in this.IpAllocation) + { + subnet.IpAllocations.Add(allocation); + } + } + if (!string.IsNullOrEmpty(this.NetworkSecurityGroupId)) { subnet.NetworkSecurityGroup = new PSNetworkSecurityGroup(); diff --git a/src/Network/Network/VirtualNetwork/Subnet/AzureVirtualNetworkSubnetConfigBase.cs b/src/Network/Network/VirtualNetwork/Subnet/AzureVirtualNetworkSubnetConfigBase.cs index 3a63bbbbd192..fdd131d6c154 100644 --- a/src/Network/Network/VirtualNetwork/Subnet/AzureVirtualNetworkSubnetConfigBase.cs +++ b/src/Network/Network/VirtualNetwork/Subnet/AzureVirtualNetworkSubnetConfigBase.cs @@ -122,5 +122,11 @@ public class AzureVirtualNetworkSubnetConfigBase : NetworkBaseCmdlet ValueFromPipelineByPropertyName = true)] [PSArgumentCompleter("Enabled", "Disabled")] public string PrivateLinkServiceNetworkPoliciesFlag { get; set; } + + [Parameter( + Mandatory = false, + ValueFromPipelineByPropertyName = true, + HelpMessage = "IpAllocation")] + public PSIpAllocation[] IpAllocation { get; set; } } } diff --git a/src/Network/Network/VirtualNetwork/Subnet/NewAzureVirtualNetworkSubnetConfigCommand.cs b/src/Network/Network/VirtualNetwork/Subnet/NewAzureVirtualNetworkSubnetConfigCommand.cs index 054dcf6d2c91..576796760696 100644 --- a/src/Network/Network/VirtualNetwork/Subnet/NewAzureVirtualNetworkSubnetConfigCommand.cs +++ b/src/Network/Network/VirtualNetwork/Subnet/NewAzureVirtualNetworkSubnetConfigCommand.cs @@ -53,6 +53,14 @@ public override void Execute() var subnet = new PSSubnet(); subnet.Name = this.Name; subnet.AddressPrefix = this.AddressPrefix?.ToList(); + subnet.IpAllocations = new List(); + if (this.IpAllocation != null) + { + foreach (var allocation in this.IpAllocation) + { + subnet.IpAllocations.Add(allocation); + } + } if (!string.IsNullOrEmpty(this.NetworkSecurityGroupId)) { diff --git a/src/Network/Network/VirtualNetwork/Subnet/SetAzureVirtualNetworkSubnetConfigCommand.cs b/src/Network/Network/VirtualNetwork/Subnet/SetAzureVirtualNetworkSubnetConfigCommand.cs index fa6268417002..b07031ef74ee 100644 --- a/src/Network/Network/VirtualNetwork/Subnet/SetAzureVirtualNetworkSubnetConfigCommand.cs +++ b/src/Network/Network/VirtualNetwork/Subnet/SetAzureVirtualNetworkSubnetConfigCommand.cs @@ -63,6 +63,14 @@ public override void Execute() subnet.AddressPrefix = this.AddressPrefix?.ToList(); + if (this.IpAllocation != null) + { + foreach (var allocation in this.IpAllocation) + { + subnet.IpAllocations.Add(allocation); + } + } + if (!string.IsNullOrEmpty(this.NetworkSecurityGroupId)) { subnet.NetworkSecurityGroup = new PSNetworkSecurityGroup(); diff --git a/src/Network/Network/help/Add-AzVirtualNetworkSubnetConfig.md b/src/Network/Network/help/Add-AzVirtualNetworkSubnetConfig.md index c3d684face8a..ffb298f3dc31 100644 --- a/src/Network/Network/help/Add-AzVirtualNetworkSubnetConfig.md +++ b/src/Network/Network/help/Add-AzVirtualNetworkSubnetConfig.md @@ -19,7 +19,7 @@ Add-AzVirtualNetworkSubnetConfig -Name -VirtualNetwork ] [-RouteTable ] [-InputObject ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] - [-PrivateLinkServiceNetworkPoliciesFlag ] [-DefaultProfile ] + [-PrivateLinkServiceNetworkPoliciesFlag ] [-IpAllocation ] [-DefaultProfile ] [] ``` @@ -29,7 +29,7 @@ Add-AzVirtualNetworkSubnetConfig -Name -VirtualNetwork ] [-RouteTableId ] [-ResourceId ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] - [-PrivateLinkServiceNetworkPoliciesFlag ] [-DefaultProfile ] + [-PrivateLinkServiceNetworkPoliciesFlag ] [-IpAllocation ] [-DefaultProfile ] [] ``` @@ -124,6 +124,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -IpAllocation +Specifies IpAllocations for a subnet. + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSIpAllocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Name Specifies the name of the subnet configuration to add. diff --git a/src/Network/Network/help/Get-AzIpAllocation.md b/src/Network/Network/help/Get-AzIpAllocation.md new file mode 100644 index 000000000000..6dc9ac03e219 --- /dev/null +++ b/src/Network/Network/help/Get-AzIpAllocation.md @@ -0,0 +1,129 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml +Module Name: Az.Network +online version: https://docs.microsoft.com/en-us/powershell/module/az.network/get-azipallocation +schema: 2.0.0 +--- + +# Get-AzIpAllocation + +## SYNOPSIS +Gets a Azure IpAllocation. + +## SYNTAX + +### GetByNameParameterSet +``` +Get-AzIpAllocation [-ResourceGroupName] [-Name] [-DefaultProfile ] + [] +``` + +### ListParameterSet +``` +Get-AzIpAllocation [-ResourceGroupName ] [-DefaultProfile ] + [] +``` + +### GetByResourceIdParameterSet +``` +Get-AzIpAllocation [-ResourceId] [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Get-AzIpAllocation** cmdlet gets an Azure IpAllocation + +## EXAMPLES + +### Example 1 +```powershell +Get-AzIpAllocation -ResourceGroupName 'TestResourceGroup' -Name 'TestIpAllocation' +``` + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The resource name. + +```yaml +Type: System.String +Parameter Sets: GetByNameParameterSet +Aliases: ResourceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name. + +```yaml +Type: System.String +Parameter Sets: GetByNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +```yaml +Type: System.String +Parameter Sets: ListParameterSet +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IpAllocation Id + +```yaml +Type: System.String +Parameter Sets: GetByResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### Microsoft.Azure.Commands.Network.Models.PSIpAllocation + +## NOTES + +## RELATED LINKS diff --git a/src/Network/Network/help/New-AzIpAllocation.md b/src/Network/Network/help/New-AzIpAllocation.md new file mode 100644 index 000000000000..3cf40cf6b66d --- /dev/null +++ b/src/Network/Network/help/New-AzIpAllocation.md @@ -0,0 +1,284 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml +Module Name: Az.Network +online version: https://docs.microsoft.com/en-us/powershell/module/az.network/new-azipallocation +schema: 2.0.0 +--- + +# New-AzIpAllocation + +## SYNOPSIS +Creates an Azure IpAllocation. + +## SYNTAX + +``` +New-AzIpAllocation -Name -ResourceGroupName -Location + -IpAllocationType [-Prefix ] [-PrefixLength ] [-PrefixType ] + [-IpamAllocationId ] [-IpAllocationTag ] [-Tag ] [-Force] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **New-AzIpAllocation** cmdlet creates an Azure IpAllocation + +## EXAMPLES + +### Example 1 +```powershell +New-AzIpAllocation -ResourceName 'TestIpAllocation' -ResourceGroupName 'TestResourcegroupName' -Location 'eastus' -IpAllocationType 'Hypernet' -Prefix '1.2.3.4/32' -IpAllocationTag @{"VnetId"="vnet1"} +``` + +### Example 2 +```powershell +New-AzIpAllocation -ResourceName 'TestIpAllocation' -ResourceGroupName 'TestResourcegroupName' -Location 'eastus' -IpAllocationType 'Hypernet' -PrefixLength 32 -PrefixType 'ipv4' -IpAllocationTag @{"VnetId"="vnet1"} +``` + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Do not ask for confirmation if you want to override a resource + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IpAllocationTag +The allocation tags of the IP allocation + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -IpAllocationType +The type of the IP allocation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: +Accepted values: Hypernet, Undefined + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -IpamAllocationId +The ipam allocation ID of the IP allocation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Location +location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name +The resource name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ResourceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Prefix +The prefix of the IP allocation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PrefixLength +The prefix length of the IP allocation + +```yaml +Type: System.Nullable`1[System.Int32] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PrefixType +The prefix type of the IP allocation + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: +Accepted values: IPV4, IPV6 + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Tag +A hashtable which represents resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +### System.Nullable`1[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] + +### System.Collections.Hashtable + +## OUTPUTS + +### Microsoft.Azure.Commands.Network.Models.PSIpAllocation + +## NOTES + +## RELATED LINKS diff --git a/src/Network/Network/help/New-AzVirtualNetwork.md b/src/Network/Network/help/New-AzVirtualNetwork.md index c1d53aeea744..e34384a43382 100644 --- a/src/Network/Network/help/New-AzVirtualNetwork.md +++ b/src/Network/Network/help/New-AzVirtualNetwork.md @@ -16,7 +16,7 @@ Creates a virtual network. ``` New-AzVirtualNetwork -Name -ResourceGroupName -Location -AddressPrefix [-DnsServer ] [-Subnet ] [-BgpCommunity ] [-Tag ] - [-EnableDdosProtection] [-DdosProtectionPlanId ] [-Force] [-AsJob] + [-EnableDdosProtection] [-DdosProtectionPlanId ] [-IpAllocation ] [-Force] [-AsJob] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -193,6 +193,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -IpAllocation +Specifies IpAllocations for a virtual network. + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSIpAllocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Location Specifies the region for the virtual network. diff --git a/src/Network/Network/help/New-AzVirtualNetworkSubnetConfig.md b/src/Network/Network/help/New-AzVirtualNetworkSubnetConfig.md index fbb2c4c6f143..e9b867450fb0 100644 --- a/src/Network/Network/help/New-AzVirtualNetworkSubnetConfig.md +++ b/src/Network/Network/help/New-AzVirtualNetworkSubnetConfig.md @@ -19,7 +19,7 @@ New-AzVirtualNetworkSubnetConfig -Name -AddressPrefix [-NetworkSecurityGroup ] [-RouteTable ] [-InputObject ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] - [-PrivateLinkServiceNetworkPoliciesFlag ] [-DefaultProfile ] + [-PrivateLinkServiceNetworkPoliciesFlag ] [-IpAllocation ] [-DefaultProfile ] [] ``` @@ -29,7 +29,7 @@ New-AzVirtualNetworkSubnetConfig -Name -AddressPrefix [-Netw [-RouteTableId ] [-ResourceId ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] [-PrivateLinkServiceNetworkPoliciesFlag ] - [-DefaultProfile ] [] + [-IpAllocation ] [-DefaultProfile ] [] ``` ## DESCRIPTION @@ -137,6 +137,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -IpAllocation +Specifies IpAllocations for a subnet. + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSIpAllocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Name Specifies the name of the subnet configuration to create. diff --git a/src/Network/Network/help/Remove-AzIpAllocation.md b/src/Network/Network/help/Remove-AzIpAllocation.md new file mode 100644 index 000000000000..82a2991e392b --- /dev/null +++ b/src/Network/Network/help/Remove-AzIpAllocation.md @@ -0,0 +1,210 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml +Module Name: Az.Network +online version: https://docs.microsoft.com/en-us/powershell/module/az.network/remove-azipallocation +schema: 2.0.0 +--- + +# Remove-AzIpAllocation + +## SYNOPSIS +Deletes an Azure IpAllocation. + +## SYNTAX + +### DeleteByNameParameterSet +``` +Remove-AzIpAllocation [-Name] [-ResourceGroupName] [-Force] [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### DeleteByInputObjectParameterSet +``` +Remove-AzIpAllocation [-InputObject] [-Force] [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +### DeleteByResourceIdParameterSet +``` +Remove-AzIpAllocation [-ResourceId] [-Force] [-PassThru] [-AsJob] + [-DefaultProfile ] [-WhatIf] [-Confirm] [] +``` + +## DESCRIPTION +The **Remove-AzIpAllocation** cmdlet deletes an Azure IpAllocation + +## EXAMPLES + +### Example 1 +```powershell +Remove-AzIpAllocation -ResourceGroupName 'TestResourceGroup' -Name 'TestIpAllocation' +``` + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Force +Do not ask for confirmation. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +{{ Fill InputObject Description }} + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSTopLevelResource +Parameter Sets: DeleteByInputObjectParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The resource name. + +```yaml +Type: System.String +Parameter Sets: DeleteByNameParameterSet +Aliases: ResourceName + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -PassThru +Returns an object representing the item with which you are working. +By default, this cmdlet does not generate any output. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name. + +```yaml +Type: System.String +Parameter Sets: DeleteByNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -ResourceId +IpAllocation resource id. + +```yaml +Type: System.String +Parameter Sets: DeleteByResourceIdParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### System.String + +## OUTPUTS + +### System.Boolean + +## NOTES + +## RELATED LINKS diff --git a/src/Network/Network/help/Set-AzIpAllocation.md b/src/Network/Network/help/Set-AzIpAllocation.md new file mode 100644 index 000000000000..27309c2655b1 --- /dev/null +++ b/src/Network/Network/help/Set-AzIpAllocation.md @@ -0,0 +1,178 @@ +--- +external help file: Microsoft.Azure.PowerShell.Cmdlets.Network.dll-Help.xml +Module Name: Az.Network +online version: https://docs.microsoft.com/en-us/powershell/module/az.network/set-azipallocation +schema: 2.0.0 +--- + +# Set-AzIpAllocation + +## SYNOPSIS +Saves a modified IpAllocation. + +## SYNTAX + +### SetByNameParameterSet +``` +Set-AzIpAllocation [-ResourceGroupName] [-Name] [-IpAllocationTag ] + [-Tag ] [-AsJob] [-DefaultProfile ] [] +``` + +### SetByResourceIdParameterSet +``` +Set-AzIpAllocation [-ResourceId] [-IpAllocationTag ] [-Tag ] [-AsJob] + [-DefaultProfile ] [] +``` + +### SetByInputObjectParameterSet +``` +Set-AzIpAllocation [-InputObject] [-IpAllocationTag ] [-Tag ] + [-AsJob] [-DefaultProfile ] [] +``` + +## DESCRIPTION +The **Set-AzIpAllocation** cmdlet updates an Azure IpAllocation + +## EXAMPLES + +### Example 1 +```powershell +Set-AzIpAllocation -ResourceGroupName 'TestResourceGroup' -Name 'TestIpAllocation' -IpAllocationTag @{"VnetId"="vnet1"} -Tag @{"TestTag"="TestValue"} +``` + +## PARAMETERS + +### -AsJob +Run cmdlet in the background + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer +Parameter Sets: (All) +Aliases: AzContext, AzureRmContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +The IpAllocation + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSIpAllocation +Parameter Sets: SetByInputObjectParameterSet +Aliases: IpAllocation + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IpAllocationTag +The allocation tags of the IP allocation + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Name +The resource name. + +```yaml +Type: System.String +Parameter Sets: SetByNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The resource group name. + +```yaml +Type: System.String +Parameter Sets: SetByNameParameterSet +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceId +IpAllocation Id + +```yaml +Type: System.String +Parameter Sets: SetByResourceIdParameterSet +Aliases: IpAllocationId + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### -Tag +A hashtable which represents resource tags. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.Commands.Network.Models.PSIpAllocation + +## OUTPUTS + +### Microsoft.Azure.Commands.Network.Models.PSIpAllocation + +## NOTES + +## RELATED LINKS diff --git a/src/Network/Network/help/Set-AzVirtualNetworkSubnetConfig.md b/src/Network/Network/help/Set-AzVirtualNetworkSubnetConfig.md index 5d1f97665ce6..edd862043365 100644 --- a/src/Network/Network/help/Set-AzVirtualNetworkSubnetConfig.md +++ b/src/Network/Network/help/Set-AzVirtualNetworkSubnetConfig.md @@ -19,7 +19,7 @@ Set-AzVirtualNetworkSubnetConfig -Name -VirtualNetwork ] [-RouteTable ] [-InputObject ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] - [-PrivateLinkServiceNetworkPoliciesFlag ] [-DefaultProfile ] + [-PrivateLinkServiceNetworkPoliciesFlag ] [-IpAllocation ] [-DefaultProfile ] [] ``` @@ -29,7 +29,7 @@ Set-AzVirtualNetworkSubnetConfig -Name -VirtualNetwork ] [-RouteTableId ] [-ResourceId ] [-ServiceEndpoint ] [-ServiceEndpointPolicy ] [-Delegation ] [-PrivateEndpointNetworkPoliciesFlag ] - [-PrivateLinkServiceNetworkPoliciesFlag ] [-DefaultProfile ] + [-PrivateLinkServiceNetworkPoliciesFlag ] [-IpAllocation ] [-DefaultProfile ] [] ``` @@ -165,6 +165,21 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` +### -IpAllocation +Specifies IpAllocations for a subnet. + +```yaml +Type: Microsoft.Azure.Commands.Network.Models.PSIpAllocation[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: True (ByPropertyName) +Accept wildcard characters: False +``` + ### -Name Specifies the name of a subnet configuration that this cmdlet configures.