Skip to content

Commit c2a8908

Browse files
committed
BUG: 3323448 expose 'etag' above properties
CloudDNS should expose 'etag' above properties, not within properties
1 parent 11e985a commit c2a8908

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/ResourceManager/Dns/Commands.Dns/Commands.Dns.csproj

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@
9999
<SpecificVersion>False</SpecificVersion>
100100
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Authorization.0.18.0-preview\lib\net40\Microsoft.Azure.Management.Authorization.dll</HintPath>
101101
</Reference>
102-
<Reference Include="Microsoft.Azure.Management.Dns, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
103-
<SpecificVersion>False</SpecificVersion>
104-
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Dns.1.1.1-preview\lib\net40\Microsoft.Azure.Management.Dns.dll</HintPath>
102+
<Reference Include="Microsoft.Azure.Management.Dns">
103+
<HintPath>..\..\..\packages\Microsoft.Azure.Management.Dns.1.2.1-preview\lib\net40\Microsoft.Azure.Management.Dns.dll</HintPath>
105104
</Reference>
106105
<Reference Include="Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
107106
<HintPath>..\..\..\packages\Microsoft.Data.Edm.5.6.0\lib\net40\Microsoft.Data.Edm.dll</HintPath>

src/ResourceManager/Dns/Commands.Dns/Models/DnsClient.cs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,11 @@ public DnsZone CreateDnsZone(string name, string resourceGroupName, Hashtable[]
5757
Location = DnsResourceLocation,
5858
Name = name,
5959
Tags = TagsConversionHelper.CreateTagDictionary(tags, validate: true),
60+
ETag = null,
6061
Properties = new ZoneProperties
6162
{
62-
ETag = null,
63+
NumberOfRecordSets = null,
64+
MaxNumberOfRecordSets = null,
6365
}
6466
}
6567
});
@@ -68,7 +70,7 @@ public DnsZone CreateDnsZone(string name, string resourceGroupName, Hashtable[]
6870
{
6971
Name = response.Zone.Name,
7072
ResourceGroupName = resourceGroupName,
71-
Etag = response.Zone.Properties.ETag,
73+
Etag = response.Zone.ETag,
7274
Tags = TagsConversionHelper.CreateTagHashtable(response.Zone.Tags),
7375
};
7476
}
@@ -85,9 +87,9 @@ public DnsZone UpdateDnsZone(DnsZone zone, bool overwrite)
8587
Location = DnsResourceLocation,
8688
Name = zone.Name,
8789
Tags = TagsConversionHelper.CreateTagDictionary(zone.Tags, validate: true),
90+
ETag = overwrite ? "*" : zone.Etag,
8891
Properties = new ZoneProperties
8992
{
90-
ETag = overwrite ? "*" : zone.Etag,
9193
}
9294
}
9395
});
@@ -96,7 +98,7 @@ public DnsZone UpdateDnsZone(DnsZone zone, bool overwrite)
9698
{
9799
Name = response.Zone.Name,
98100
ResourceGroupName = zone.ResourceGroupName,
99-
Etag = response.Zone.Properties.ETag,
101+
Etag = response.Zone.ETag,
100102
Tags = TagsConversionHelper.CreateTagHashtable(response.Zone.Tags),
101103
};
102104
}
@@ -121,7 +123,7 @@ public DnsZone GetDnsZone(string name, string resourceGroupName)
121123
{
122124
Name = getResponse.Zone.Name,
123125
ResourceGroupName = resourceGroupName,
124-
Etag = getResponse.Zone.Properties.ETag,
126+
Etag = getResponse.Zone.ETag,
125127
Tags = TagsConversionHelper.CreateTagHashtable(getResponse.Zone.Tags),
126128
};
127129
}
@@ -138,7 +140,7 @@ public List<DnsZone> ListDnsZones(string resourceGroupName, string endsWith)
138140
{
139141
Name = zoneInResponse.Name,
140142
ResourceGroupName = resourceGroupName,
141-
Etag = zoneInResponse.Properties.ETag,
143+
Etag = zoneInResponse.ETag,
142144
Tags = TagsConversionHelper.CreateTagHashtable(zoneInResponse.Tags),
143145
})
144146
.ToList();
@@ -159,9 +161,9 @@ public DnsRecordSet CreateDnsRecordSet(string zoneName, string resourceGroupName
159161
Name = relativeRecordSetName,
160162
Location = DnsResourceLocation,
161163
Tags = TagsConversionHelper.CreateTagDictionary(tags, validate: true),
164+
ETag = null,
162165
Properties = new RecordSetProperties
163166
{
164-
ETag = null,
165167
Ttl = ttl,
166168
AaaaRecords = recordType == RecordType.AAAA ? new List<Management.Dns.Models.AaaaRecord>() : null,
167169
ARecords = recordType == RecordType.A ? new List<Management.Dns.Models.ARecord>() : null,
@@ -194,9 +196,9 @@ public DnsRecordSet UpdateDnsRecordSet(DnsRecordSet recordSet, bool overwrite)
194196
Name = recordSet.Name,
195197
Location = DnsResourceLocation,
196198
Tags = TagsConversionHelper.CreateTagDictionary(recordSet.Tags, validate: true),
199+
ETag = overwrite ? "*" : recordSet.Etag,
197200
Properties = new RecordSetProperties
198201
{
199-
ETag = overwrite ? "*" : recordSet.Etag,
200202
Ttl = recordSet.Ttl,
201203
AaaaRecords = recordSet.RecordType == RecordType.AAAA ? GetMamlRecords<AaaaRecord, Management.Dns.Models.AaaaRecord>(recordSet.Records) : null,
202204
ARecords = recordSet.RecordType == RecordType.A ? GetMamlRecords<ARecord, Management.Dns.Models.ARecord>(recordSet.Records) : null,
@@ -271,7 +273,7 @@ private static DnsRecordSet GetPowerShellRecordSet(string zoneName, string resou
271273

272274
return new DnsRecordSet
273275
{
274-
Etag = mamlRecordSet.Properties.ETag,
276+
Etag = mamlRecordSet.ETag,
275277
Name = mamlRecordSet.Name,
276278
RecordType = recordType,
277279
Records = GetPowerShellRecords(mamlRecordSet),

src/ResourceManager/Dns/Commands.Dns/packages.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<package id="Microsoft.Azure.Common.Authentication" version="1.0.21-preview" targetFramework="net45" />
66
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
77
<package id="Microsoft.Azure.Management.Authorization" version="0.18.0-preview" targetFramework="net45" />
8-
<package id="Microsoft.Azure.Management.Dns" version="1.1.1-preview" targetFramework="net45" />
8+
<package id="Microsoft.Azure.Management.Dns" version="1.2.1-preview" targetFramework="net45" />
99
<package id="Microsoft.Azure.Management.Resources" version="2.14.1-preview" targetFramework="net45" />
1010
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
1111
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net45" />

0 commit comments

Comments
 (0)