mod-erm-usage-harvester API (v1.3)

http://localhost/erm-usage-harvester

Table of contents

mod-erm-usage-harvester API

This documents the API calls that can be made to mod-erm-usage-harvester

/erm-usage-harvester

GET /erm-usage-harvester/start

Start harvesting for tenant - process all defined usage data providers

GET /erm-usage-harvester/start

Response 200

Start for tenant succeeded

Body

Media type: application/json

Type: any

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Start for tenant failed

Body

Media type: application/json

Type: any

Media type: text/plain

Type: any

GET /erm-usage-harvester/start/{id}

Start harvesting for tenant - process a specific usage data provider only

GET /erm-usage-harvester/start/{id}
URI Parameters
  • id: required (string)

Response 200

Start for provider succeeded

Body

Media type: application/json

Type: any

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Start for provider failed

Body

Media type: application/json

Type: any

Media type: text/plain

Type: any

GET /erm-usage-harvester/impl

Get available service implementations

GET /erm-usage-harvester/impl
Query Parameters
  • aggregator: (string)

    Filter by 'isAggregator' property (true or false)

Response 200

List of available service implementations

Body

Media type: application/json

Type: any

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

GET /erm-usage-harvester/jobs

Get harvesting jobs

GET /erm-usage-harvester/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

Response 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"
  ]
}

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

POST /erm-usage-harvester/jobs/purgefinished

Purge finished harvesting jobs

POST /erm-usage-harvester/jobs/purgefinished
Query Parameters
  • timestamp: required (number)

    Only purge jobs having a timestamp less than or equal to this value

    Example:

    1641020400000

Response 204

Success

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

POST /erm-usage-harvester/jobs/purgestale

Purge stale jobs

POST /erm-usage-harvester/jobs/purgestale

Response 204

Success

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any

POST /erm-usage-harvester/jobs/cleanup

Perform cleanup tasks on harvesting jobs

POST /erm-usage-harvester/jobs/cleanup

Response 204

Success

Response 400

Bad request

Body

Media type: text/plain

Type: any

Response 500

Internal server error

Body

Media type: text/plain

Type: any