foliolib.folio.api.inventoryStorage.InstanceSyncUnsafe

class foliolib.folio.api.inventoryStorage.InstanceSyncUnsafe(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Inventory Storage Instance Batch Sync Unsafe API

Batch API for synchronously uploading instances into the inventory with optimistic locking disabled

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

Methods

set_synchronousUnsafe(synchronousUnsafe)

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_synchronousUnsafe(synchronousUnsafe: dict)

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). Environment variable DB_ALLOW_SUPPRESS_OPTIMISTIC_LOCKING is required, see https://github.com/folio-org/raml-module-builder#environment-variables for details. The _version property is ignored, optimistic locking is disabled - this is known to lead to data loss in some cases, don’t use in production, you have been warned!

POST /instance-storage/batch/synchronous-unsafe

Parameters

synchronousUnsafe (dict) – See Schema below

Raises
  • 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"
  ]
}