Skip to content

Commit 84d16bf

Browse files
Merge pull request Azure#1 from DeepakRajendranMsft/NetworkSecurityGroup
Network security group
2 parents b5548d3 + e672e1c commit 84d16bf

28 files changed

+1089
-6
lines changed

src/ResourceManager/Network/Commands.NetworkResourceProvider/Commands.NetworkResourceProvider.csproj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,12 @@
190190
<Compile Include="LoadBalancer\Probe\RemoveAzureLoadBalancerProbeCmdlet.cs" />
191191
<Compile Include="LoadBalancer\RemoveAzureLoadBalancerCmdlet.cs" />
192192
<Compile Include="LoadBalancer\SetAzureLoadBalancerCmdlet.cs" />
193+
<Compile Include="Models\PSNetworkSecurityGroup.cs" />
194+
<Compile Include="Models\PSNetworkSecurityGroupCreateOrUpdateParameters.cs" />
195+
<Compile Include="Models\PSNetworkSecurityGroupProperties.cs" />
196+
<Compile Include="Models\PSSecurityRule.cs" />
197+
<Compile Include="Models\PsSecurityRuleCreateOrUpdateParameters.cs" />
198+
<Compile Include="Models\PSSecurityRuleProperties.cs" />
193199
<Compile Include="Models\PSBackendAddressPool.cs" />
194200
<Compile Include="Models\PSBackendAddressPoolProperties.cs" />
195201
<Compile Include="Models\PSFrontendIpConfiguration.cs" />
@@ -229,6 +235,17 @@
229235
<Compile Include="NetworkInterface\NetworkInterfaceBaseClient.cs" />
230236
<Compile Include="NetworkInterface\NewAzureNetworkInterfaceCmdlet.cs" />
231237
<Compile Include="NetworkInterface\SetAzureNetworkInterfaceCmdlet.cs" />
238+
<Compile Include="NetworkSecurityGroup\GetAzureNetworkSecurityGroupCmdlet.cs" />
239+
<Compile Include="NetworkSecurityGroup\NetworkSecurityGroupBaseClient.cs" />
240+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\NewAzureNetworkSecurityRuleConfigCmdlet.cs" />
241+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\GetAzureNetworkSecurityRuleConfigCmdlet.cs" />
242+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\RemoveAzureNetworkSecurityRuleConfigCmdlet.cs" />
243+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\SetAzureNetworkSecurityRuleConfigCmdlet.cs" />
244+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\AddAzureNetworkSecurityRuleConfigCmdlet.cs" />
245+
<Compile Include="NetworkSecurityGroup\NetworkSecurityRule\CommonAzureNetworkSecurityRuleConfigCmdlet.cs" />
246+
<Compile Include="NetworkSecurityGroup\NewAzureNetworkSecurityGroupCmdlet.cs" />
247+
<Compile Include="NetworkSecurityGroup\RemoveAzureNetworkSecurityGroupCmdlet.cs" />
248+
<Compile Include="NetworkSecurityGroup\SetAzureNetworkSecurityGroupCmdlet.cs" />
232249
<Compile Include="Properties\AssemblyInfo.cs" />
233250
<Compile Include="Properties\Resources.Designer.cs">
234251
<DependentUpon>Resources.resx</DependentUpon>

src/ResourceManager/Network/Commands.NetworkResourceProvider/Common/NetworkResourceManagerProfile.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,24 @@ protected override void Configure()
172172
// MNM to CNM
173173
Mapper.CreateMap<MNM.InboundNatRule, CNM.PSInboundNatRule>();
174174
Mapper.CreateMap<MNM.InboundNatRuleProperties, CNM.PSInboundNatRuleProperties>();
175+
176+
// NetworkSecurityGroups
177+
// CNM to MNM
178+
Mapper.CreateMap<CNM.PSNetworkSecurityGroup, MNM.NetworkSecurityGroupCreateOrUpdateParameters>();
179+
Mapper.CreateMap<CNM.PSNetworkSecurityGroupProperties, MNM.NetworkSecurityGroupProperties>();
180+
181+
// MNM to CNM
182+
Mapper.CreateMap<MNM.NetworkSecurityGroup, CNM.PSNetworkSecurityGroup>();
183+
Mapper.CreateMap<MNM.NetworkSecurityGroupProperties, CNM.PSNetworkSecurityGroupProperties>();
184+
185+
// NetworkSecrityRule
186+
// CNM to MNM
187+
Mapper.CreateMap<CNM.PSSecurityRule, MNM.SecurityRule>();
188+
Mapper.CreateMap<CNM.PSSecurityRuleProperties, MNM.SecurityRuleProperties>();
189+
190+
// MNM to CNM
191+
Mapper.CreateMap<MNM.SecurityRule, CNM.PSSecurityRule>();
192+
Mapper.CreateMap<MNM.SecurityRuleProperties, CNM.PSSecurityRuleProperties>();
175193
}
176194
}
177195
}

src/ResourceManager/Network/Commands.NetworkResourceProvider/Microsoft.Azure.Commands.NetworkResourceProvider.format.ps1xml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,47 @@
169169
</ListEntries>
170170
</ListControl>
171171
</View>
172+
<View>
173+
<Name>Microsoft.Azure.Commands.NetworkResourceProvider.Models.PSNetworkSecurityGroup</Name>
174+
<ViewSelectedBy>
175+
<TypeName>Microsoft.Azure.Commands.NetworkResourceProvider.Models.PSNetworkSecurityGroup</TypeName>
176+
</ViewSelectedBy>
177+
<ListControl>
178+
<ListEntries>
179+
<ListEntry>
180+
<ListItems>
181+
<ListItem>
182+
<Label>Name</Label>
183+
<PropertyName>Name</PropertyName>
184+
</ListItem>
185+
<ListItem>
186+
<Label>ResourceGroupName</Label>
187+
<PropertyName>ResourceGroupName</PropertyName>
188+
</ListItem>
189+
<ListItem>
190+
<Label>Location</Label>
191+
<PropertyName>Location</PropertyName>
192+
</ListItem>
193+
<ListItem>
194+
<Label>Id</Label>
195+
<PropertyName>Id</PropertyName>
196+
</ListItem>
197+
<ListItem>
198+
<Label>Etag</Label>
199+
<PropertyName>Etag</PropertyName>
200+
</ListItem>
201+
<ListItem>
202+
<Label>Tags</Label>
203+
<PropertyName>TagsTable</PropertyName>
204+
</ListItem>
205+
<ListItem>
206+
<Label>Properties</Label>
207+
<PropertyName>PropertiesText</PropertyName>
208+
</ListItem>
209+
</ListItems>
210+
</ListEntry>
211+
</ListEntries>
212+
</ListControl>
213+
</View>
172214
</ViewDefinitions>
173215
</Configuration>

src/ResourceManager/Network/Commands.NetworkResourceProvider/Models/PSNetworkInterfaceProperties.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,6 @@ public class PSNetworkInterfaceProperties : PSResourceProperties
2626

2727
public string MacAddress { get; set; }
2828

29+
public PSResourceId NetworkSecurityGroup { get; set; }
2930
}
3031
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
using Newtonsoft.Json;
17+
18+
namespace Microsoft.Azure.Commands.NetworkResourceProvider.Models
19+
{
20+
public class PSNetworkSecurityGroup : PSTopLevelResource
21+
{
22+
public PSNetworkSecurityGroupProperties Properties { get; set; }
23+
24+
public string PropertiesText
25+
{
26+
get { return JsonConvert.SerializeObject(Properties, Formatting.Indented); }
27+
}
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
namespace Microsoft.Azure.Commands.NetworkResourceProvider.Models
17+
{
18+
public class PSNetworkSecurityGroupCreateOrUpdateParameters : PSNetworkSecurityGroup
19+
{
20+
}
21+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
namespace Microsoft.Azure.Commands.NetworkResourceProvider.Models
17+
{
18+
using System.Collections.Generic;
19+
20+
public class PSNetworkSecurityGroupProperties : PSResourceProperties
21+
{
22+
public List<PSSecurityRule> SecurityRules { get; set; }
23+
24+
public List<PSSecurityRule> DefaultSecurityRules { get; set; }
25+
26+
public List<PSResourceId> NetworkInterfaces { get; set; }
27+
28+
public List<PSResourceId> Subnets { get; set; }
29+
}
30+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
namespace Microsoft.Azure.Commands.NetworkResourceProvider.Models
17+
{
18+
public class PSSecurityRule : PSChildResource
19+
{
20+
public PSSecurityRuleProperties Properties { get; set; }
21+
}
22+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//
2+
// Copyright (c) Microsoft. All rights reserved.
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
16+
namespace Microsoft.Azure.Commands.NetworkResourceProvider.Models
17+
{
18+
public class PSSecurityRuleProperties : PSResourceProperties
19+
{
20+
public string Description { get; set; }
21+
22+
public string Protocol { get; set; }
23+
24+
public string SourcePortRange { get; set; }
25+
26+
public string DestinationPortRange { get; set; }
27+
28+
public string SourceAddressPrefix { get; set; }
29+
30+
public string DestinationAddressPrefix { get; set; }
31+
32+
public string Access { get; set; }
33+
34+
public int Priority { get; set; }
35+
36+
public string Direction { get; set; }
37+
}
38+
}

src/ResourceManager/Network/Commands.NetworkResourceProvider/Models/PSSubnetProperties.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ public class PSSubnetProperties : PSResourceProperties
2323
public PSDhcpOptions DhcpOptions { get; set; }
2424

2525
public List<PSResourceId> IpConfigurations { get; set; }
26+
27+
public PSResourceId NetworkSecurityGroup { get; set; }
2628
}
2729
}

0 commit comments

Comments
 (0)