foliolib.folio.api.sourceRecordStorage.SourceRecordStorageStream
- class foliolib.folio.api.sourceRecordStorage.SourceRecordStorageStream(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiSource Record Storage Stream API
Streaming API for searching records
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
get_records(**kwargs)Stream collection of records; including raw record, parsed record, and error record if applicable
get_sourceRecords(**kwargs)Stream collection of source records; including only latest generation and parsed record
set_marcRecordIdentifier(marcRecordIdentifier)Get a list of Marc Record IDs using post method
- get_records(**kwargs)
Stream collection of records; including raw record, parsed record, and error record if applicable
GET /source-storage/stream/records- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
snapshotId (str) –
Filter by Snapshot Id
Example
e5ddbbdc-90b3-498f-bb8f-49367ca4c142
recordType (str) –
(default=MARC_BIB) Filter by Record Type
Example
MARC_BIB
state (str) –
Filter by State
Example
ACTUAL
orderBy (list) –
Sort Records
Example
[‘order,ASC’]
totalRecords (str) –
(default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example
none
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
- Raises
OkapiRequestUnprocessableEntity – Unprocessable Entity
- get_sourceRecords(**kwargs)
Stream collection of source records; including only latest generation and parsed record
GET /source-storage/stream/source-records- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
recordId (str) –
Filter by Record Id
Example
876270bc-fbb4-409d-b8b0-3f59b1cb61f2
snapshotId (str) –
Filter by Snapshot Id
Example
7a8fbd77-5b2a-496c-93e7-cd04478f4fcc
externalId (str) –
Filter by external entity Id
Example
8b07da70-8ea7-4acd-83a0-44d83979c73b
externalHrid (str) –
Filter by external entity Hrid
Example
12345
instanceId (str) –
Filter by Instance Id
Example
8b07da70-8ea7-4acd-83a0-44d83979c73b
instanceHrid (str) –
Filter by Instance Hrid
Example
12345
holdingsId (str) –
Filter by Holdings Id
Example
8b07da70-8ea7-4acd-83a0-44d83979c73b
holdingsHrid (str) –
Filter by Holdings Hrid
Example
12345
recordType (str) –
(default=MARC_BIB) Filter by Record Type
Example
MARC_BIB
suppressFromDiscovery (bool) –
Filter by suppress from discovery
Example
True
deleted (bool) –
(default=False) Filter by records with state ACTUAL OR state DELETED OR leader 05 status d, s, or x
Example
True
leaderRecordStatus (str) –
Filter by MARC leader 05 status
Example
n
updatedAfter (datetime) – Start date to filter after, inclusive
updatedBefore (datetime) – End date to filter before, inclusive
orderBy (list) –
Sort records
Example
[‘order,ASC’]
totalRecords (str) –
(default=auto) How to calculate the totalRecords property. “exact” for the correct number, “estimated” for an estimation, “auto” to automatically select “exact” or “estimated”, “none” for suppressing the totalRecords property. For details see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example
none
offset (int) –
(default=0) Skip over a number of elements by specifying an offset value for the query
Example
0
limit (int) –
(default=10) Limit the number of elements returned in the response
Example
10
- Raises
OkapiRequestUnprocessableEntity – Unprocessable Entity
- set_marcRecordIdentifier(marcRecordIdentifier: dict)
Get a list of Marc Record IDs using post method
POST /source-storage/stream/marc-record-identifiers- Parameters
marcRecordIdentifier (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Schema for records search requests", "type": "object", "additionalProperties": false, "properties": { "leaderSearchExpression": { "id": "leaderSearchExpression", "description": "Expression to search records by the marc leader", "type": "string" }, "fieldsSearchExpression": { "id": "fieldsSearchExpression", "description": "Expression to search records by the marc fields", "type": "string" }, "suppressFromDiscovery": { "id": "suppressFromDiscovery", "description": "Flag to search by the records that are suppressed from discovery", "type": "boolean", "default": false }, "deleted": { "id": "deleted", "description": "Flag to search by deleted records", "type": "boolean", "default": false }, "offset": { "id": "offset", "description": "Offset flag", "type": "integer" }, "limit": { "id": "limit", "description": "Limit flag", "type": "integer" } } }