Public/Database/Agents/Set-SecureSphereDBDataInterfaceToService.ps1
function Set-SecureSphereDBDataInterfaceToService { # .ExternalHelp ..\..\..\..\..\SecureSpherePS-help.xml [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $SiteName, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $ServerGroupName, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $DBServiceName, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $AgentName, [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [UInt64] $DataInterfaceID ) Begin { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Function started" if ($null -eq $SecureSphereSession) { Write-Error "Please login to SecureSphere first. Use Set-SecureSphereServer and New-SecureSphereSession cmdlets." break } $ApiUrl = "$SecureSphereHost/SecureSphere/api/v1/conf/dbServices/$SiteName/$ServerGroupName/$DBServiceName/agents/$AgentName/dataInterfaces/$DataInterfaceID" } Process { Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] ParameterSetName: $($PsCmdlet.ParameterSetName)" Write-DebugMessage "[$($MyInvocation.MyCommand.Name)] PSBoundParameters: $($PSBoundParameters | Out-String)" try { $Result = Invoke-RestMethod -Method Post -Uri $ApiUrl -ContentType "application/json" -WebSession $SecureSphereSession } catch { Write-Error "$_" } return $Result } End { Write-Verbose "[$($MyInvocation.MyCommand.Name)] Complete" } } |