You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

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>] [[-Method] <String>] [[-ContentType] <String>] [[-Headers] <Hashtable>] [[-AuditComment] <String>] [[-AuditTimeSpent] <Int32>] [[-AuditTicketLink] <Uri>] [<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 Connect-JobScheduler cmdlet.
* The Base (/joc/api) is used for all web service requests.
* The Path (/tasks/history) is used to query the JobScheduler task 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 that are sent to the Web Service.

* 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 Connect-JobScheduler 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 Connect-JobScheduler cmdlet.

Required?false
Position?3
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.

Default: POST

Required?false
Position?4
Default valuePOST
Accept pipeline input?true (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?5
Default valueapplication/xml
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

Headers

-Headers <Hashtable>
A hashmap can be specified with name/value pairs for HTTP headers.
Typicall the Accept header is required for use of the REST API.

Required?false
Position?6
Default value@{'Accept' = 'application/xml'}
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?7
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?8
Default value0
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

-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?9
Default value
Accept pipeline input?true (ByPropertyName)
Accept wildcard characters?false

about_jobscheduler

EXAMPLES

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

PS > $response = Send-JobSchedulerRequest -Path '/tasks/history' -Body '{"jobschedulerId": "jobscheduler_prod", "compact": "true", "limit": 1000}' -Headers @{'Accept' = 'application/json'}

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

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

$response = Send-JobSchedulerRequest -Path '/jobscheduler/commands' -Body '<show_state/> '

Returns summary information and inventory of jobs and job chains.

  • No labels