Page History
Name
Get-JS7OrderLog
SYNOPSIS
Read Reads the order log from the JS7 History.
SYNTAX
Get-JS7OrderLog [[-HistoryIdControllerId] <String>] [[-OrderIdHistoryId] <String> ] [[-WorkflowPathOrderId] <String>] [[-FolderWorkflow] <String>] [-Recursive] [[-PathPositionString] <String>] [[-NodeState] <String><PSObject>] [[-StartTimePlannedTime] <DateTime>] [[-EndTimeStartTime] <DateTime>] [[-ExitCode] <Int32>] [[-State] <PSObject>] [[-ControllerId] <String>EndTime] <DateTime>] [<CommonParameters>]
DESCRIPTION
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-JobSchedulerOrderHistory 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
-HistoryId ControllerId <String>
Specifies the history ID that the order was running for. This information is provided by the
Get-JobSchedulerOrderHistory cmdlet 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 (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
HistoryId
-OrderId HistoryId <String>
This parameter specifies Specifies the History ID that the order that was running for the given history ID. This information is provided by the
Get-JS7OrderHistory cmdlet.
Required? | falsetrue |
Position? | 2 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
OrderId
-WorkflowPath <String>
...
Folder
-Folder <String>
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? | 43 | |
Default value | / | |
Accept pipeline input? | true (ByValue, ByPropertyName) | |
Accept wildcard characters? | false |
Recursive
-Recursive <SwitchParameter>
Required? | false |
Position? | named |
Default value | False |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
Path
Workflow
-Workflow -Path <String>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false |
Position? | 54 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
PositionString
-Node PositionString <String>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false |
Position? | 65 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
State
-StartTime <DateTime>State <PSObject>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false |
Position? | 76 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
PlannedTime
-EndTime PlannedTime <DateTime>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false |
Position? | 87 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
StartTime
-ExitCode <Int32>StartTime <DateTime>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false | |
Position? | 98 | |
Default value | 0 | |
Accept pipeline input? | true (ByValue, ByPropertyName) | |
Accept wildcard characters? | false |
...
EndTime
-State <PSObject>EndTime <DateTime>
This parameter is used to accept pipeline input from the Get-JobSchedulerOrderHistory JS7OrderHistory cmdlet and forwards the parameter to the resulting object.
Required? | false |
Position? | 109 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
...
-ControllerId <String>
...
RELATED LINKS
EXAMPLES
...
PS > Get-JS7OrderHistory -Workflow WorkflowPath /product_demo/shellsample_chain workflow | Get-JobSchedulerOrderLogJS7OrderLog
Retrieves Returns the most recent order log for the given workflow.
...
PS > Get-JS7OrderHistory -Workflow WorkflowPath /product_demo/shellsample_chain workflow | Get-JobSchedulerOrderLog JS7OrderLog | Out-File /tmp/shell_chain.log -Encoding Unicode
...
PS > Get-JS7OrderHistory -RelativeDateFrom -8h | Get-JobSchedulerOrderLog 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-JobSchedulerOrderHistory JS7OrderHistory -RelativeDateFrom -8h | Sort-Object -Property startTime
# execute by interval in intervals
Get-JS7OrderHistory -DateFrom $lastHistory[0].startTime | Tee-Object -Variable lastHistory | Get-JobSchedulerOrderLog 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-JobSchedulerOrderHistory 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.