foliolib.folio.api.dataExportWorker.Bulkedit
- class foliolib.folio.api.dataExportWorker.Bulkedit(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiBulk edit API
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
Download updated holdings records preview as csv-file
downloaditemspreviewbyjobid(jobId)Download updated items preview as csv-file
downloaduserspreviewbyjobid(jobId)Download updated users preview as csv-file
geterrorspreviewbyjobid(jobId, **kwargs)Get a list of errors for preview
getpreviewholdingsbyjobid(jobId, **kwargs)Get a list of holdings for preview
getpreviewitemsbyjobid(jobId, **kwargs)Get a list of items for preview
getpreviewusersbyjobid(jobId, **kwargs)Get a list of users for preview
postholdingscontentupdates(jobId, ...)Upload holdings record content updates
postitemcontentupdates(jobId, ...)Upload item content updates
postusercontentupdates(jobId, ...)Upload user content updates
rollbackcsvfile(jobId)Roll back csv file
startjob(jobId)Start job
uploadcsvfile(jobId, filePath)Upload csv file
- downloadholdingspreviewbyjobid(jobId)
Download updated holdings records preview as csv-file
GET /bulk-edit/{jobId}/preview/updated-holdings/download- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
- downloaditemspreviewbyjobid(jobId)
Download updated items preview as csv-file
GET /bulk-edit/{jobId}/preview/updated-items/download- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
- downloaduserspreviewbyjobid(jobId)
Download updated users preview as csv-file
GET /bulk-edit/{jobId}/preview/updated-users/download- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
- geterrorspreviewbyjobid(jobId, **kwargs)
Get a list of errors for preview
GET /bulk-edit/{jobId}/errors- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Keyword Arguments
limit (int) – The numbers of users to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestNotFound – No found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "errors": { "description": "List of errors", "type": "array", "items": { "type": "object", "$ref": "error.json#/Error" } }, "total_records": { "description": "Total number of errors", "type": "integer" } }, "additionalProperties": false }
- getpreviewholdingsbyjobid(jobId, **kwargs)
Get a list of holdings for preview
GET /bulk-edit/{jobId}/preview/holdings- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Keyword Arguments
limit (int) – The numbers of holdings to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "holdingsRecords": { "description": "List of holdings records", "type": "array", "items": { "$ref": "holdingsRecord.json#/HoldingsRecord" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo" } } }
- getpreviewitemsbyjobid(jobId, **kwargs)
Get a list of items for preview
GET /bulk-edit/{jobId}/preview/items- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Keyword Arguments
limit (int) – The numbers of items to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "items": { "description": "List of item records", "type": "array", "items": { "$ref": "item.json#/Item" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo" } } }
- getpreviewusersbyjobid(jobId, **kwargs)
Get a list of users for preview
GET /bulk-edit/{jobId}/preview/users- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Keyword Arguments
limit (int) – The numbers of users to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Bad Request
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "users": { "description": "List of userdata items", "type": "array", "items": { "$ref": "user.json#/User" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo", "readonly": true } }, "required": [ "users", "totalRecords" ] }
- postholdingscontentupdates(jobId, holdingsContentUpdateCollection, **kwargs)
Upload holdings record content updates
POST /bulk-edit/{jobId}/holdings-content-update/upload- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
holdingsContentUpdateCollection (dict) – See Schema below.
- Keyword Arguments
limit (int) – The numbers of records to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "holdingsContentUpdates": { "description": "List of item content updates", "type": "array", "items": { "$ref": "holdingsContentUpdate.json#/HoldingsContentUpdate" }, "minItems": 1 }, "totalRecords": { "type": "integer" } }, "required": [ "holdingsContentUpdates", "totalRecords" ], "additionalProperties": false }
{ "type": "object", "properties": { "holdingsRecords": { "description": "List of holdings records", "type": "array", "items": { "$ref": "holdingsRecord.json#/HoldingsRecord" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo" } } }
- postitemcontentupdates(jobId, itemContentUpdateCollection, **kwargs)
Upload item content updates
POST /bulk-edit/{jobId}/item-content-update/upload- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
itemContentUpdateCollection (dict) – See Schema below.
- Keyword Arguments
limit (int) – The numbers of records to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "itemContentUpdates": { "description": "List of item content updates", "type": "array", "items": { "$ref": "itemContentUpdate.json#/ItemContentUpdate" }, "minItems": 1 }, "totalRecords": { "type": "integer" } }, "required": [ "itemContentUpdates", "totalRecords" ], "additionalProperties": false }
{ "type": "object", "properties": { "items": { "description": "List of item records", "type": "array", "items": { "$ref": "item.json#/Item" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo" } } }
- postusercontentupdates(jobId, userContentUpdateCollection, **kwargs)
Upload user content updates
POST /bulk-edit/{jobId}/user-content-update/upload- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
userContentUpdateCollection (dict) – See Schema below.
- Keyword Arguments
limit (int) – The numbers of records to return
- Returns
See Schema below.
- Return type
dict
- Raises
OkapiRequestError – Bad request
OkapiRequestNotFound – Not found
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
Schema
{ "type": "object", "properties": { "userContentUpdates": { "description": "List of user content updates", "type": "array", "items": { "$ref": "userContentUpdate.json#/UserContentUpdate" }, "minItems": 1 }, "totalRecords": { "type": "integer" } }, "required": [ "userContentUpdates", "totalRecords" ], "additionalProperties": false }
{ "type": "object", "properties": { "users": { "description": "List of userdata items", "type": "array", "items": { "$ref": "user.json#/User" } }, "totalRecords": { "type": "integer" }, "resultInfo": { "$ref": "../common/resultInfo.json#/ResultInfo", "readonly": true } }, "required": [ "users", "totalRecords" ] }
- rollbackcsvfile(jobId)
Roll back csv file
POST /bulk-edit/{jobId}/roll-back- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Raises
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
- startjob(jobId)
Start job
POST /bulk-edit/{jobId}/start- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Bad Request
OkapiFatalError – Internal server errors, e.g. due to misconfiguration
- uploadcsvfile(jobId, filePath)
Upload csv file
POST /bulk-edit/{jobId}/upload- Parameters
jobId (str) – UUID of the JobCommand (format: uuid)
filePath (str) – Path of file to upload.
- Raises
OkapiRequestError – Bad Request
OkapiFatalError – Internal server errors, e.g. due to misconfiguration