Skip to main content
Skip table of contents

Creating a Job Using Scripting

This article provides an overview of the process for creating a job using the API and scripting. For detailed instructions, see:

Overview: Job Creation Process

Most actions performed using the PeerGFS API are one-shot processes, requiring only a single call to execute.  However, creating a new job may required additional steps, such as configuring a NAS storage device or creating a job template.  If an existing job is used as a template, creating a new job template is unnecessary.

The job creation process is as follows:

  • Task 1: Configure storage settings.

  • Task 2: Create a template job (if needed).

  • Task 3: Create a new job via the API.

Task 1: Configure storage settings

If the new job requires a NAS storage device, configure its settings in Peer Management Center.  This step establishes the connection details and parameters for the NAS device.  Once configured, you don’t need to repeat this step for the same device when creating additional jobs. 

For more detailed guidance on setting up NAS devices, see the PeerGFS User Guide.

Note: Skip this task if the new job does not include a NAS storage device.

Task 2: Create a template job

A template job acts as a reusable blueprint, simplifying the configuration of similar jobs by duplicating and modifying the template.  When creating a template job, you can import configuration settings from an existing job by providing its job ID. This is particularly useful for settings that cannot be configured through the API.  Once created, a template job enables efficient job creation and management.

Steps to create a template job:

  1. Create the jobUse either the Peer Management Center (PMC) user interface or the API to create a template job. A template job can be created without assigning participants initially.

  2. Modify job settings:  After creating the job, use the PMC user interface to modify any desired settings. This step is required for customizing the template job, as some settings cannot be configured through the API.

Note: Skip this task if either of the following applies:

  • You are using an existing job (with participants) as the basis for your new jobs.

  • You plan to use the default settings for a job. 

Task 3: Create the new job via the API

Once the first two tasks are complete (if required), follow the flow diagram below to create the new job.

  1. Create the new job:  Make an API call to create the job and store the returned JobID.  You can include the JobID of the template job in the API call to import non-default configuration settings.

  2. Retrieve storage items:  Retrieve the available storage devices and note the storage IDs for the devices you want to use in the new job.  The returned array will include both built-in (local) and configured NAS storage devices.

  3. Add participants to the job:  Use the storage devices from Step 2 to add participants to the job.  Repeat this step for each storage device you wish to include.

  4. Start the newly created job.

For more detailed instructions, refer to the articles that expand on each of these tasks.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.