Enable Server Port

A10.Task.EnableServerPort (Task)

This task enable the specified server port.

Element properties:

TargetA10.ServerPort
AccessibilityInternal
CategoryOperations
EnabledTrue
RemotableFalse
Timeout300

Member Modules:

ID Module Type TypeId RunAs 
Probe ProbeAction Microsoft.Windows.PowerShellProbe Default

Source Code:

<Task ID="A10.Task.EnableServerPort" Accessibility="Internal" Target="A10.ServerPort" Enabled="true" Timeout="300" Remotable="true">
<Category>Operations</Category>
<ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.PowerShellProbe">
<ScriptName>EnablePort.ps1</ScriptName>
<ScriptBody><Script>param($IP, $ServerName, $Port, $Protocol, $UserName, $Password)

$path = Get-ItemProperty 'HKLM:\SOFTWARE\A10 Networks\A10 Management Pack' Path

$str = $path.Path
$env:PSModulePath += ";$str"

Import-Module AXCmdlet

if([String]::IsNullOrEmpty($IP))
{
throw "IP address is empty."
}
if([String]::IsNullOrEmpty($ServerName))
{
throw "Server Name is empty."
}

if([String]::IsNullOrEmpty($Port))
{
throw "Port is empty."
}

if([String]::IsNullOrEmpty($Protocol))
{
throw "Protocol is empty."
}

if([String]::IsNullOrEmpty($UserName))
{
throw "UserName is empty."
}
if([String]::IsNullOrEmpty($Password))
{
throw "Password is empty."
}
$con = Get-Connection -UserName $UserName -PassWd $Password -Host $IP

Enable-ServerPort -AXDevice $con -Name $ServerName -PortNum $Port -Protocol $Protocol

Close-Connection $con</Script></ScriptBody>
<SnapIns/>
<Parameters>
<Parameter>
<Name>IP</Name>
<Value>$Target/Host/Host/Host/Host/Host/Property[Type="SNL!System.NetworkManagement.Node"]/SNMPAddress$</Value>
</Parameter>
<Parameter>
<Name>ServerName</Name>
<Value>$Target/Host/Property[Type="A10.Server"]/Name$</Value>
</Parameter>
<Parameter>
<Name>Port</Name>
<Value>$Target/Property[Type="A10.ServerPort"]/PortNum$</Value>
</Parameter>
<Parameter>
<Name>Protocol</Name>
<Value>$Target/Property[Type="A10.ServerPort"]/Protocol$</Value>
</Parameter>
<Parameter>
<Name>UserName</Name>
<Value>$RunAs[Name="A10.Account"]/UserName$</Value>
</Parameter>
<Parameter>
<Name>PassWord</Name>
<Value>$RunAs[Name="A10.Account"]/Password$</Value>
</Parameter>
</Parameters>
<TimeoutSeconds>300</TimeoutSeconds>
<StrictErrorHandling>true</StrictErrorHandling>
</ProbeAction>
</Task>