foliolib.folio.api.inventoryStorage.InstanceSync
- class foliolib.folio.api.inventoryStorage.InstanceSync(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiInventory Storage Instance Batch Sync API
Batch API for synchronously uploading instances into the inventory
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
set_synchronou(synchronou, **kwargs)Create or update a collection of instances in a single synchronous request; if any instance fails the complete batch will be rejected (all or nothing)
- set_synchronou(synchronou: dict, **kwargs)
Create or update a collection of instances in a single synchronous request; if any instance fails the complete batch will be rejected (all or nothing)
POST /instance-storage/batch/synchronous- Parameters
synchronou (dict) –
**kwargs (properties) – Keyword Arguments: See Schema below
- Keyword Arguments
upsert (bool) – (default=False) When a record with the same id already exists upsert=true will update it, upsert=false will fail the complete batch. The _version property of each instance to be updated must match the stored _version property (optimistic locking).
- Raises
OkapiRequestConflict – Conflict
OkapiRequestPayloadToLarge – Payload Too Large
OkapiRequestUnprocessableEntity – Unprocessable Entity
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A collection of instance records", "type": "object", "properties": { "instances": { "description": "List of instance records", "id": "instances", "type": "array", "items": { "type": "object", "$ref": "instance.json" } } }, "additionalProperties": false, "required": [ "instances" ] }