Example JIL syntax for AutoSys Command Execution via AutoSys Web Services AEWS/command/run
search cancel

Example JIL syntax for AutoSys Command Execution via AutoSys Web Services AEWS/command/run

book

Article ID: 382776

calendar_today

Updated On: 11-25-2024

Products

Autosys Workload Automation

Issue/Introduction

AutoSys Command Execution feature is a new component starting v24 release in AutoSys. This document provides an example JIL syntax

Environment

AutoSys Workload Automation

Resolution

  1. One option is to create a file,  /tmp/test.jil  on the AEWS server and refer to that file as input

    insert_job: jil_test   job_type: CMD 
    command: sleep 10
    machine: localhost

  2. Perform a POST into AEWS/command/run using a syntax like below.  Authorization code used here is  ejmcommander:ejmcommander in base64 encoding (default credentials in WCC for commander user)

    curl -X POST --location 'https://AEWS.example.com:9443/AEWS/command/run' \
    --header 'Content-Type: application/xml' \
    --header 'Accept: application/json' \
    --header 'Authorization: Basic ZWptY29tbWFuZGVyOmVqbWNvbW1hbmRlcg' \
    --data '<?xml version="1.0" encoding="UTF-8"?>
    <commandRequest>
        <timeout>0</timeout>
        <command>jil &lt; /tmp/test.jil</command>
         <inFile></inFile></commandRequest>'

    Note: the value of the user in the Authorization token should have WorkloadAutomationAEWebService application group association. WorkloadAutomationAE application permissions in EEM for the same user would be enforced for all operations here via AutoSys Command Execution. 


  3. Result from the above would be something like:

    {
        "stdOut": [
            "______________________________________________________________________________",
            "",
            "CAUAJM_I_50323 Inserting/Updating job: jil_test",
            "CAUAJM_I_50205 Database Change WAS Successful!",
            "______________________________________________________________________________",
            "",
            "CAUAJM_I_52301 Exit Code = 0",
            "______________________________________________________________________________",
            ""
        ]
    }

    Note: The Content-Type can be application/xml or application/json.  Accept header follows the same approach too.


  4. The other option is to pass the data via %InFile paramter (%InFile  is case sensitive )

    curl -X POST --location 'https://AEWS.example.com:9443/AEWS/command/run' \
    --header 'Content-Type: application/xml' \
    --header 'Accept: application/json' \
    --header 'Authorization: Basic ZWptY29tbWFuZGVyOmVqbWNvbW1hbmRlcg' \
    --data '<?xml version="1.0" encoding="UTF-8"?>
    <commandRequest>
        <timeout>0</timeout>
        <command>jil &lt; %InFile</command>
         <inFile>insert_job: jil_test   job_type: CMD command: sleep 10 machine: localhost</inFile></commandRequest>'


  5. Result should be similar to step #3 above.

 

Additional Information

AutoSys Command Execution

AutoSys Swagger can be accessed via URL:  https://AEWS.example.com:9443/AEWS/api/#/

Only these commands are permitted via AutoSys Command Execution, this cannot be customized further.