Skip to content

Commit e511b9b

Browse files
mchakkaManas ChakkaBethanyZhou
authored
Bug Fix for Viewing the PSPublicIpAddress & PSDdosProtectionPlan objects (#19981)
* bug fixes * small synatx fix * fixing indents * moving change log message * Update src/Network/Network/Network.format.ps1xml * Update src/Network/Network/ChangeLog.md * Update src/Network/Network/Network.format.ps1xml * adding breaking change file Co-authored-by: Manas Chakka <[email protected]> Co-authored-by: Beisi Zhou <[email protected]>
1 parent adc50b7 commit e511b9b

File tree

6 files changed

+45
-22
lines changed

6 files changed

+45
-22
lines changed

src/Network/Network/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
--->
2020

2121
## Upcoming Release
22+
* Fixed a bug that added Ddos related properties when viewing PublicIpAddress and DdosProtectionPlan objects
2223

2324
## Version 5.2.0
2425
* Added optional parameters `CustomBlockResponseStatusCode` and `CustomBlockResponseBody` parameter to `AzApplicationGatewayFirewallPolicySettings`

src/Network/Network/Models/PSDdosProtectionPlan.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class PSDdosProtectionPlan : PSTopLevelResource
2626

2727
public List<PSResourceId> VirtualNetworks { get; set; }
2828

29-
public List<PSResourceId> PublicIpAddresses { get; set; }
29+
public List<PSResourceId> PublicIPAddresses { get; set; }
3030

3131
[JsonIgnore]
3232
public string VirtualNetworksText
@@ -35,9 +35,9 @@ public string VirtualNetworksText
3535
}
3636

3737
[JsonIgnore]
38-
public string PublicIpAddressesText
38+
public string PublicIPAddressesText
3939
{
40-
get { return JsonConvert.SerializeObject(PublicIpAddresses, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
40+
get { return JsonConvert.SerializeObject(PublicIPAddresses, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
4141
}
4242
}
4343
}

src/Network/Network/Models/PSDdosSettings.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,13 @@
1212
// limitations under the License.
1313
// ----------------------------------------------------------------------------------
1414

15+
using Microsoft.WindowsAzure.Commands.Common.Attributes;
16+
1517
namespace Microsoft.Azure.Commands.Network.Models
1618
{
1719
public partial class PSDdosSettings
1820
{
19-
public string ProtectionMode;
21+
[Ps1Xml(Target = ViewControl.Table)]
22+
public string ProtectionMode { get; set; }
2023
}
2124
}

src/Network/Network/Models/PSPublicIpAddress.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ public string IpConfigurationText
5757
get { return JsonConvert.SerializeObject(IpConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
5858
}
5959

60+
[JsonIgnore]
61+
public string DdosSettingsText
62+
{
63+
get { return JsonConvert.SerializeObject(DdosSettings, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
64+
}
65+
6066
[JsonIgnore]
6167
public string DnsSettingsText
6268
{

src/Network/Network/Network.format.ps1xml

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -983,15 +983,15 @@
983983
<ListItem>
984984
<Label>CustomRoutes</Label>
985985
<PropertyName>CustomRoutesText</PropertyName>
986-
</ListItem>
986+
</ListItem>
987987
<ListItem>
988988
<Label>NatRules</Label>
989989
<PropertyName>NatRulesText</PropertyName>
990990
</ListItem>
991-
<ListItem>
992-
<Label>ExtendedLocation</Label>
993-
<PropertyName>ExtendedLocationText</PropertyName>
994-
</ListItem>
991+
<ListItem>
992+
<Label>ExtendedLocation</Label>
993+
<PropertyName>ExtendedLocationText</PropertyName>
994+
</ListItem>
995995
<ListItem>
996996
<Label>EnableBgpRouteTranslationForNat</Label>
997997
<PropertyName>EnableBgpRouteTranslationForNat</PropertyName>
@@ -1578,6 +1578,10 @@
15781578
<Label>DnsSettings</Label>
15791579
<PropertyName>DnsSettingsText</PropertyName>
15801580
</ListItem>
1581+
<ListItem>
1582+
<Label>DdosSettings</Label>
1583+
<PropertyName>DdosSettingsText</PropertyName>
1584+
</ListItem>
15811585
<ListItem>
15821586
<Label>Zones</Label>
15831587
<PropertyName>Zones</PropertyName>
@@ -4089,6 +4093,10 @@
40894093
<Label>VirtualNetworks</Label>
40904094
<PropertyName>VirtualNetworksText</PropertyName>
40914095
</ListItem>
4096+
<ListItem>
4097+
<Label>PublicIPAddresses</Label>
4098+
<PropertyName>PublicIPAddressesText</PropertyName>
4099+
</ListItem>
40924100
</ListItems>
40934101
</ListEntry>
40944102
</ListEntries>
@@ -5361,19 +5369,19 @@
53615369
<Label>ExtendedLocation</Label>
53625370
<PropertyName>ExtendedLocationText</PropertyName>
53635371
</ListItem>
5364-
<ListItem>
5365-
<Label>ApplicationSecurityGroups</Label>
5366-
<PropertyName>ApplicationSecurityGroupsText</PropertyName>
5367-
</ListItem>
5368-
<ListItem>
5369-
<Label>IpConfigurations</Label>
5370-
<PropertyName>IpConfigurationsText</PropertyName>
5371-
</ListItem>
5372-
<ListItem>
5373-
<Label>CustomNetworkInterfaceName</Label>
5374-
<PropertyName>CustomNetworkInterfaceName</PropertyName>
5375-
</ListItem>
5376-
</ListItems>
5372+
<ListItem>
5373+
<Label>ApplicationSecurityGroups</Label>
5374+
<PropertyName>ApplicationSecurityGroupsText</PropertyName>
5375+
</ListItem>
5376+
<ListItem>
5377+
<Label>IpConfigurations</Label>
5378+
<PropertyName>IpConfigurationsText</PropertyName>
5379+
</ListItem>
5380+
<ListItem>
5381+
<Label>CustomNetworkInterfaceName</Label>
5382+
<PropertyName>CustomNetworkInterfaceName</PropertyName>
5383+
</ListItem>
5384+
</ListItems>
53775385
</ListEntry>
53785386
</ListEntries>
53795387
</ListControl>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Module,ClassName,Target,Severity,ProblemId,Description,Remediation
2+
"""Az.Network""",Microsoft.Azure.Commands.Network.Automation.GetAzureRmDdosProtectionPlan,Get-AzDdosProtectionPlan,0,3010,The property 'PublicIpAddresses' of type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan' has been removed.,Add the property 'PublicIpAddresses' back to type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan'.
3+
"""Az.Network""",Microsoft.Azure.Commands.Network.Automation.GetAzureRmDdosProtectionPlan,Get-AzDdosProtectionPlan,0,3010,The property 'PublicIpAddressesText' of type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan' has been removed.,Add the property 'PublicIpAddressesText' back to type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan'.
4+
"""Az.Network""",Microsoft.Azure.Commands.Network.NewAzureRmDdosProtectionPlan,New-AzDdosProtectionPlan,0,3010,The property 'PublicIpAddresses' of type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan' has been removed.,Add the property 'PublicIpAddresses' back to type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan'.
5+
"""Az.Network""",Microsoft.Azure.Commands.Network.NewAzureRmDdosProtectionPlan,New-AzDdosProtectionPlan,0,3010,The property 'PublicIpAddressesText' of type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan' has been removed.,Add the property 'PublicIpAddressesText' back to type 'Microsoft.Azure.Commands.Network.Models.PSDdosProtectionPlan'.

0 commit comments

Comments
 (0)