Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Name

Get-JS7OrderLog

SYNOPSIS

Read Reads the order log from the JS7 History

...

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

...

Reads an order log for a given workflow, order Order ID and history 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 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.

...

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

...

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

...

PositionString

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

...

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

Read 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 Order ID.

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

PS > # execute once
$lastHistory = Get-JS7OrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime
# execute by interval 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

...