|
| 1 | +// ---------------------------------------------------------------------------------- |
| 2 | +// |
| 3 | +// Copyright Microsoft Corporation |
| 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 | +// Unless required by applicable law or agreed to in writing, software |
| 9 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 10 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 11 | +// See the License for the specific language governing permissions and |
| 12 | +// limitations under the License. |
| 13 | +// ---------------------------------------------------------------------------------- |
| 14 | + |
| 15 | +using System; |
| 16 | +using System.Collections.Generic; |
| 17 | +using System.Linq; |
| 18 | +using System.Management.Automation; |
| 19 | +using Microsoft.Azure.Commands.Network.Models; |
| 20 | + |
| 21 | +namespace Microsoft.Azure.Commands.Network.AzureFirewall.ThreatIntelWhitelist |
| 22 | +{ |
| 23 | + [Cmdlet(VerbsCommon.New, ResourceManager.Common.AzureRMConstants.AzureRMPrefix + "FirewallThreatIntelWhitelist", SupportsShouldProcess = true), OutputType(typeof(PSAzureFirewallThreatIntelWhitelist))] |
| 24 | + class NewAzureFirewallThreatIntelWhitelistCommand : AzureFirewallBaseCmdlet |
| 25 | + { |
| 26 | + [Parameter( |
| 27 | + Mandatory = false, |
| 28 | + HelpMessage = "The FQDNs of the Threat Intel Whitelist")] |
| 29 | + [ValidateNotNull] |
| 30 | + public string FQDNs { get; set; } |
| 31 | + |
| 32 | + [Parameter( |
| 33 | + Mandatory = false, |
| 34 | + HelpMessage = "The IP Addresses of the Threat Intel Whitelist")] |
| 35 | + [ValidateNotNull] |
| 36 | + public string IpAddresses { get; set; } |
| 37 | + |
| 38 | + public override void Execute() |
| 39 | + { |
| 40 | + base.Execute(); |
| 41 | + |
| 42 | + var threatIntelWhitelist = new PSAzureFirewallThreatIntelWhitelist |
| 43 | + { |
| 44 | + FQDNs = this.FQDNs, |
| 45 | + IpAddresses = this.IpAddresses |
| 46 | + }; |
| 47 | + WriteObject(threatIntelWhitelist); |
| 48 | + } |
| 49 | + } |
| 50 | +} |
0 commit comments