Working with Batch Resources
When multiple users are working on multiple plates in high-throughput labs, programmers may find that the large number of HTTP method calls to the REST API can slow down their scripts.
To improve performance, Illumina has created the following batch resources:
artifacts.batch.retrieve
artifacts.batch.update
containers.batch.create
containers.batch.retrieve
containers.batch.update
files.batch.retrieve
files.batch.update
samples.batch.create
samples.batch.retrieve
samples.batch.update
Use the batch resources to access a group of artifacts or a group of containers using a single batch method call. Using these resources to iterate a list of items significantly improves script execution times.
Key Concepts
Batch resources are best thought of as unordered collections or lists of items accessed. A POST to batch/create, batch/update or batch/retrieve, therefore, is a request to create, update, or retrieve those items. There is no guaranteed order to batch responses.
Batch resources are nonbreaking additions to the existing REST API. Updated scripts can still use their existing nonbatch methods.
For example, the resources may have URIs (Universal Resource Identifiers) such as:
Batch operations do not require sophisticated HTTP client or server methods. The only HTTP method for batch resources is POST.
What is sent in a batch resource POST?
To update a group of artifacts, use a POST operation to the /artifacts/batch/update resource. The XML input payload consists of a series of elements, as follows.
What is returned from a batch resource POST?
As large data transfers can affect performance, it is important to return concise XML in response to a batch resource request. Therefore, except for retrieve resources, the XML output payload consists of a list of created or updated URI links, such as the following:
Return codes
The batch resources use common HTTP return codes:
An HTTP 200 (OK) code is returned when batch resources have been successfully created or updated.
An HTTP 400 error code is returned if the input payload details included incorrect, mixed, or duplicate URI links. For example, if the details of an artifacts.batch.update (list) request included a container resource.
Last updated