Hitachi

Job Management Partner 1 Version 10 Job Management Partner 1/Automatic Operation GUI, Command, and API Reference


9.4.5 Execution of a service

Function

Executes the specified service.

Execution permissions

Admin role, Develop role, Modify role, Submit role

API version

v1

Request format

POST http://host:port/Automation/version/objects/Services/id/actions/submit/invoke

The following shows the structure of the request body.

{
  "name" : "submit",
  "href" : "http://host:port/Automation/version/objects/Services/id/actions/submit/invoke",
  "method" : "POST",
  "parameters" : [ {...} ]
}

The following table describes the objects that can be specified as parameters (member) in the schema of a request.

Table 9‒32: Objects that can be specified as parameters (member)

Function

Resource name

Number

Description

Schedule

Schedule

1

Execution schedule of the service

List of property values

PropertyValue

0 to n

Input property for the service

The following describes the properties that can be specified for the above objects. The following members can be specified for properties regardless of when the service is executed (Now, Later, or Recurring).

Resource name

Member name

Number

Schedule

name

1

description

1

scheduleType

1

PropertyValue

keyName

0 to n

value

0 to n

If the timing of service execution is Now or Recurring, the following members can be specified for the property.

Resource name

Member name

Number

Whether the property can be specified

Schedule

scheduledStartTime

1

Can be specified when Later is set.

recurrenceInterval

1

Can be specified when Recurring is set.

recurrenceDayOfWeek

1

recurrenceDayOfMonth

1

recurrenceLastDayOfMonth

1

recurrenceStartDate

1

recurrenceTime

1

Status code

The following table describes the various status codes that can be returned as the response to a request.

Status code

Message

Description

201

Created

Processing has been successfully completed.

400

Bad Request

The argument is invalid.

401

Unauthorized

The user does not have login permission.

403

Forbidden

The user does not have a permission for executing the service.

404

Not found

The user does not have a permission for acquiring the service, or the service does not exist.

412

Precondition failed

The server is not available.

500

Server-side error

A server processing error occurred.

Response schema

The following shows the structure of the response body for a request.

{
  "instanceId" : "instance-id",
  "created" : "created-date-and-time",
  "updated" : "updated-date-and-time",
  "completed" : "completed-date-and-time",
  "state" : "state",
  "affectedResources" : [ {...} ]
}

The following table describes the objects that can be output as affectedResources (member).

Table 9‒33: Objects that can be output as affectedResources (member) (Execution of a service)

Output

Resource name

Number

Description

Link to the created schedule

String

1

Link to the created resource for schedule functionality (Schedules)

Link to the created task

String

1

Link to the created resource for task functionality (Tasks)

Usage example

In the following example, the API executes the service whose instanceID is 2015.

Request header:

POST /Automation/v1/objects/Services/2015/actions/submit/invoke HTTP/1.1
Host:10.196.184.238:22015
Accept:application/json
Accept-Language: ja
Content-Type: application/json
Content-Length: 811
Authorization: Basic c3lzdGVtOm1hbmFnZXI=
User-Agent: useragent1

Response header:

HTTP/1.1 200 OK
Date: Mon, 14 Jul 2014 11:45:34 GMT
Server: Cosminexus HTTP Server
Access-Control-Expose-Headers: WWW-Authenticate
WWW-Authenticate: HSSO 9745c5e76461cc6c3e6946e3f7bfe84c8732ac5_V0300
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, HEAD, OPTIONS
Access-Control-Allow-Credentials: true
Cache-Control: no-cache
Transfer-Encoding: chunked
Content-Type: application/json

Response body:

{
  "instanceID" : "3d9069ca-444f-4757-b0c5-a57ddd7d44cf",
  "created" : "2014-07-14T04:45:35.293-0700",
  "updated" : "2014-07-14T04:45:35.293-0700",
  "completed" : "2014-07-14T04:45:35.293-0700",
  "state" : "success",
  "affectedResource" : [ "http://10.196.184.238:22015/Automation/v1/objects/Schedules/2025", "http://10.196.184.238:22015/Automation/v1/objects/Tasks/2026" ]
}

Related toped