Name

Get-JS7OrderLog

SYNOPSIS

Reads the order log from the JS7 History

SYNTAX

Get-JS7OrderLog [[-ControllerId] <String>] [-HistoryId] <String> [[-OrderId] <String>] [[-Workflow] <String>] [[-PositionString] <String>] [[-State] <PSObject>] [[-PlannedTime] <DateTime>] [[-StartTime] <DateTime>] [[-EndTime] <DateTime>] [<CommonParameters>]

DESCRIPTION

Reads an order log for a given workflow, Order ID and History ID. This cmdlet is mostly used for pipelined input from the
Get-JS7OrderHistory cmdlet that allows to search the execution history of orders and
that returns History IDs that are used by this cmdlet to retrieve the order's log output.

The following REST Web Service API resources are used:

* /order/log/download

PARAMETERS

ControllerId

-ControllerId <String>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?1
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

HistoryId

-HistoryId <String>
Specifies the History ID that the order was running for. This information is provided by the
Get-JS7OrderHistory cmdlet.

Required?true
Position?2
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

OrderId

-OrderId <String>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?3
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Workflow

-Workflow <String>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?4
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

PositionString

-PositionString <String>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?5
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

State

-State <PSObject>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?6
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

PlannedTime

-PlannedTime <DateTime>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?7
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

StartTime

-StartTime <DateTime>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?8
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

EndTime

-EndTime <DateTime>
This parameter is used to accept pipeline input from the Get-JS7OrderHistory cmdlet and forwards the parameter to the resulting object.

Required?false
Position?9
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

about_JS7

EXAMPLES

-------------------------- EXAMPLE 1 --------------------------

PS > Get-JS7OrderHistory -WorkflowPath /product_demo/sample_workflow | Get-JS7OrderLog

Returns the most recent order log for the given workflow.

-------------------------- EXAMPLE 2 --------------------------

PS > Get-JS7OrderHistory -WorkflowPath /product_demo/sample_workflow | Get-JS7OrderLog | Out-File /tmp/shell_chain.log -Encoding Unicode

Writes the order log to a file.

-------------------------- EXAMPLE 3 --------------------------

PS > Get-JS7OrderHistory -RelativeDateFrom -8h | Get-JS7OrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.workflow))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content

Reads the logs of orders that completed within the last 8 hours and writes the log output to individual files. The log file names are created from the start time, the workflow name and Order ID.

-------------------------- EXAMPLE 4 --------------------------

PS > # execute once
$lastHistory = Get-JS7OrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime
# execute in intervals
Get-JS7OrderHistory -DateFrom $lastHistory[0].startTime | Tee-Object -Variable lastHistory | Get-JS7OrderLog | Select-Object @{name='path'; expression={ "/tmp/history/$(Get-Date $_.startTime -f 'yyyyMMdd-hhmmss')-$([io.path]::GetFileNameWithoutExtension($_.workflow))-$($_.orderId).log"}}, @{name='value'; expression={ $_.log }} | Set-Content

Provides a mechanism to subsequently retrieve previous logs. Starting from initial execution of the Get-JS7OrderHistory cmdlet the resulting $lastHistory object is used for any subsequent calls. Consider use of the Tee-Object cmdlet in the pipeline that updates the $lastHistory object that can be used for later executions of the same pipeline. The pipeline can e.g. be executed in a cyclic job.

  • No labels