Batch Processing

The Soracom User Console provides an easy-to-use graphical interface for all SIM management tasks, such as registration, activation and deactivation, speed class control, and configuring various SIM settings. Most of these tasks can also be performed on multiple SIMs at the same time, reducing operational overhead.

However, in some cases you may wish to perform a task for hundreds or thousands of SIMs in an automated fashion, without navigating through the User Console to find specific SIMs.

The Batch Processing feature allows you to repeat specific tasks for a large number of SIMs in an automated manner, with built-in options and tools for handling errors and reviewing the results of each task, right from the User Console.

Overview

Batch processing consists of the following components:

Each batch job (or job) consists of a CSV file that you provide which contains the list of tasks to perform, with one task per line. For example, when using batch processing to activate a large number of SIMs, the CSV file should contain a list the SIMs you want to activate (one SIM per line), and the task of activating a SIM will be repeated for each line in the CSV.

Batch groups provide a simple way to organize multiple jobs. For example, if your organization manufactures devices in lots and you need to repeat a series of batch processing jobs for each lot, you can organize jobs by lot number using batch groups in order to easily check that each lot has been processed.

Compared to Multiple Selection

Most SIM management tasks can be performed from the User Console by simply selecting multiple SIMs and choosing the action to perform. However, certain tasks take additional parameters, such name when renaming a SIM, or group ID when moving a SIM to a different group:

For example, you can prepare a CSV containing a list of SIMs, and for each SIM specify a different name to apply.

Furthermore, when performing tasks using multiple selection, you must keep the User Console open, whereas with batch processing, a job will continue processing in the background even if you sign out or close the User Console.

Compared to Programmatic Usage

You can also automate SIM management tasks by writing your own script (such as Python, NodeJS, or shell script) which uses the Soracom API or Soracom CLI directly.

When writing your own script, you can use all available Soracom APIs and implement additional logic according to your business requirements, such as conditionally activating or configuring SIMs based on a manufacturing or deployment report. However, this requires familiarity with scripting, including rate limiting and error handling, as well as additional setup for Soracom API or CLI authentication.

On the other hand, batch processing does not require technical knowledge or additional Soracom API or CLI set up, and you don't need to worry about API rate limits. However, batch processing only supports a limited number of APIs.

Available Actions

The following API actions are currently supported:

Activating, suspending, and setting SIMs to standby may incur activation or suspension fees. For more information, refer to Subscriber Status.

Similarly, adding or moving a SIM to a group may incur additional fees depending on what options or services, such as Custom DNS or Soracom Harvest, are enabled in the group.

Limitations

The following limitations apply:

*1 - For example, if you create a batch job to activate SIMs, you cannot create another batch job for activating SIMs until the first job finishes. However, you can create a batch job for a different API action during that time.
*2 - To avoid issues, ensure that the CSV file is formatted correctly and contains the correct task settings you require. If appropriate, you can use the option to abort a job if it encounters an error to avoid having to wait for a job to finish.
*3 - The user creating the batch job should have permission to access the API action of the batch job.

Creating a Batch Group

  1. Login to the User Console. From the Menu, expand Batch Processing and select Batch Groups.

    https://console.soracom.io

    Batch processing menu

  2. Click the Create Batch Group button.

    https://console.soracom.io

    Create a new batch group

  3. Enter a name for your batch group and optionally a description, then click Save.

    Create a new batch group

The batch group will appear in the list of batch groups.

Deleting a Batch Group

Batch groups can only be deleted once all batch jobs in the group have stopped running.

To delete a batch group:

  1. From the list of batch groups, click the menu for the batch group you want to delete, then click Delete.

    https://console.soracom.io

    Delete a batch group

  2. Confirm deleting the batch group.

    Delete a batch group

Creating a Job

  1. Login to the User Console. From the Menu, expand Batch Processing and select Batch Groups.

  2. Select a batch group where you want to create a new job.

    https://console.soracom.io

    Select a batch group

  3. Click the Create Job button.

    https://console.soracom.io

    Create a batch job

  4. In the Create Job panel, enter the following batch job settings:

    https://console.soracom.io

    Enter batch job settings

    • Name - A unique name to identify the batch job.
    • Service and Operation - The API action for the batch job to perform.
  5. Next, in the Upload section, select a CSV file containing the task details. See CSV Format Examples below.

    https://console.soracom.io

    Upload a CSV file

  6. The User Console will check the CSV file and attempt to match its contents with the required CSV format. A table will appear below showing a preview of the data that will be used for the batch job, allowing you to confirm that the task settings are correct.

    https://console.soracom.io

    Select CSV columns

    If needed, use the dropdown menus to select which columns in the CSV file correspond to the required batch job fields.

    When using the Sim:putSimTags API, select each of the columns that you want added or updated as tags for each SIM.

    Tags will be set according to the name of the column in the CSV file. For example, if your CSV file contains a column called Location, selecting it will add or update a Location tag for each SIM.

    To add more tags, click the Add Tag button. To remove a tag, select the Don't use column option.

  7. Finally, select an Error handling option for what the batch job should do if an error occurs.

    https://console.soracom.io

    Select error handling and start job

    After confirming the job settings, then click the Start Job button to create the batch job and begin processing.

    Once a job is created, it cannot be canceled or aborted. To avoid issues, ensure that the CSV file is formatted correctly and contains the correct task settings you require.

The job will be added to the list of batch jobs.

Checking a Job Status

  1. Login to the User Console. From the Menu, expand Batch Processing and select Batch Groups.

  2. Click the batch group containing the job you want to check.

    Jobs in the batch group will be listed along with their current processing status.

    https://console.soracom.io

    List of batch jobs

Each job will have one of the following statuses:

Batch Job Status Description
Pending The batch job is currently queued and waiting to start.
Running The batch job is currently in progress.
Completed The batch job finished successfully without any errors.
Failed The batch job finished but an error occurred with one or more tasks.
Aborted An error occurred and remaining tasks were skipped.

To view additional details for a specific job:

  1. Click the name of the job you want to check.

    https://console.soracom.io

    Select a batch job to view more details

    Tasks in the job will be listed along with their current processing status:

    https://console.soracom.io

    Batch job details

Each task will have one of the following statuses:

Task Status Description
Pending The task has not been performed yet.
Success The task completed successfully.
Error An error occurred while performing the task.

For convenience, you can filter the list of tasks for a specific SIM to confirm if the task completed successfully. You can also filter the list of tasks by a specific task status in order download a corresponding CSV file for record keeping, or to create a subsequent job.

CSV Format Examples

SIM ID

To create a batch processing job to activate, deactivate, suspend, or set SIMs to standby, or to remove SIMs from their current group, prepare a CSV like this:

simId
8942300000011111111
8942300000022222222
8942300000033333333

Where:

SIM ID and Tags

To create a batch processing job to add or update SIM tags (including SIM name), prepare a CSV like this:

simId,name,tag1,tag2
8942300000011111111,my-sim-1,aaa,xxx
8942300000022222222,my-sim-2,bbb,yyy
8942300000033333333,my-sim-3,ccc,zzz

Where:

SIM ID and Group ID

To create a batch processing job to add or move SIMs to a group, prepare a CSV like this:

simId,groupId
8942300000011111111,abcdef00-0000-0000-0000-000011111111
8942300000022222222,abcdef00-0000-0000-0000-000011111111
8942300000033333333,abcdef00-0000-0000-0000-000022222222

Where:

VPG ID, IP Address, and Key

To create a batch processing job to assign specific IP addresses to SIMs when they connect to a VPG, prepare a CSV like this:

vpgId,ipAddress,key
abcdef00-0000-0000-0000-000011111111,10.0.0.111,295050011111111
abcdef00-0000-0000-0000-000011111111,10.0.0.112,295050022222222
abcdef00-0000-0000-0000-000011111111,10.0.0.113,295050033333333

Where: