foliolib.folio.api.inventoryStorage.HoldingsSources
- class foliolib.folio.api.inventoryStorage.HoldingsSources(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiHoldings Records Sources API
This documents the API calls that can be made to query and manage holdings records sources
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
delete_holdingsSource(holdingsSourcesId)Delete holdingsSource item with given {holdingsSourceId}
get_holdingsSource(holdingsSourcesId)Retrieve holdingsSource item with given {holdingsSourceId}
get_holdingsSources(**kwargs)Return a list of holdings records sources
modify_holdingsSource(holdingsSourcesId, ...)Update holdingsSource item with given {holdingsSourceId}
set_holdingsSource(holdingsSource)Create a new holdings records source
- delete_holdingsSource(holdingsSourcesId: str)
Delete holdingsSource item with given {holdingsSourceId}
DELETE /holdings-sources/{holdingsSourcesId}- Parameters
holdingsSourcesId (str) –
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiFatalError – Server Error
- get_holdingsSource(holdingsSourcesId: str)
Retrieve holdingsSource item with given {holdingsSourceId}
GET /holdings-sources/{holdingsSourcesId}- Parameters
holdingsSourcesId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings records source", "type": "object", "properties": { "id": { "type": "string", "description": "The unique ID of the holdings records source; UUID", "$ref": "uuid.json" }, "name": { "type": "string", "description": "Name of the holdings records source" }, "source": { "type": "string", "enum": [ "folio", "local" ], "description": "The holdings records source" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name" ] }
- get_holdingsSources(**kwargs)
Return a list of holdings records sources
GET /holdings-sources- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
query (str) –
A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://dev.folio.org/reference/glossary#cql)) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.
with valid searchable fields
Example
(username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode
name=aaa
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
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A collection of holdings records sources", "type": "object", "properties": { "holdingsRecordsSources": { "description": "List of holdings records sources", "id": "holdingsRecordsSources", "type": "array", "items": { "type": "object", "$ref": "holdingsrecordssource.json" } }, "totalRecords": { "description": "Estimated or exact total number of records", "type": "integer" } }, "required": [ "holdingsRecordsSources", "totalRecords" ] }
- modify_holdingsSource(holdingsSourcesId: str, holdingsSource: dict)
Update holdingsSource item with given {holdingsSourceId}
PUT /holdings-sources/{holdingsSourcesId}- Parameters
holdingsSourcesId (str) –
holdingsSource (dict) – See Schema below
- Raises
OkapiRequestNotFound – Not Found
OkapiRequestError – Bad Request
OkapiRequestConflict – Conflict
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings records source", "type": "object", "properties": { "id": { "type": "string", "description": "The unique ID of the holdings records source; UUID", "$ref": "uuid.json" }, "name": { "type": "string", "description": "Name of the holdings records source" }, "source": { "type": "string", "enum": [ "folio", "local" ], "description": "The holdings records source" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name" ] }
- set_holdingsSource(holdingsSource: dict)
Create a new holdings records source
POST /holdings-sources- Parameters
holdingsSource (dict) – See Schema below
- Raises
OkapiRequestError – Bad Request
OkapiRequestUnauthorized – Authentication is required
OkapiFatalError – Server Error
OkapiRequestUnprocessableEntity – Unprocessable Entity
Headers
Location - URI to the created holdingsSource item
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "A holdings records source", "type": "object", "properties": { "id": { "type": "string", "description": "The unique ID of the holdings records source; UUID", "$ref": "uuid.json" }, "name": { "type": "string", "description": "Name of the holdings records source" }, "source": { "type": "string", "enum": [ "folio", "local" ], "description": "The holdings records source" }, "metadata": { "type": "object", "$ref": "raml-util/schemas/metadata.schema", "readonly": true } }, "required": [ "name" ] }