Skip to content

Commit

Permalink
{Network} az network dns zone: Fix for the zone import logic (Azure…
Browse files Browse the repository at this point in the history
…#30383)

Co-authored-by: Sandeep Kadagathur Vadiraj <skadagat@microsoft.com>
  • Loading branch information
2 people authored and yanzhudd committed Nov 25, 2024
1 parent c1b0ccb commit 63474f5
Show file tree
Hide file tree
Showing 15 changed files with 3,663 additions and 3,343 deletions.
3 changes: 2 additions & 1 deletion src/azure-cli/azure/cli/command_modules/network/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2811,8 +2811,9 @@ def import_zone(cmd, resource_group_name, zone_name, file_name):
rs = _convert_to_snake_case(root_ns)
try:
rs["target_resource"] = rs.get("target_resource").get("id") if rs.get("target_resource") else None

_record_create = _record_create_func(rs_type)
if 'traffic_management_profile' in rs:
del rs['traffic_management_profile']
_record_create(cli_ctx=cmd.cli_ctx)(command_args={
'resource_group': resource_group_name,
'zone_name': zone_name,
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interactions:
- request:
body: '{"location": "global", "properties": {"zoneType": "Public"}}'
body: '{"location": "global"}'
headers:
Accept:
- application/json
Expand All @@ -11,18 +11,18 @@ interactions:
Connection:
- keep-alive
Content-Length:
- '60'
- '22'
Content-Type:
- application/json
ParameterSetName:
- -g -n
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/dnsZones/mytestzone2.com?api-version=2023-07-01-preview
response:
body:
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com","name":"mytestzone2.com","type":"Microsoft.Network\/dnszones","etag":"133357de-50ec-4d58-ba3e-c96cf2eeb6ea","location":"global","tags":{},"properties":{"maxNumberOfRecordSets":10000,"maxNumberOfRecordsPerRecordSet":null,"nameServers":["ns1-34.ppe.azure-dns.com.","ns2-34.ppe.azure-dns.net.","ns3-34.ppe.azure-dns.org.","ns4-34.ppe.azure-dns.info."],"numberOfRecordSets":2,"zoneType":"Public"}}'
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com","name":"mytestzone2.com","type":"Microsoft.Network\/dnszones","etag":"4dc65717-9cac-4bb8-b632-b1950f40bca9","location":"global","tags":{},"properties":{"maxNumberOfRecordSets":10000,"maxNumberOfRecordsPerRecordSet":null,"nameServers":["ns1-35.ppe.azure-dns.com.","ns2-35.ppe.azure-dns.net.","ns3-35.ppe.azure-dns.org.","ns4-35.ppe.azure-dns.info."],"numberOfRecordSets":2,"zoneType":"Public"}}'
headers:
cache-control:
- private
Expand All @@ -31,9 +31,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:20:57 GMT
- Tue, 19 Nov 2024 21:56:21 GMT
etag:
- 133357de-50ec-4d58-ba3e-c96cf2eeb6ea
- 4dc65717-9cac-4bb8-b632-b1950f40bca9
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
Expand All @@ -43,7 +43,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '11999'
x-msedge-ref:
- 'Ref A: 97026DB680074FEAB2354B49EA9C2C9D Ref B: CO6AA3150217027 Ref C: 2024-03-06T23:20:53Z'
- 'Ref A: 328C09CB1EE540F2B35DCF6338CA6801 Ref B: CO6AA3150220027 Ref C: 2024-11-19T21:56:18Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -70,21 +70,21 @@ interactions:
ParameterSetName:
- -g -n --unique-dns-name --routing-method
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/trafficmanagerprofiles/tm2?api-version=2022-04-01
response:
body:
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2","name":"tm2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Performance","dnsConfig":{"relativeName":"mytesttrafficmanager2","fqdn":"mytesttrafficmanager2.preprodtrafficmanager.azure","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null}}'
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2","name":"tm2","type":"Microsoft.Network\/trafficManagerProfiles","location":"global","properties":{"profileStatus":"Enabled","trafficRoutingMethod":"Performance","dnsConfig":{"relativeName":"mytesttrafficmanager2","fqdn":"mytesttrafficmanager2.trafficmanager.net","ttl":30},"monitorConfig":{"profileMonitorStatus":"Inactive","protocol":"HTTP","port":80,"path":"\/","intervalInSeconds":30,"toleratedNumberOfFailures":3,"timeoutInSeconds":10},"endpoints":[],"trafficViewEnrollmentStatus":"Disabled","maxReturn":null,"recordType":null}}'
headers:
cache-control:
- private
content-length:
- '687'
- '696'
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:21:01 GMT
- Tue, 19 Nov 2024 21:56:25 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains
x-aspnet-version:
Expand All @@ -96,7 +96,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '4499'
x-msedge-ref:
- 'Ref A: D9F124F61BB84CA19EEE855E5C282F03 Ref B: CO6AA3150218017 Ref C: 2024-03-06T23:20:58Z'
- 'Ref A: 26A60A2426864C49B64DBBB0FEC884FD Ref B: CO6AA3150217025 Ref C: 2024-11-19T21:56:22Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -120,12 +120,12 @@ interactions:
ParameterSetName:
- -g -z -n --traffic-management-profile
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/dnsZones/mytestzone2.com/A/tmlink?api-version=2023-07-01-preview
response:
body:
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"b5691ecd-07d9-44d3-892a-6074efef6eff","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"targetResource":{},"trafficManagementProfile":{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2"},"provisioningState":"Succeeded"}}'
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"f0132a2a-8875-457f-bb4b-f240bf0db66d","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"targetResource":{},"trafficManagementProfile":{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2"},"provisioningState":"Succeeded"}}'
headers:
cache-control:
- private
Expand All @@ -134,9 +134,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:21:17 GMT
- Tue, 19 Nov 2024 21:56:40 GMT
etag:
- b5691ecd-07d9-44d3-892a-6074efef6eff
- f0132a2a-8875-457f-bb4b-f240bf0db66d
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
Expand All @@ -146,7 +146,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '11999'
x-msedge-ref:
- 'Ref A: 2DBF10F499744FF4888B5587E30700CF Ref B: CO6AA3150219033 Ref C: 2024-03-06T23:21:05Z'
- 'Ref A: 5952406B87AC4E5DB3DC5AF328013A44 Ref B: CO6AA3150220031 Ref C: 2024-11-19T21:56:26Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -170,7 +170,7 @@ interactions:
ParameterSetName:
- --parameters
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: POST
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Network/getDnsResourceReference?api-version=2023-07-01-preview
response:
Expand All @@ -184,7 +184,7 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:21:18 GMT
- Tue, 19 Nov 2024 21:56:40 GMT
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
Expand All @@ -194,7 +194,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '499'
x-msedge-ref:
- 'Ref A: 875CDF24A1B2490A8927D4EF71E737FE Ref B: CO6AA3150220009 Ref C: 2024-03-06T23:21:18Z'
- 'Ref A: BD8B881D43A94CDA87CAD2D654B3F8B1 Ref B: CO6AA3150220037 Ref C: 2024-11-19T21:56:41Z'
x-powered-by:
- ASP.NET
status:
Expand All @@ -214,12 +214,12 @@ interactions:
ParameterSetName:
- -g -z -n --remove
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: GET
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/dnsZones/mytestzone2.com/A/tmlink?api-version=2023-07-01-preview
response:
body:
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"b5691ecd-07d9-44d3-892a-6074efef6eff","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"targetResource":{},"trafficManagementProfile":{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2"},"provisioningState":"Succeeded"}}'
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"f0132a2a-8875-457f-bb4b-f240bf0db66d","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"targetResource":{},"trafficManagementProfile":{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/trafficManagerProfiles\/tm2"},"provisioningState":"Succeeded"}}'
headers:
cache-control:
- private
Expand All @@ -228,9 +228,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:21:19 GMT
- Tue, 19 Nov 2024 21:56:42 GMT
etag:
- b5691ecd-07d9-44d3-892a-6074efef6eff
- f0132a2a-8875-457f-bb4b-f240bf0db66d
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
Expand All @@ -240,14 +240,14 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '499'
x-msedge-ref:
- 'Ref A: 89D7B44A77E44C24BFA9B7EF5D321922 Ref B: CO6AA3150217031 Ref C: 2024-03-06T23:21:20Z'
- 'Ref A: 0EB166E1E1134F8D889CBABF5D655254 Ref B: CO6AA3150220053 Ref C: 2024-11-19T21:56:42Z'
x-powered-by:
- ASP.NET
status:
code: 200
message: OK
- request:
body: '{"etag": "b5691ecd-07d9-44d3-892a-6074efef6eff", "properties": {"TTL":
body: '{"etag": "f0132a2a-8875-457f-bb4b-f240bf0db66d", "properties": {"TTL":
30}}'
headers:
Accept:
Expand All @@ -265,12 +265,12 @@ interactions:
ParameterSetName:
- -g -z -n --remove
User-Agent:
- AZURECLI/2.58.0 azsdk-python-core/1.28.0 Python/3.11.8 (Windows-10-10.0.26058-SP0)
- AZURECLI/2.67.0 azsdk-python-core/1.31.0 Python/3.8.10 (Windows-10-10.0.26100-SP0)
method: PUT
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_dns_tmlink000001/providers/Microsoft.Network/dnsZones/mytestzone2.com/A/tmlink?api-version=2023-07-01-preview
response:
body:
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"c56fff03-50eb-4007-9213-af508e1293e4","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"ARecords":[],"targetResource":{},"trafficManagementProfile":{},"provisioningState":"Succeeded"}}'
string: '{"id":"\/subscriptions\/00000000-0000-0000-0000-000000000000\/resourceGroups\/cli_test_dns_tmlink000001\/providers\/Microsoft.Network\/dnszones\/mytestzone2.com\/A\/tmlink","name":"tmlink","type":"Microsoft.Network\/dnszones\/A","etag":"4a1d04e7-ac8c-4514-bc5f-3435e5937d8a","properties":{"fqdn":"tmlink.mytestzone2.com.","TTL":30,"ARecords":[],"targetResource":{},"trafficManagementProfile":{},"provisioningState":"Succeeded"}}'
headers:
cache-control:
- private
Expand All @@ -279,9 +279,9 @@ interactions:
content-type:
- application/json; charset=utf-8
date:
- Wed, 06 Mar 2024 23:21:33 GMT
- Tue, 19 Nov 2024 21:56:55 GMT
etag:
- c56fff03-50eb-4007-9213-af508e1293e4
- 4a1d04e7-ac8c-4514-bc5f-3435e5937d8a
strict-transport-security:
- max-age=31536000; includeSubDomains
x-cache:
Expand All @@ -291,7 +291,7 @@ interactions:
x-ms-ratelimit-remaining-subscription-resource-requests:
- '11999'
x-msedge-ref:
- 'Ref A: 4BC134037524485AAAF61AB9D898C3C2 Ref B: CO6AA3150217031 Ref C: 2024-03-06T23:21:20Z'
- 'Ref A: 0D37EBF1D35A422EA202634C16B3C935 Ref B: CO6AA3150220053 Ref C: 2024-11-19T21:56:42Z'
x-powered-by:
- ASP.NET
status:
Expand Down
Loading

0 comments on commit 63474f5

Please sign in to comment.