foliolib.folio.api.bulkOperations.Bulkoperations

class foliolib.folio.api.bulkOperations.Bulkoperations(tenant: str)

Bases: foliolib.folio.FolioApi

Bulk operations API

Bulk operations API

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

canceloperationbyid(operationId)

Cancel bulk operation by id

cleanuplogfiles()

Removed all files older than 30 days

deletefilebynameandoperationid(operationId, ...)

Delete file by name and bulk operation id

downloadfilebyoperationid(operationId, **kwargs)

Download file by operation id

getbulkoperationbyid(operationId)

Get bulk operation by id

getbulkoperationcollection(**kwargs)

Get a list of operations

geterrorspreviewbyoperationid(operationId, ...)

Get a list of errors for preview

getlistusers(**kwargs)

Get a list of users

getpreviewbyoperationid(operationId, **kwargs)

Get preview

postcontentupdates(operationId, ...)

Upload content updates

startbulkoperation(operationId, ...)

Start Bulk Operation

triggerbulkeditbyquery(queryRequest)

Trigger bulk edit by query

uploadcsvfile(filePath, **kwargs)

Upload csv file with identifiers list (barcodes, UUIDs, HRIDs, etc.) or csv-file with already updated entities

canceloperationbyid(operationId)

Cancel bulk operation by id

POST /bulk-operations/{operationId}/cancel

Parameters

operationId (str) – UUID of the Bulk Operation (format: uuid)

Raises
  • OkapiRequestNotFound – Not found

  • OkapiRequestError – Bad request

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

cleanuplogfiles()

Removed all files older than 30 days

POST /bulk-operations/clean-up-log-files

Raises

OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

deletefilebynameandoperationid(operationId, fileName)

Delete file by name and bulk operation id

DELETE /bulk-operations/{operationId}/files/{fileName}

Parameters
  • operationId (str) – UUID of the Bulk Operation (format: uuid)

  • fileName (str) – File name

Raises

OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

downloadfilebyoperationid(operationId, **kwargs)

Download file by operation id

GET /bulk-operations/{operationId}/download

Parameters

operationId (str) – UUID of the Bulk Operation (format: uuid)

Keyword Arguments

fileContentType (str) – The file content type

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Not found

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "string",
    "format": "binary"
}
getbulkoperationbyid(operationId)

Get bulk operation by id

GET /bulk-operations/{operationId}

Parameters

operationId (str) – UUID of the Bulk Operation (format: uuid)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – Not found

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "properties": {
        "id": {
            "description": "Bulk Operation UUID",
            "type": "string",
            "format": "uuid"
        },
        "hrId": {
            "description": "Bulk Operation human readable ID",
            "type": "integer",
            "format": "int64"
        },
        "userId": {
            "description": "User UUID",
            "type": "string",
            "format": "uuid"
        },
        "operationType": {
            "type": "string",
            "enum": [
                "UPDATE",
                "DELETE"
            ]
        },
        "entityType": {
            "type": "string",
            "enum": [
                "USER",
                "ITEM",
                "HOLDINGS_RECORD",
                "INSTANCE"
            ]
        },
        "entityCustomIdentifierType": {
            "type": "string",
            "enum": [
                "ID",
                "BARCODE",
                "HRID",
                "FORMER_IDS",
                "ACCESSION_NUMBER",
                "HOLDINGS_RECORD_ID",
                "USER_NAME",
                "EXTERNAL_SYSTEM_ID",
                "INSTANCE_HRID",
                "ITEM_BARCODE",
                "ISBN",
                "ISSN"
            ]
        },
        "status": {
            "type": "string",
            "enum": [
                "NEW",
                "RETRIEVING_RECORDS",
                "SAVING_RECORDS_LOCALLY",
                "DATA_MODIFICATION",
                "REVIEW_CHANGES",
                "APPLY_CHANGES",
                "SUSPENDED",
                "COMPLETED",
                "COMPLETED_WITH_ERRORS",
                "CANCELLED",
                "SCHEDULED",
                "FAILED",
                "EXECUTING_QUERY",
                "RETRIEVING_IDENTIFIERS",
                "SAVED_IDENTIFIERS"
            ]
        },
        "approach": {
            "type": "string",
            "enum": [
                "MANUAL",
                "IN_APP",
                "QUERY"
            ]
        },
        "dataExportJobId": {
            "description": "Data export Job UUID",
            "type": "string",
            "format": "uuid"
        },
        "linkToTriggeringCsvFile": {
            "description": "Path to the bulk operation triggering file",
            "type": "string"
        },
        "linkToMatchedRecordsJsonFile": {
            "description": "Path to the matched (origin) json file",
            "type": "string"
        },
        "linkToMatchedRecordsCsvFile": {
            "description": "Path to the matched (origin) csv file",
            "type": "string"
        },
        "linkToMatchedRecordsErrorsCsvFile": {
            "description": "Path to the matching errors csv file",
            "type": "string"
        },
        "linkToModifiedRecordsJsonFile": {
            "description": "Path to the modified (updated) json file",
            "type": "string"
        },
        "linkToModifiedRecordsCsvFile": {
            "description": "Path to the modified (updated) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsJsonFile": {
            "description": "Path to the committed (result) json file",
            "type": "string"
        },
        "linkToCommittedRecordsCsvFile": {
            "description": "Path to the committed (result) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsErrorsCsvFile": {
            "description": "Path to the committing errors csv file",
            "type": "string"
        },
        "totalNumOfRecords": {
            "description": "Total number of records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "processedNumOfRecords": {
            "description": "Number of processed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfRecords": {
            "description": "Number of matched records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfRecords": {
            "description": "Number of committed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfErrors": {
            "description": "Number of matching errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfErrors": {
            "description": "Number of committing errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "executionChunkSize": {
            "description": "Size of chunk",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "startTime": {
            "description": "Bulk Operation start time",
            "type": "string",
            "format": "date-time"
        },
        "endTime": {
            "description": "Bulk Operation end time",
            "type": "string",
            "format": "date-time"
        },
        "errorMessage": {
            "description": "Error message",
            "type": "string"
        },
        "expired": {
            "description": "Were logs expired",
            "type": "boolean",
            "default": false
        },
        "fqlQueryId": {
            "description": "FQL query identifier",
            "type": "string",
            "format": "uuid"
        },
        "fqlQuery": {
            "description": "FQL query string",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "type"
    ]
}
getbulkoperationcollection(**kwargs)

Get a list of operations

GET /bulk-operations

Keyword Arguments
  • query (str) – Request query

  • offset (int) – Query offset

  • limit (int) – Query limit

Returns

See Schema below.

Return type

dict

Raises

OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "properties": {
        "bulkOperations": {
            "description": "List of bulk operations",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "description": "Bulk Operation UUID",
                        "type": "string",
                        "format": "uuid"
                    },
                    "hrId": {
                        "description": "Bulk Operation human readable ID",
                        "type": "integer",
                        "format": "int64"
                    },
                    "userId": {
                        "description": "User UUID",
                        "type": "string",
                        "format": "uuid"
                    },
                    "operationType": {
                        "type": "string",
                        "enum": [
                            "UPDATE",
                            "DELETE"
                        ]
                    },
                    "entityType": {
                        "type": "string",
                        "enum": [
                            "USER",
                            "ITEM",
                            "HOLDINGS_RECORD",
                            "INSTANCE"
                        ]
                    },
                    "entityCustomIdentifierType": {
                        "type": "string",
                        "enum": [
                            "ID",
                            "BARCODE",
                            "HRID",
                            "FORMER_IDS",
                            "ACCESSION_NUMBER",
                            "HOLDINGS_RECORD_ID",
                            "USER_NAME",
                            "EXTERNAL_SYSTEM_ID",
                            "INSTANCE_HRID",
                            "ITEM_BARCODE",
                            "ISBN",
                            "ISSN"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "NEW",
                            "RETRIEVING_RECORDS",
                            "SAVING_RECORDS_LOCALLY",
                            "DATA_MODIFICATION",
                            "REVIEW_CHANGES",
                            "APPLY_CHANGES",
                            "SUSPENDED",
                            "COMPLETED",
                            "COMPLETED_WITH_ERRORS",
                            "CANCELLED",
                            "SCHEDULED",
                            "FAILED",
                            "EXECUTING_QUERY",
                            "RETRIEVING_IDENTIFIERS",
                            "SAVED_IDENTIFIERS"
                        ]
                    },
                    "approach": {
                        "type": "string",
                        "enum": [
                            "MANUAL",
                            "IN_APP",
                            "QUERY"
                        ]
                    },
                    "dataExportJobId": {
                        "description": "Data export Job UUID",
                        "type": "string",
                        "format": "uuid"
                    },
                    "linkToTriggeringCsvFile": {
                        "description": "Path to the bulk operation triggering file",
                        "type": "string"
                    },
                    "linkToMatchedRecordsJsonFile": {
                        "description": "Path to the matched (origin) json file",
                        "type": "string"
                    },
                    "linkToMatchedRecordsCsvFile": {
                        "description": "Path to the matched (origin) csv file",
                        "type": "string"
                    },
                    "linkToMatchedRecordsErrorsCsvFile": {
                        "description": "Path to the matching errors csv file",
                        "type": "string"
                    },
                    "linkToModifiedRecordsJsonFile": {
                        "description": "Path to the modified (updated) json file",
                        "type": "string"
                    },
                    "linkToModifiedRecordsCsvFile": {
                        "description": "Path to the modified (updated) csv file",
                        "type": "string"
                    },
                    "linkToCommittedRecordsJsonFile": {
                        "description": "Path to the committed (result) json file",
                        "type": "string"
                    },
                    "linkToCommittedRecordsCsvFile": {
                        "description": "Path to the committed (result) csv file",
                        "type": "string"
                    },
                    "linkToCommittedRecordsErrorsCsvFile": {
                        "description": "Path to the committing errors csv file",
                        "type": "string"
                    },
                    "totalNumOfRecords": {
                        "description": "Total number of records",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "processedNumOfRecords": {
                        "description": "Number of processed records",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "matchedNumOfRecords": {
                        "description": "Number of matched records",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "committedNumOfRecords": {
                        "description": "Number of committed records",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "matchedNumOfErrors": {
                        "description": "Number of matching errors",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "committedNumOfErrors": {
                        "description": "Number of committing errors",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "executionChunkSize": {
                        "description": "Size of chunk",
                        "type": "integer",
                        "format": "int64",
                        "default": 0
                    },
                    "startTime": {
                        "description": "Bulk Operation start time",
                        "type": "string",
                        "format": "date-time"
                    },
                    "endTime": {
                        "description": "Bulk Operation end time",
                        "type": "string",
                        "format": "date-time"
                    },
                    "errorMessage": {
                        "description": "Error message",
                        "type": "string"
                    },
                    "expired": {
                        "description": "Were logs expired",
                        "type": "boolean",
                        "default": false
                    },
                    "fqlQueryId": {
                        "description": "FQL query identifier",
                        "type": "string",
                        "format": "uuid"
                    },
                    "fqlQuery": {
                        "description": "FQL query string",
                        "type": "string"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "type"
                ]
            },
            "minItems": 1
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "required": [
        "bulkOperations",
        "totalRecords"
    ],
    "additionalProperties": false
}
geterrorspreviewbyoperationid(operationId, **kwargs)

Get a list of errors for preview

GET /bulk-operations/{operationId}/errors

Parameters

operationId (str) – UUID of the Bulk Operation (format: uuid)

Keyword Arguments

limit (int) – The numbers of errors to return

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestNotFound – No found

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "description": "A set of errors",
    "type": "object",
    "properties": {
        "errors": {
            "description": "List of errors",
            "id": "errors",
            "type": "array",
            "items": {
                "description": "An error",
                "type": "object",
                "properties": {
                    "message": {
                        "type": "string",
                        "description": "Error message text"
                    },
                    "type": {
                        "type": "string",
                        "description": "Error message type"
                    },
                    "code": {
                        "type": "string",
                        "description": "Error message code"
                    },
                    "parameters": {
                        "description": "List of key/value parameters",
                        "type": "array",
                        "items": {
                            "description": "List of key/value parameters",
                            "type": "object",
                            "properties": {
                                "key": {
                                    "description": "Parameter key",
                                    "type": "string"
                                },
                                "value": {
                                    "description": "Parameter value",
                                    "type": "string"
                                }
                            },
                            "additionalProperties": false,
                            "required": [
                                "key"
                            ]
                        },
                        "additionalProperties": false
                    }
                },
                "additionalProperties": false,
                "required": [
                    "message"
                ]
            }
        },
        "total_records": {
            "description": "Total number of errors",
            "type": "integer"
        }
    },
    "additionalProperties": false
}
getlistusers(**kwargs)

Get a list of users

GET /bulk-operations/list-users

Keyword Arguments
  • query (str) – Request query

  • offset (int) – Query offset

  • limit (int) – Query limit

Returns

See Schema below.

Return type

dict

Raises

OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "description": "A set of users",
    "type": "object",
    "properties": {
        "users": {
            "description": "Set of users",
            "id": "users",
            "type": "array",
            "items": {
                "description": "User who runs bulk edit",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "format": "uuid",
                        "description": "User's ID"
                    },
                    "firstName": {
                        "type": "string",
                        "description": "User's first name"
                    },
                    "lastName": {
                        "type": "string",
                        "description": "User's last name"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "id"
                ]
            }
        },
        "total_records": {
            "description": "Total number of users",
            "type": "integer"
        }
    },
    "additionalProperties": false
}
getpreviewbyoperationid(operationId, **kwargs)

Get preview

GET /bulk-operations/{operationId}/preview

Parameters

operationId (str) – UUID of the Bulk Operation (format: uuid)

Keyword Arguments
  • step (str) – Key if manual approach is used

  • limit (int) – The numbers of records to return

  • offset (int) – Query offset (default: 0)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Not found

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Unified table representation of data",
    "type": "object",
    "properties": {
        "header": {
            "description": "Header",
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "description": "Data cell representation",
                "type": "object",
                "properties": {
                    "value": {
                        "description": "Cell value",
                        "type": "string"
                    },
                    "dataType": {
                        "type": "string",
                        "enum": [
                            "NUMERIC",
                            "DATE_TIME",
                            "STRING"
                        ]
                    },
                    "visible": {
                        "description": "Column visibility",
                        "type": "boolean",
                        "default": "true"
                    },
                    "forceVisible": {
                        "description": "Column visibility (forced to display in preview)",
                        "type": "boolean",
                        "default": "false"
                    },
                    "ignoreTranslation": {
                        "description": "Ignore translation",
                        "type": "boolean",
                        "default": "false"
                    }
                },
                "additionalProperties": false,
                "required": [
                    "value",
                    "dataType"
                ]
            }
        },
        "rows": {
            "description": "Rows",
            "type": "array",
            "items": {
                "$schema": "http://json-schema.org/draft-04/schema#",
                "description": "Row representation",
                "type": "object",
                "properties": {
                    "row": {
                        "description": "Row value",
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    }
                },
                "additionalProperties": false,
                "required": [
                    "row"
                ]
            }
        }
    },
    "additionalProperties": false,
    "required": [
        "header",
        "rows"
    ]
}
postcontentupdates(operationId, bulkOperationRuleCollection)

Upload content updates

POST /bulk-operations/{operationId}/content-update

Parameters
  • operationId (str) – UUID of the Bulk Operation (format: uuid)

  • bulkOperationRuleCollection (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad request

  • OkapiRequestNotFound – Not found

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "properties": {
        "bulkOperationRules": {
            "description": "List of bulk operation rules",
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "description": "Bulk operation rule ID",
                        "type": "string",
                        "format": "uuid"
                    },
                    "bulkOperationId": {
                        "description": "Bulk operation ID",
                        "type": "string",
                        "format": "uuid"
                    },
                    "rule_details": {
                        "description": "Rule details",
                        "type": "object",
                        "properties": {
                            "option": {
                                "type": "string",
                                "enum": [
                                    "PATRON_GROUP",
                                    "EXPIRATION_DATE",
                                    "EMAIL_ADDRESS",
                                    "PERMANENT_LOCATION",
                                    "TEMPORARY_LOCATION",
                                    "PERMANENT_LOAN_TYPE",
                                    "TEMPORARY_LOAN_TYPE",
                                    "STATUS",
                                    "SUPPRESS_FROM_DISCOVERY",
                                    "ITEM_NOTE",
                                    "ADMINISTRATIVE_NOTE",
                                    "CHECK_IN_NOTE",
                                    "CHECK_OUT_NOTE",
                                    "HOLDINGS_NOTE",
                                    "ELECTRONIC_ACCESS_URL_RELATIONSHIP",
                                    "ELECTRONIC_ACCESS_URI",
                                    "ELECTRONIC_ACCESS_LINK_TEXT",
                                    "ELECTRONIC_ACCESS_MATERIALS_SPECIFIED",
                                    "ELECTRONIC_ACCESS_URL_PUBLIC_NOTE",
                                    "STAFF_SUPPRESS"
                                ]
                            },
                            "actions": {
                                "type": "array",
                                "items": {
                                    "description": "Rule action",
                                    "type": "object",
                                    "properties": {
                                        "type": {
                                            "type": "string",
                                            "enum": [
                                                "ADD_TO_EXISTING",
                                                "CLEAR_FIELD",
                                                "FIND",
                                                "FIND_AND_REMOVE_THESE",
                                                "REPLACE_WITH",
                                                "FIND_AND_REPLACE",
                                                "SET_TO_TRUE",
                                                "SET_TO_FALSE",
                                                "SET_TO_TRUE_INCLUDING_ITEMS",
                                                "SET_TO_FALSE_INCLUDING_ITEMS",
                                                "MARK_AS_STAFF_ONLY",
                                                "REMOVE_MARK_AS_STAFF_ONLY",
                                                "REMOVE_ALL",
                                                "CHANGE_TYPE",
                                                "DUPLICATE"
                                            ]
                                        },
                                        "initial": {
                                            "description": "Initial value",
                                            "type": "string"
                                        },
                                        "updated": {
                                            "description": "Updated value",
                                            "type": "string"
                                        },
                                        "parameters": {
                                            "type": "array",
                                            "items": {
                                                "description": "Parameter for action",
                                                "type": "object",
                                                "properties": {
                                                    "key": {
                                                        "description": "Key of parameter",
                                                        "type": "string"
                                                    },
                                                    "value": {
                                                        "description": "Value of parameter",
                                                        "type": "string"
                                                    }
                                                },
                                                "required": [
                                                    "key",
                                                    "value"
                                                ],
                                                "additionalProperties": false
                                            }
                                        }
                                    },
                                    "required": [
                                        "type"
                                    ],
                                    "additionalProperties": false
                                },
                                "minItems": 1
                            }
                        }
                    }
                },
                "required": [
                    "bulkOperationId",
                    "rule_details"
                ],
                "additionalProperties": false
            },
            "minItems": 1
        },
        "totalRecords": {
            "type": "integer"
        }
    },
    "required": [
        "bulkOperationRules",
        "totalRecords"
    ],
    "additionalProperties": false
}
startbulkoperation(operationId, bulkOperationStart)

Start Bulk Operation

POST /bulk-operations/{operationId}/start

Parameters
  • operationId (str) – UUID of the Bulk Operation (format: uuid)

  • bulkOperationStart (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestNotFound – Bad Request

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "properties": {
        "step": {
            "type": "string",
            "enum": [
                "UPLOAD",
                "EDIT",
                "COMMIT"
            ]
        },
        "approach": {
            "type": "string",
            "enum": [
                "MANUAL",
                "IN_APP",
                "QUERY"
            ]
        },
        "entityType": {
            "type": "string",
            "enum": [
                "USER",
                "ITEM",
                "HOLDINGS_RECORD",
                "INSTANCE"
            ]
        },
        "entityCustomIdentifierType": {
            "type": "string",
            "enum": [
                "ID",
                "BARCODE",
                "HRID",
                "FORMER_IDS",
                "ACCESSION_NUMBER",
                "HOLDINGS_RECORD_ID",
                "USER_NAME",
                "EXTERNAL_SYSTEM_ID",
                "INSTANCE_HRID",
                "ITEM_BARCODE",
                "ISBN",
                "ISSN"
            ]
        },
        "query": {
            "description": "CQL query for",
            "type": "string"
        }
    }
}
{
    "type": "object",
    "properties": {
        "id": {
            "description": "Bulk Operation UUID",
            "type": "string",
            "format": "uuid"
        },
        "hrId": {
            "description": "Bulk Operation human readable ID",
            "type": "integer",
            "format": "int64"
        },
        "userId": {
            "description": "User UUID",
            "type": "string",
            "format": "uuid"
        },
        "operationType": {
            "type": "string",
            "enum": [
                "UPDATE",
                "DELETE"
            ]
        },
        "entityType": {
            "type": "string",
            "enum": [
                "USER",
                "ITEM",
                "HOLDINGS_RECORD",
                "INSTANCE"
            ]
        },
        "entityCustomIdentifierType": {
            "type": "string",
            "enum": [
                "ID",
                "BARCODE",
                "HRID",
                "FORMER_IDS",
                "ACCESSION_NUMBER",
                "HOLDINGS_RECORD_ID",
                "USER_NAME",
                "EXTERNAL_SYSTEM_ID",
                "INSTANCE_HRID",
                "ITEM_BARCODE",
                "ISBN",
                "ISSN"
            ]
        },
        "status": {
            "type": "string",
            "enum": [
                "NEW",
                "RETRIEVING_RECORDS",
                "SAVING_RECORDS_LOCALLY",
                "DATA_MODIFICATION",
                "REVIEW_CHANGES",
                "APPLY_CHANGES",
                "SUSPENDED",
                "COMPLETED",
                "COMPLETED_WITH_ERRORS",
                "CANCELLED",
                "SCHEDULED",
                "FAILED",
                "EXECUTING_QUERY",
                "RETRIEVING_IDENTIFIERS",
                "SAVED_IDENTIFIERS"
            ]
        },
        "approach": {
            "type": "string",
            "enum": [
                "MANUAL",
                "IN_APP",
                "QUERY"
            ]
        },
        "dataExportJobId": {
            "description": "Data export Job UUID",
            "type": "string",
            "format": "uuid"
        },
        "linkToTriggeringCsvFile": {
            "description": "Path to the bulk operation triggering file",
            "type": "string"
        },
        "linkToMatchedRecordsJsonFile": {
            "description": "Path to the matched (origin) json file",
            "type": "string"
        },
        "linkToMatchedRecordsCsvFile": {
            "description": "Path to the matched (origin) csv file",
            "type": "string"
        },
        "linkToMatchedRecordsErrorsCsvFile": {
            "description": "Path to the matching errors csv file",
            "type": "string"
        },
        "linkToModifiedRecordsJsonFile": {
            "description": "Path to the modified (updated) json file",
            "type": "string"
        },
        "linkToModifiedRecordsCsvFile": {
            "description": "Path to the modified (updated) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsJsonFile": {
            "description": "Path to the committed (result) json file",
            "type": "string"
        },
        "linkToCommittedRecordsCsvFile": {
            "description": "Path to the committed (result) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsErrorsCsvFile": {
            "description": "Path to the committing errors csv file",
            "type": "string"
        },
        "totalNumOfRecords": {
            "description": "Total number of records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "processedNumOfRecords": {
            "description": "Number of processed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfRecords": {
            "description": "Number of matched records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfRecords": {
            "description": "Number of committed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfErrors": {
            "description": "Number of matching errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfErrors": {
            "description": "Number of committing errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "executionChunkSize": {
            "description": "Size of chunk",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "startTime": {
            "description": "Bulk Operation start time",
            "type": "string",
            "format": "date-time"
        },
        "endTime": {
            "description": "Bulk Operation end time",
            "type": "string",
            "format": "date-time"
        },
        "errorMessage": {
            "description": "Error message",
            "type": "string"
        },
        "expired": {
            "description": "Were logs expired",
            "type": "boolean",
            "default": false
        },
        "fqlQueryId": {
            "description": "FQL query identifier",
            "type": "string",
            "format": "uuid"
        },
        "fqlQuery": {
            "description": "FQL query string",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "type"
    ]
}
triggerbulkeditbyquery(queryRequest)

Trigger bulk edit by query

POST /bulk-operations/query

Parameters

queryRequest (dict) – See Schema below.

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnprocessableEntity – Unprocessable entity

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "description": "Query request body",
    "type": "object",
    "properties": {
        "fqlQuery": {
            "description": "FQL string",
            "type": "string"
        },
        "entityTypeId": {
            "description": "Entity type identifier",
            "type": "string",
            "format": "uuid"
        }
    },
    "required": [
        "fqlQuery",
        "entityTypeId"
    ],
    "additionalProperties": false
}
{
    "type": "object",
    "properties": {
        "id": {
            "description": "Bulk Operation UUID",
            "type": "string",
            "format": "uuid"
        },
        "hrId": {
            "description": "Bulk Operation human readable ID",
            "type": "integer",
            "format": "int64"
        },
        "userId": {
            "description": "User UUID",
            "type": "string",
            "format": "uuid"
        },
        "operationType": {
            "type": "string",
            "enum": [
                "UPDATE",
                "DELETE"
            ]
        },
        "entityType": {
            "type": "string",
            "enum": [
                "USER",
                "ITEM",
                "HOLDINGS_RECORD",
                "INSTANCE"
            ]
        },
        "entityCustomIdentifierType": {
            "type": "string",
            "enum": [
                "ID",
                "BARCODE",
                "HRID",
                "FORMER_IDS",
                "ACCESSION_NUMBER",
                "HOLDINGS_RECORD_ID",
                "USER_NAME",
                "EXTERNAL_SYSTEM_ID",
                "INSTANCE_HRID",
                "ITEM_BARCODE",
                "ISBN",
                "ISSN"
            ]
        },
        "status": {
            "type": "string",
            "enum": [
                "NEW",
                "RETRIEVING_RECORDS",
                "SAVING_RECORDS_LOCALLY",
                "DATA_MODIFICATION",
                "REVIEW_CHANGES",
                "APPLY_CHANGES",
                "SUSPENDED",
                "COMPLETED",
                "COMPLETED_WITH_ERRORS",
                "CANCELLED",
                "SCHEDULED",
                "FAILED",
                "EXECUTING_QUERY",
                "RETRIEVING_IDENTIFIERS",
                "SAVED_IDENTIFIERS"
            ]
        },
        "approach": {
            "type": "string",
            "enum": [
                "MANUAL",
                "IN_APP",
                "QUERY"
            ]
        },
        "dataExportJobId": {
            "description": "Data export Job UUID",
            "type": "string",
            "format": "uuid"
        },
        "linkToTriggeringCsvFile": {
            "description": "Path to the bulk operation triggering file",
            "type": "string"
        },
        "linkToMatchedRecordsJsonFile": {
            "description": "Path to the matched (origin) json file",
            "type": "string"
        },
        "linkToMatchedRecordsCsvFile": {
            "description": "Path to the matched (origin) csv file",
            "type": "string"
        },
        "linkToMatchedRecordsErrorsCsvFile": {
            "description": "Path to the matching errors csv file",
            "type": "string"
        },
        "linkToModifiedRecordsJsonFile": {
            "description": "Path to the modified (updated) json file",
            "type": "string"
        },
        "linkToModifiedRecordsCsvFile": {
            "description": "Path to the modified (updated) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsJsonFile": {
            "description": "Path to the committed (result) json file",
            "type": "string"
        },
        "linkToCommittedRecordsCsvFile": {
            "description": "Path to the committed (result) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsErrorsCsvFile": {
            "description": "Path to the committing errors csv file",
            "type": "string"
        },
        "totalNumOfRecords": {
            "description": "Total number of records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "processedNumOfRecords": {
            "description": "Number of processed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfRecords": {
            "description": "Number of matched records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfRecords": {
            "description": "Number of committed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfErrors": {
            "description": "Number of matching errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfErrors": {
            "description": "Number of committing errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "executionChunkSize": {
            "description": "Size of chunk",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "startTime": {
            "description": "Bulk Operation start time",
            "type": "string",
            "format": "date-time"
        },
        "endTime": {
            "description": "Bulk Operation end time",
            "type": "string",
            "format": "date-time"
        },
        "errorMessage": {
            "description": "Error message",
            "type": "string"
        },
        "expired": {
            "description": "Were logs expired",
            "type": "boolean",
            "default": false
        },
        "fqlQueryId": {
            "description": "FQL query identifier",
            "type": "string",
            "format": "uuid"
        },
        "fqlQuery": {
            "description": "FQL query string",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "type"
    ]
}
uploadcsvfile(filePath, **kwargs)

Upload csv file with identifiers list (barcodes, UUIDs, HRIDs, etc.) or csv-file with already updated entities

POST /bulk-operations/upload

Parameters

filePath (str) – Path of file to upload.

Keyword Arguments
  • entityType (str) – Entity type (USER, ITEM, HOLDINGS_RECORD)

  • identifierType (str) – Identifier type (ID, BARCODE, etc.)

  • manual (bool) – Key if manual approach is used (default: False)

  • operationId (str) – UUID of the Bulk Operation (applicable for (manual = true) case) (format: uuid)

Returns

See Schema below.

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Internal server errors, e.g. due to misconfiguration

Schema

{
    "type": "object",
    "properties": {
        "file": {
            "type": "string",
            "format": "binary"
        }
    }
}
{
    "type": "object",
    "properties": {
        "id": {
            "description": "Bulk Operation UUID",
            "type": "string",
            "format": "uuid"
        },
        "hrId": {
            "description": "Bulk Operation human readable ID",
            "type": "integer",
            "format": "int64"
        },
        "userId": {
            "description": "User UUID",
            "type": "string",
            "format": "uuid"
        },
        "operationType": {
            "type": "string",
            "enum": [
                "UPDATE",
                "DELETE"
            ]
        },
        "entityType": {
            "type": "string",
            "enum": [
                "USER",
                "ITEM",
                "HOLDINGS_RECORD",
                "INSTANCE"
            ]
        },
        "entityCustomIdentifierType": {
            "type": "string",
            "enum": [
                "ID",
                "BARCODE",
                "HRID",
                "FORMER_IDS",
                "ACCESSION_NUMBER",
                "HOLDINGS_RECORD_ID",
                "USER_NAME",
                "EXTERNAL_SYSTEM_ID",
                "INSTANCE_HRID",
                "ITEM_BARCODE",
                "ISBN",
                "ISSN"
            ]
        },
        "status": {
            "type": "string",
            "enum": [
                "NEW",
                "RETRIEVING_RECORDS",
                "SAVING_RECORDS_LOCALLY",
                "DATA_MODIFICATION",
                "REVIEW_CHANGES",
                "APPLY_CHANGES",
                "SUSPENDED",
                "COMPLETED",
                "COMPLETED_WITH_ERRORS",
                "CANCELLED",
                "SCHEDULED",
                "FAILED",
                "EXECUTING_QUERY",
                "RETRIEVING_IDENTIFIERS",
                "SAVED_IDENTIFIERS"
            ]
        },
        "approach": {
            "type": "string",
            "enum": [
                "MANUAL",
                "IN_APP",
                "QUERY"
            ]
        },
        "dataExportJobId": {
            "description": "Data export Job UUID",
            "type": "string",
            "format": "uuid"
        },
        "linkToTriggeringCsvFile": {
            "description": "Path to the bulk operation triggering file",
            "type": "string"
        },
        "linkToMatchedRecordsJsonFile": {
            "description": "Path to the matched (origin) json file",
            "type": "string"
        },
        "linkToMatchedRecordsCsvFile": {
            "description": "Path to the matched (origin) csv file",
            "type": "string"
        },
        "linkToMatchedRecordsErrorsCsvFile": {
            "description": "Path to the matching errors csv file",
            "type": "string"
        },
        "linkToModifiedRecordsJsonFile": {
            "description": "Path to the modified (updated) json file",
            "type": "string"
        },
        "linkToModifiedRecordsCsvFile": {
            "description": "Path to the modified (updated) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsJsonFile": {
            "description": "Path to the committed (result) json file",
            "type": "string"
        },
        "linkToCommittedRecordsCsvFile": {
            "description": "Path to the committed (result) csv file",
            "type": "string"
        },
        "linkToCommittedRecordsErrorsCsvFile": {
            "description": "Path to the committing errors csv file",
            "type": "string"
        },
        "totalNumOfRecords": {
            "description": "Total number of records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "processedNumOfRecords": {
            "description": "Number of processed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfRecords": {
            "description": "Number of matched records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfRecords": {
            "description": "Number of committed records",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "matchedNumOfErrors": {
            "description": "Number of matching errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "committedNumOfErrors": {
            "description": "Number of committing errors",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "executionChunkSize": {
            "description": "Size of chunk",
            "type": "integer",
            "format": "int64",
            "default": 0
        },
        "startTime": {
            "description": "Bulk Operation start time",
            "type": "string",
            "format": "date-time"
        },
        "endTime": {
            "description": "Bulk Operation end time",
            "type": "string",
            "format": "date-time"
        },
        "errorMessage": {
            "description": "Error message",
            "type": "string"
        },
        "expired": {
            "description": "Were logs expired",
            "type": "boolean",
            "default": false
        },
        "fqlQueryId": {
            "description": "FQL query identifier",
            "type": "string",
            "format": "uuid"
        },
        "fqlQuery": {
            "description": "FQL query string",
            "type": "string"
        }
    },
    "additionalProperties": false,
    "required": [
        "type"
    ]
}