Public/Observability/Suspend-R1Pipeline.ps1

# .ExternalHelp psRadiantOne-help.xml
function Suspend-R1Pipeline {
    [CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Medium')]
    [OutputType([void])]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelineByPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [string]$pipelineId
    )

    Begin {

        Assert-R1Session -RequireToken

    }#begin

    Process {

        $URI = Resolve-R1ServiceUrl -Service Settings -Path "identity_observability/$($pipelineId | Get-EscapedString)/suspend"

        if ($PSCmdlet.ShouldProcess($pipelineId, 'Suspend Pipeline')) {

            $null = Invoke-R1RestMethod -Uri $URI -Method POST

        }

    }#process

    End { }#end

}