Name

Send-JobSchedulerRequest

SYNOPSIS

Sends a JSON request or XMl command to the JobScheduler Web Service.

SYNTAX

Send-JobSchedulerRequest [-Path] <String> [-Body] <String> [[-Id] <String>] [[-Base] <String>] [[-Method] <String>] [[-ContentType] <String>] [[-Headers] <Hashtable>] [<CommonParameters>]

DESCRIPTION

The JobScheduler Web Service accepts JSON requests and a number of XML commands.

This cmdlet accepts

* JSON requests and forwards them to the JOC Cockpit REST Web Service.
* XML commands and forwards them to the JobScheduler REST Web Service.

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 Use-JobSchedulerWebService cmdlet.
* The Base (/joc/api) is used for all web service requests.
* The Path (/tasks/history) is used to query the JobScheduler history.

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

Body

-Body <String>
Specifies the JSON elements or XML command to be executed.

* Example JSON request
** URL: http://localhost:4446/joc/api/tasks/history
** JSON Body
{
"jobschedulerId": "jobscheduler_prod",
"compact": "true",
"limit": 1000
}
** The JobScheduler ID is specified to which the request is addressed. The request queries the recent task history for a maximum of 1000 entries.
* Example XML command
** URL: http://localhost:4446/joc/api/jobscheduler/commands
** XML Body
<show_state/>
** XML Body
<jobscheduler_commands jobschedulerId="jobscheduler_prod"><show_state/></jobscheduler_commands>
** The XML body can use the <jobscheduler_commands> element to specify the JobScheduler ID,
otherwise the JobScheduler ID is used from the Use-JobSchedulerWebService cmdlet or from the Id parameter.

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

Id

-Id <String>
The Id specifies the JobScheduler ID that identifies an individual JobScheduler Master.

This Id is used to addresse the JobScheduler Master that should execute the request.

If no Id is specified then the JobScheduler ID is used from the Use-JobSchedulerWebService cmdlet.

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

Base

-Base <String>
The Base is used as a prefix to the Path for the URL and is configured with the web server
that hosts the JobScheduler Web Service.

This value is fixed and should not be modified for most use cases.

Default: /joc/api

Required?false
Position?4
Default value/joc/api
Accept pipeline input?true (ByValue, 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.

Default: POST

Required?false
Position?5
Default valuePOST
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

ContentType

-ContentType <String>
The HTTP content type is

* application/json for JSON requests
* application/xml for XML commands

The content type is automatically adjusted by the cmdlet if XML commands are used.

Default: application/json

Required?false
Position?6
Default valueapplication/json
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

Headers

-Headers <Hashtable>
A hashmap can be specified with name/value pairs for HTTP headers.

Required?false
Position?7
Default value@{}
Accept pipeline input?true (ByValue, ByPropertyName)
Accept wildcard characters?false

about_jobscheduler

EXAMPLES

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

PS > $historyJson = Send-JobSchedulerRequest -Path '/tasks/history' -Body '{"jobschedulerId": "jobscheduler_prod", "compact": "true", "limit": 1000}'

Returns the recent task history entries up to a limit of 1000 items for a JobScheduler Master with ID "jobscheduler_prod"

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

$stateXml = Send-JobSchedulerRequest '/jobscheduler/commands' '<show_state/> '

Returns summary information and inventory of jobs and job chains.

  • No labels