Creating a Job From JSON File

Create an OCI Batch job from a JSON file by using the Console or OCI CLI. You can also generate a complete JSON template, update the required values, and use it to submit new jobs.

  • The following steps start from a job pool. You can also start from the Job monitoring page: select Add jobs from JSON, then continue with the upload and submission steps below.

    1. On the Batch contexts list page, select the batch context that contains the job pool that you want to create a job in.
    2. On the batch context details page, select the Job pools tab.
    3. Select the job pool that you want to create the job in.
    4. Select the Jobs tab.
    5. On the job pool details page, select Add jobs from JSON.
    6. On the Create jobs from a JSON file page, drop or upload the job configuration.
    7. Select Submit.

      After the request is submitted, the new job appears in the job pool with an initial state of Accepted.

  • Use the following command to create a Batch job from a JSON file:

    oci batch batch-job create --from-json file://<path_to_json_file>

    To generate a JSON template that contains all supported command options, run:

    oci batch batch-job create --generate-full-command-json-input

    Save the generated output to a JSON file, update the required values, and then use the file with the --from-json option.

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the CreateBatchJob operation to create a batch job. Provide the job configuration in the JSON request body.