foliolib.folio.api.sourceRecordManager.MetadataProvider
- class foliolib.folio.api.sourceRecordManager.MetadataProvider(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)
Bases:
foliolib.folio.FolioApiMetadata Provider API
API for accessing metadata
- Parameters
tenant (str) – Tenant id
okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.
Methods
get_jobExecutions(**kwargs)GET /metadata-provider/jobExecutionsget_jobLogEntries(jobExecutionId, **kwargs)get journal records by job execution id
get_jobProfiles(**kwargs)GET /metadata-provider/jobExecutions/jobProfilesget_jobSummary(jobExecutionId)get summary result for import job
get_journalRecords(jobExecutionId, **kwargs)get journal records by job execution id
get_record(jobExecutionId, recordId)get record processing log dto by job execution id and record id (to get EDIFACT import log data a journal record id is expected)
get_users(**kwargs)get unique users for job JobExecutions
- get_jobExecutions(**kwargs)
GET /metadata-provider/jobExecutions- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
statusAny (list) –
JobExecution statuses to filter by
Example
[‘COMMITTED’, ‘ERROR’]
profileIdNotAny (list) –
Filter by specified job profile ids
Example
[‘d0ebb7b0-2f0f-11eb-adc1-0242ac120002’, ‘91f9b8d6-d80e-4727-9783-73fb53e3c786’]
statusNot (str) –
Filter by status not equal to
Example
COMPLETED
uiStatusAny (list) –
JobExecution statuses to filter by
Example
[‘READY_FOR_PREVIEW’]
hrId (str) –
Filter by jobExecution hrid
Example
123
fileName (str) –
Filter by jobExecution file name
Example
importBib1.bib
fileNameNotAny (list) –
Filter by specified file names
Example
[‘No file name’]
profileIdAny (list) –
Filter by specified job profile ids
Example
[‘d0ebb7b0-2f0f-11eb-adc1-0242ac120002’, ‘91f9b8d6-d80e-4727-9783-73fb53e3c786’]
userId (str) –
Filter by user id
Example
d0ebb7b0-2f0f-11eb-adc1-0242ac120002
completedAfter (datetime) – Start date to filter after, inclusive
completedBefore (datetime) – End date to filter before, inclusive
sortBy (list) –
(default=[‘completed_date,asc’]) Sorting jobExecutions by field: completed_date, progress_total, file_name, status, job_profile_name, hrid, job_user_first_name, job_user_last_name
Example
[‘completed_date,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
- Returns
See Schema below
- Return type
dict
- Raises
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of execution job dtos", "type": "object", "additionalProperties": false, "properties": { "jobExecutions": { "description": "List of execution job dtos", "type": "array", "id": "jobExecutionList", "items": { "type": "object", "$ref": "jobExecutionDto.json" } }, "totalRecords": { "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "jobExecutions", "totalRecords" ] }
- get_jobLogEntries(jobExecutionId: str, **kwargs)
get journal records by job execution id
GET /metadata-provider/jobLogEntries/{jobExecutionId}- Parameters
jobExecutionId (str) –
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
sortBy (str) –
(default=source_record_order) sorting by field: source_record_order, title, source_record_action_status, instance_action_status, holdings_action_status, item_action_status, order_action_status, invoice_action_status, error
Example
source_record_order
order (str (asc|desc) –
): (default=asc) sorting direction
Example
desc
errorsOnly (bool) –
(default=False) Filter by occurrence of error field
Example
True
entityType (str (MARC|INSTANCE|HOLDINGS|AUTHORITY|ITEM|ORDER|INVOICE|ALL) –
): (default=ALL) Filter by entity type: MARC, INSTANCE, HOLDINGS, AUTHORITY, ITEM, ORDER, INVOICE
Example
MARC
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
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of job summary log entries", "type": "object", "additionalProperties": false, "properties": { "entries": { "description": "List of jobExecution summary log entries", "type": "array", "id": "entries", "items": { "$ref": "jobLogEntryDto.json" } }, "totalRecords": { "description": "Total number of records in collection", "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "entries", "totalRecords" ] }
- get_jobProfiles(**kwargs)
GET /metadata-provider/jobExecutions/jobProfiles- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
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
- Returns
See Schema below
- Return type
dict
- Raises
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of related Job Profiles", "type": "object", "additionalProperties": false, "properties": { "jobProfilesInfo": { "description": "List of related Job Profiles", "type": "array", "id": "profileInfoList", "items": { "type": "object", "$ref": "profileInfo.json" } }, "totalRecords": { "description": "Total number of related Job Profiles", "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "jobProfilesInfo", "totalRecords" ] }
- get_jobSummary(jobExecutionId: str)
get summary result for import job
GET /metadata-provider/jobSummary/{jobExecutionId}- Parameters
jobExecutionId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestNotFound – Not Found
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Job execution summary DTO schema", "type": "object", "additionalProperties": false, "properties": { "jobExecutionId": { "description": "UUID", "$ref": "../../raml-util/schemas/uuid.schema" }, "totalErrors": { "description": "Total errors number", "type": "integer" }, "sourceRecordSummary": { "description": "Source record processing summary", "$ref": "./entityProcessingSummary.json" }, "instanceSummary": { "description": "Instance processing summary", "$ref": "./entityProcessingSummary.json" }, "holdingSummary": { "description": "Holding processing summary", "$ref": "./entityProcessingSummary.json" }, "itemSummary": { "description": "Item processing summary", "$ref": "./entityProcessingSummary.json" }, "authoritySummary": { "description": "Authority processing summary", "$ref": "./entityProcessingSummary.json" }, "orderSummary": { "description": "Order processing summary", "$ref": "./entityProcessingSummary.json" }, "invoiceSummary": { "description": "Invoice processing summary", "$ref": "./entityProcessingSummary.json" } }, "required": [ "jobExecutionId" ] }
- get_journalRecords(jobExecutionId: str, **kwargs)
get journal records by job execution id
GET /metadata-provider/journalRecords/{jobExecutionId}- Parameters
jobExecutionId (str) –
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
sortBy (str) –
sort criteria
Example
source_record_order, action_type, error
order (str (asc|desc) –
): (default=asc) sort direction
Example
desc
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Not Found
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of journal records", "type": "object", "additionalProperties": false, "properties": { "journalRecords": { "description": "List of journal records", "type": "array", "id": "journalRecordList", "items": { "type": "object", "$ref": "journalRecord.json" } }, "totalRecords": { "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "journalRecords", "totalRecords" ] }
- get_record(jobExecutionId: str, recordId: str)
get record processing log dto by job execution id and record id (to get EDIFACT import log data a journal record id is expected)
GET /metadata-provider/jobLogEntries/{jobExecutionId}/records/{recordId}- Parameters
jobExecutionId (str) –
recordId (str) –
- Returns
See Schema below
- Return type
dict
- Raises
OkapiRequestError – Bad Request
OkapiRequestNotFound – Not Found
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Record processing log DTO schema", "type": "object", "additionalProperties": false, "properties": { "jobExecutionId": { "description": "UUID", "$ref": "../../raml-util/schemas/uuid.schema" }, "sourceRecordId": { "description": "SRS record identifier, UUID", "$ref": "../../raml-util/schemas/uuid.schema" }, "sourceRecordOrder": { "description": "Order of a record in imported file", "type": "integer", "minimum": 0 }, "sourceRecordTitle": { "description": "Title from record", "type": "string" }, "sourceRecordActionStatus": { "description": "Status of action performed above a record", "$ref": "./actionStatus.json" }, "error": { "description": "Error message", "type": "string" }, "relatedInstanceInfo": { "description": "Information about instance associated with source record", "$ref": "processedEntityInfo.json" }, "relatedHoldingsInfo": { "description": "Information about holdings associated with source record", "$ref": "processedEntityInfo.json" }, "relatedItemInfo": { "description": "Information about item associated with source record", "$ref": "processedEntityInfo.json" }, "relatedAuthorityInfo": { "description": "Information about authority associated with source record", "$ref": "processedEntityInfo.json" }, "relatedPoLineInfo": { "description": "Information about poLine associated with source record", "properties": { "actionStatus": { "description": "Status of action performed above folio entity, value MULTIPLE if multiple entities of the same type were affected", "$ref": "./actionStatus.json" }, "idList": { "description": "Id of entities which were affected during data import process", "type": "array", "items": { "$ref": "../../raml-util/schemas/uuid.schema" } }, "hridList": { "description": "Human readable id of entities which were affected during data import process", "type": "array", "items": { "type": "string" } }, "error": { "description": "Error message", "type": "string" }, "orderId": { "description": "Order identifier, UUID", "$ref": "../../raml-util/schemas/uuid.schema" } } }, "relatedInvoiceInfo": { "description": "Information about invoice associated with source record", "$ref": "processedEntityInfo.json" }, "relatedInvoiceLineInfo": { "description": "Information about invoice line associated with source record", "type": "object", "additionalProperties": false, "properties": { "actionStatus": { "description": "Status of action performed with invoice line", "$ref": "./actionStatus.json" }, "id": { "description": "Invoice line identifier, UUID", "$ref": "../../raml-util/schemas/uuid.schema" }, "fullInvoiceLineNumber": { "description": "Consists of vendor invoice number and invoice line sequence number", "type": "string" }, "error": { "description": "Error message", "type": "string" } } } }, "required": [ "jobExecutionId", "sourceRecordId", "sourceRecordOrder" ] }
- get_users(**kwargs)
get unique users for job JobExecutions
GET /metadata-provider/jobExecutions/users- Parameters
**kwargs (properties) – Keyword Arguments
- Keyword Arguments
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
- Returns
See Schema below
- Return type
dict
- Raises
OkapiFatalError – Server Error
Schema
{ "$schema": "http://json-schema.org/draft-04/schema#", "description": "Collection of job executions unique user info", "type": "object", "additionalProperties": false, "properties": { "jobExecutionUsersInfo": { "description": "List of Job Execution unique users info", "type": "array", "id": "entries", "items": { "$ref": "jobExecutionUserInfo.json" } }, "totalRecords": { "description": "Total number of records in collection", "type": "integer" } }, "excludedFromEqualsAndHashCode": [ "totalRecords" ], "required": [ "jobExecutionUsersInfo", "totalRecords" ] }