Submit a job (POST)

Description

URL

scheme://domain:port/platform/ws/jobs/submit

Description

Submits a job to IBM Spectrum LSF Application Center.

  • Precondition: the administrator has prepared and published the application.

  • For any parameter, the value specified by the web service request overrides the default value specified by the application form.

  • The job is submitted as the logged in user.

  • Just like through the web graphical interface, when you submit a job, a temporary directory is created for the job and the file you attached is copied to the directory. The owner for the directory is the user that is logged on. The directory inherits the logged on user’s umask permission on the Platform Application Center host.

HTTP Method

POST

Parameters

None

Request

Request-Method

POST

Request-URI

/platform/ws/jobs/submit

Request-Header

Name

Value

Accept

application/xml or application/json

Content-Type

multipart/mixed;boundary=YYYYY

Message-body

Boundary can be any random unique string. For details, see additional tables.

--boundary<Application Name Area (table 1)>

--boundary<Parameters Area (table 2)>

--boundary<File Attachment (table 3)>


Table 1. Application Name Area Boundary
Field Name Field format/value Notes®
Content-Disposition Form-data;name="AppName"  
Content-ID AppName  
Content <App_Type[:App_Instance]> Specify App_Type only if there is no App_Instance

Example: Application Name Area Boundary
-----------------------------------
Content-Disposition: form-data; name=AppName
Content-ID: <AppName>
"\r\n"
FLUENT:FLUENT_WEB
-----------------------------------

Table 2. Parameters Area Boundary
Field Name Field format/value Notes
Content-Disposition Form-data;name="data"  
Content-Type multipart/mixed;boundary=XXXX  
Content-ID <Data>  
Content --boundaryContent-Disposition: form-data; name=”c1”Content-Type: application/xml; charset=US-ASCIIContent-Transfer-Encoding: 8bit“\r\n”
<AppParam>  
   <id>%s</id>    <value>%s</value>
   <type>%s</type> 
</AppParam>
--boundary
Content-Disposition: form-data; name=”c1”Content-Type: application/xml; charset=US-ASCIIContent-Transfer-Encoding: 8bit“\r\n”<AppParam>    <id>%s</id>    <value>%s</value>   <type>%s</type> </AppParam>--boundary…--boundary--

<id>%s</id> defines the parameter name on the application form

<value>%s</value> defines the value of the parameter.

The value format for a file:

<Filename>,upload|copy|link

Upload: upload file from local. File must be attached in attached area of this request.

Copy: copy file to job directory

Link: link file to job directory.

<type>%s</type> defines the parameter type.

The possible values are: “file” or empty. “file” indicates the current parameter is a file .

Example: Parameters Area Boundary
-----------------------------------
Content-Disposition: form-data; name='data'
Content-Type: multipart/mixed; boundary=_Part_1_701508.1145579811786
Content-ID: <data>
“\r\n”
--_Part_1_701508.1145579811786
Content-Disposition: form-data; name='c1'
Content-Type: application/xml; charset=US-ASCII
Content-Transfer-Encoding: 8bit
“\r\n”
<AppParam>  <id>JOB_NAME</id> <value>From_webS</value><type></type> </AppParam>
--_Part_1_701508.1145579811786
Content-Disposition: form-data; name='c3'
Content-Type: application/xml; charset=US-ASCII
Content-Transfer-Encoding: 8bit
“\r\n”
<AppParam>  <id>FLUENT_JOURNAL</id> <value> fluent-test.jou,upload </value> <type> file</type> </AppParam>
--_Part_1_701508.1145579811786--
----------------------------------

Table 3. File Attachment Boundary
Field Name Field format/value Notes
Content-Disposition Form-data;name="f1"  
Content-Type application/octet-stream  
Content-ID <Filename>  
Content-Transfer-Encoding UTF-8  
Content <File content in bytes>  

Example: File Attachment Boundary
-----------------------------------
Content-Disposition: form-data; name='f1'
Content-Type: application/octet-stream
Content-Transfer-Encoding: UTF-8
Content-ID: <fluent-test.jou>
“\r\n”
PGh0bWw+CiAgPGhlYWQ+CiAgPC9oZWFkPgogIDxib2R5PgogICAgPHA+VGhpcyBpcyB0aGUg
-----------------------------------

Response

Response-Code

  • 200 Successful: Request was successful.
  • 400 Bad request: The input is not valid.
  • 403 Forbidden: Access restricted by role-based access control permissions.
  • 404 Not Found: The specified application was not found.
  • 500 Internal Server Error: Exception occurred.

Response-Header

Name

Value

Content-Type

application/xml or application/json

Message-body

Sucess Message Returns the ID of the submitted job when job submission is successful.
Failure Message

If not successful, returns an error message.

For additional information, refer to the schema file ./schemas/jobs/error.xsd.

<error>
  <message>
     %s
  </message>
</error>

Example: Submit a job


# Request
POST /platform/ws/jobs/submit HTTP/1.1
Host: www.example.org
Content-Type:multipart/mixed;boundary= bqJky99mlBWa-ZuqjC53mG6EzbmlxB

--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
Content-Disposition: form-data; name="AppName"

generic
--bqJky99mlBWa-ZuqjC53mG6EzbmlxB
Content-Disposition: form-data; name="data"
Content-Type: multipart/mixed; boundary=aaaaaaaaaaaaa-aaaaaaaaaaaaa

--aaaaaaaaaaaaa-aaaaaaaaaaaaa
Content-Disposition: form-data; name="COMMAND"
Content-Type: application/xml; charset=UTF-8
Content-Transfer-Encoding: 8bit
Accept-Language: en

<AppParam><id>COMMANDTORUN</id><value>sleep 100</value><type>text</type></AppParam>
--aaaaaaaaaaaaa-aaaaaaaaaaaaa--
--bqJky99mlBWa-ZuqjC53mG6EzbmlxB--

# Response
200 Successful
Content-Type: application/xml;
<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Job><id>883</id></Job>