mod-erm-usage-harvester API version v1.3
http://localhost/erm-usage-harvester
mod-erm-usage-harvester API
This documents the API calls that can be made to mod-erm-usage-harvester
/erm-usage-harvester
Start harvesting for tenant - process all defined usage data providers
get /erm-usage-harvester/start
Start harvesting for tenant - process all defined usage data providers
Start harvesting for tenant - process a specific usage data provider only
get /erm-usage-harvester/start/{id}
Start harvesting for tenant - process a specific usage data provider only
URI Parameters
- id: required(string)
Get available service implementations
get /erm-usage-harvester/impl
Get available service implementations
Query Parameters
- aggregator: (string)
Filter by 'isAggregator' property (true or false)
Get harvesting jobs
get /erm-usage-harvester/jobs
Get harvesting jobs
Query Parameters
- timestamp: (number)
Only return jobs created at or before this timestamp
Example:
1641020400000
- providerId: (string)
Only return jobs with this providerId
Example:
6697f576-78d4-4712-ae18-2612ccdcd66d
- query: (string)
A query expressed as a CQL string (see 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.
CQL string
Example:
(username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode type==provider
- totalRecords: (string - default: auto - pattern: exact|estimated|none|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: (integer - default: 0 - minimum: 0 - maximum: 2147483647)
Skip over a number of elements by specifying an offset value for the query
Example:
0
- limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)
Limit the number of elements returned in the response. Using limit=0 will return totalRecords with the exact value. For details about totalRecords see https://github.com/folio-org/raml-module-builder#estimated-totalrecords
Example:
10
HTTP status code 200
List of harvesting jobs
Body
Media type: application/json
Type: json
Content:
{
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "A collection of JobInfo objects",
"type": "object",
"properties": {
"jobInfos": {
"description": "List of JobInfo",
"type": "array",
"items": {
"type": "object",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "JobInfo Schema",
"description": "Job information",
"properties": {
"id": {
"description": "Job information id",
"type": "string"
},
"type": {
"description": "Job type",
"type": "string",
"enum": [
"periodic",
"tenant",
"provider"
]
},
"providerId": {
"description": "Job providerId",
"type": "string"
},
"timestamp": {
"description": "Job timestamp",
"type": "number",
"javaType": "java.lang.Long"
},
"startedAt": {
"description": "Job start date-time",
"type": "string",
"format": "date-time"
},
"finishedAt": {
"description": "Job finish date-time",
"type": "string",
"format": "date-time"
},
"nextStart": {
"description": "Job next start date-time",
"type": "string",
"format": "date-time"
},
"result": {
"description": "Job execution result",
"type": "string",
"enum": [
"success",
"failure"
]
},
"errorMessage": {
"description": "Job execution error message",
"type": "string"
}
},
"additionalProperties": false
}
},
"totalRecords": {
"description": "Total number of JobInfo objects",
"type": "integer"
}
},
"required": [
"jobInfos",
"totalRecords"
]
}
HTTP status code 400
Bad request
Body
Media type: text/plain
Type: any
HTTP status code 500
Internal server error
Body
Media type: text/plain
Type: any
Purge finished harvesting jobs
post /erm-usage-harvester/jobs/purgefinished
Purge finished harvesting jobs
Query Parameters
- timestamp: required(number)
Only purge jobs having a timestamp less than or equal to this value
Example:
1641020400000
Purge stale jobs
Perform cleanup tasks on harvesting jobs