Name
Invoke-JS7ApiRequest
SYNOPSIS
Sends a request to the JS7 REST Web Service.
SYNTAX
Invoke-JS7ApiRequest [-Path] <String> [[-Body] <PSObject>] [[-Method] <String>] [[-ContentType] <String>] [[-Headers] <Hashtable>] [[-AuditComment] <String>] [[-AuditTimeSpent] <Int32>] [[-AuditTicketLink] <Uri>] [<CommonParameters>]
DESCRIPTION
The JS7 REST Web Service accepts JSON based requests. This cmdlet therefore is generic to allow
any requests to be forwarded to JS7.
PARAMETERS
Path
-Path <String>
The Path specifies the part of URL that states the operation that is used for the request,
see http://test.sos-berlin.com/JOC/raml-doc/JOC-API/ for a complete list of Paths.
The Path is prefixed by the Base parameter.
* Example: http://localhost:4446/joc/api/tasks/history
* The URL scheme 'http' and authority 'localhost:4446' are used from the connection
that is specified to the Web Service by the Connect-JS7 cmdlet.
* The Base '/joc/api' is used for all REST Web Service requests.
* The Path '/tasks/history' is used to query the JS7 task history.
Required? | true |
Position? | 1 |
Default value | |
Accept pipeline input? | true (ByValue, ByPropertyName) |
Accept wildcard characters? | false |
Body
-Body <PSObject>
Specifies the request body that is sent to the RESTWeb Service. The body is a PowerShell object that is converted to
a JSON object by the cmdlet:
$body = New-Object PSObject
Add-Member -Membertype NoteProperty -Name 'controllerId' -value 'jobscheduler' -InputObject $body
Add-Member -Membertype NoteProperty -Name 'states' -value @('COUPLED', 'DECOUPLED', 'COUPLINGFAILED') -InputObject $body
$response = Invoke-JS7ApiRequest -Path '/agents' -Body $body
This request returns information about Agents filtered by the indicated states.
Required? | false |
Position? | 2 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Method
-Method <String>
This parameter specifies the HTTP method in use.
There should be no reason to modify the default value 'POST'.
Required? | false |
Position? | 3 |
Default value | POST |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
ContentType
-ContentType <String>
The HTTP content type is 'application/json' for JSON based requests.
Required? | false |
Position? | 4 |
Default value | application/json |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
Headers
-Headers <Hashtable>
A hashtable can be specified with name/value pairs for HTTP headers.
Typically the 'Accept' header is required for use of the REST API.
Required? | false |
Position? | 5 |
Default value | @{'Accept' = 'application/json'} |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
AuditComment
-AuditComment <String>
Specifies a free text that indicates the reason for the current intervention,
e.g. "business requirement", "maintenance window" etc.
The Audit Comment is visible from the Audit Log view of JOC Cockpit.
This parameter is not mandatory, however, JOC Cockpit can be configured
to enforece Audit Log comments for any interventions.
Required? | false |
Position? | 6 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
AuditTimeSpent
-AuditTimeSpent <Int32>
Specifies the duration in minutes that the current intervention required.
This information is visible with the Audit Log view. It can be useful when integrated
with a ticket system that logs the time spent on interventions with JobScheduler.
Required? | false |
Position? | 7 |
Default value | 0 |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
AuditTicketLink
-AuditTicketLink <Uri>
Specifies a URL to a ticket system that keeps track of any interventions performed for JobScheduler.
This information is visible with the Audit Log view of JOC Cockpit.
It can be useful when integrated with a ticket system that logs interventions with JobScheduler.
Required? | false |
Position? | 8 |
Default value | |
Accept pipeline input? | true (ByPropertyName) |
Accept wildcard characters? | false |
RELATED LINKS
EXAMPLES
-------------------------- EXAMPLE 1 --------------------------
PS > $body = New-Object PSObject
Add-Member -Membertype NoteProperty -Name 'controllerId' -value 'jobscheduler' -InputObject $body
Add-Member -Membertype NoteProperty -Name 'states' -value @('COUPLED', 'DECOUPLED', 'COUPLINGFAILED') -InputObject $body
$response = Invoke-JS7ApiRequest -Path '/agents' -Body $body
Returns information about Agents filtered by the indicated states.
-------------------------- EXAMPLE 2 --------------------------
PS > $response = Invoke-JS7ApiRequest -Path '/controllers'
Returns summary information about Controllers connected to JOC Cockpit.