Advanced Configuration : Using Integration Manager APIs : Tutorial : Update the Job Configuration with the Package Name and Its Entry Point
 
Share this page                  
Update the Job Configuration with the Package Name and Its Entry Point
This section provides steps to update a job configuration. The parameters it accepts and the response codes are documented at https://api.im.actiandatacloud.com/apidocs/#/Job_Configuration/updateJobConfig.
Note:  If you want to find out the entryPoints available in the given package, update the job configuration with the packageName first and then use GET endpoint /jobconfigs/<id>/package/entrypoints to get the entry points defined in the package on the job configuration. Copy the entryPoint and update the job configuration with it.
This is a PUT Request and the URL is http://localhost:8080/api/jobconfigs/<id>.
It accepts application/json as content type and Bearer Token as Authorization, and this information should be provided in the header.
Request Header
Content-Type: application/json
Authorization: Bearer <access token value>
It accepts the following request body. The mandatory keys that must be provided are “name” and “jobTemplateId”. Replace “string” with the configuration name and jobTemplateId respectively. Then replace “string” for the packageName value with “packageA.djar”. If you know the exact entryPoint value to provide, then provide it. Otherwise, update the job configuration with the packageName first and then use the GET endpoint /jobconfigs/<id>/package/entrypoints to get the entry points defined in the package on the job configuration. Copy the entryPoint and update the job configuration with it. The rest of the keys are optional; either remove them or replace the “string” with valid values or null or empty values.
Request Body
{
    "jobTemplateId": "string",
    "name": "string",
    "schedule": "string",
    "runtimeConfig": {
        "outMessageNames": [
            "string"
        ],
    "logLevel": "SEVERE",
    "packageName": "string",
    "inMessages": [
        {
            "body": "string",
            "name": "string",
            "properties": [
                {
                    "value": "string",
                    "key": "string"
                }
            ]
        }
    ],
    "macros": [
        {
            "value": "string",
            "key": "string"
        }
    ],
    "entryPoint": "string",
    "packageArtifactOverride": true,
    "packagePrefix": "string",
    "packageVersion": "string",
    "variables": [
        {
            "value": "string",
            "key": "string"
        }
    ]
    },
    "timeout": 0,
    "active": true,
    "description": "string"
}
Here is the sample update request that is sent to the API. Take care when updating a fully configured job template or job configuration. As a best practice, use GET endpoint /jobconfigs/<id> to get the job configuration details for the given ID; then copy its response body and use that as the request body for an update call and provide the necessary values for the keys that you want to update.
Sample Request – HTTP code snippet
PUT /api/jobconfigs/44 HTTP/1.1
Host: localhost:8080
Authorization: Bearer <access token value>
Content-Type: application/json
{
    "jobTemplateId": "12ef65ae-9f7e-47cec3dcd1dfa859",
    "name": "sample config",
    "runtimeConfig": {
        "packageName": "packageA.djar",
        "entryPoint": "processA.process"
        },
    "active": true,
    "description": "updating Job Config from API"
}
If the call is successful, status code 201 Created is returned with the following Job configuration response body.
Sample Response Body for status code: 201
{
    "active": true,
    "created": "Apr 12, 2019 12:40:51 PM",
    "id": "44",
    "lastModified": "Apr 12, 2019 2:17:14 PM",
    "name": "sample config",
    "description": "updating Job Config from API",
    "runtimeConfig": {
        "packageName": "packageA.djar",
        "entryPoint": "processA.process"
        "packagePrefix": "configuration\\44",
        "packageArtifactOverride": false
    },
    "href": "http://localhost:8080/api/jobconfigs/44",
    "user": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "createdByUser": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "lastModifiedByUser": {
        "id": "1",
        "name": "admin",
        "href": "http://localhost:8080/api/users/1"
    },
    "template": {
        "id": "12ef65ae-9f7e-47cec3dcd1dfa859",
        "name": "sample template"
        "href": "http://localhost:8080/api/jobtemplates/12ef65ae-9f7e-47cec3dcd1dfa859"
    }
}
If the call fails because of an expired token or an invalid token, status code 401 Unauthorized is returned with an appropriate message.
If a wrong header or incorrect request body is sent, status code 400 Bad Request is returned.