<p>We have batch job that process flat files which gets triggered using Rest Call</p>

<pre><code>For e.g. https://clustername.com/loader?filname=file1.dat
    https://clustername.com/loader?filname=file2.dat
    https://clustername.com/loader?filname=file3.dat
</code></pre>

<p>We want to configure Openshift Job to trigger this batch job.</p>

<pre><code>https://docs.openshift.com/container-platform/3.11/dev_guide/jobs.html
</code></pre>

<p>As per the Kubernetes documentation, the job can be triggered using Queue:</p>

<pre><code>https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/
</code></pre>

<p>Can the job also be triggered by Rest Call?</p>

user3811946
<p>As others have mentioned, you can instantiate a job by creating a new one via the API.</p>

<p>IIRC you'll make a POST call to <code>/apis/batch/v1/namespaces/&lt;your-namespace&gt;/jobs</code><br>
(The endpoint may be slightly different depending on your API versions.)</p>

<p>The payload for your REST call is the JSON formatted manifest for the job you want to run. i.e. </p>

<pre><code>{
    "apiVersion": "batch/v1",
    "kind": "Job",
    "metadata": {
        "name": "example"
    },
    "spec": {
        "selector": {},
        "template": {
            "metadata": {
                "name": "example"
            },
            "spec": {
                "containers": [
                    {
                        "name": "example",
                        "image": "hello-world"
                    }
                ],
                "restartPolicy": "Never"
            }
        }
    }
}
</code></pre>
