mod-kb-ebsco-java (v1)

https://github.com/folio-org/mod-kb-ebsco-java

Table of contents

mod-kb-ebsco-java

Implements the eholdings interface using EBSCO KB as backend.

Status

Gives status of currently set KB configuration.

GET /eholdings/status

Gives status of currently set KB configuration.

GET /eholdings/status

Response 200

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Status Response Schema",
  "description": "Status Response Schema using JSON API",
  "type": "object",
  "javaType": "org.folio.rest.jaxrs.model.ConfigurationStatus",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "javaType": "org.folio.rest.jaxrs.model.StatusData",
      "description": "Status Data",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Status Data Schema",
      "additionalProperties": false,
      "properties": {
        "id": {
          "type": "string",
          "description": "Status Data Id",
          "example": "status"
        },
        "type": {
          "type": "string",
          "description": "Status Data Type",
          "example": "statuses"
        },
        "attributes": {
          "type": "object",
          "description": "Status Attributes",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Status Attributes Schema",
          "javaType": "org.folio.rest.jaxrs.model.StatusAttributes",
          "additionalProperties": false,
          "properties": {
            "isConfigurationValid": {
              "type": "boolean",
              "description": "True if configuration is valid"
            }
          },
          "required": [
            "isConfigurationValid"
          ]
        }
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "JSON API Version Schema",
      "javaType": "org.folio.rest.jaxrs.model.JsonAPI",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of json api being used",
          "example": "1.0"
        }
      },
      "required": [
        "version"
      ]
    }
  }
}

Example:

{
  "data": {
    "id": "status",
    "type": "statuses",
    "attributes": {
      "isConfigurationValid": true
    }
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

Cache

DELETE /eholdings/cache

Invalidate configuration cache for tenant

DELETE /eholdings/cache

Response 204

No Content

Run load holdings job

POST /eholdings/loading/kb-credentials

Run load holdings job.

POST /eholdings/loading/kb-credentials
Headers
  • Content-Type: required (string)

    Example:

    application/json

Response 204

No Content

Response 409

Process of loading holdings is already running

Body

Media type: text/plain

Type: any

Example:

Process of loading holdings is already running

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

POST /eholdings/loading/kb-credentials/{id}

Run load holdings job by credentials id.

POST /eholdings/loading/kb-credentials/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)
Headers
  • Content-Type: required (string)

    Example:

    application/json

Response 204

No Content

Response 404

Not Found

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Error Response Schema",
  "description": "Error Response Schema for JSON API",
  "javaType": "org.folio.rest.jaxrs.model.JsonapiError",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "errors": {
      "type": "array",
      "description": "Error Response List",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Error Response object",
        "description": "Error Response Schema for JSON API",
        "javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Error Message Title",
            "example": "Invalid KB API Credentials"
          },
          "detail": {
            "type": "string",
            "description": "Error Message Detail",
            "example": "Kb api credentials are invalid"
          },
          "source": {
            "type": "object",
            "description": "Source of Error Message",
            "example": {}
          }
        }
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "JSON API Version Schema",
      "javaType": "org.folio.rest.jaxrs.model.JsonAPI",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of json api being used",
          "example": "1.0"
        }
      },
      "required": [
        "version"
      ]
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "KB credentials with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 409

Process of loading holdings is already running

Body

Media type: text/plain

Type: any

Example:

Process of loading holdings is already running

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /eholdings/loading/kb-credentials/{id}/status

Get current status of load holdings job.

GET /eholdings/loading/kb-credentials/{id}/status
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)
Headers
  • Content-Type: required (string)

    Example:

    application/json

Response 200

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Holdings Loading Status Schema",
  "description": "Holdings Loading Status Schema",
  "javaType": "org.folio.rest.jaxrs.model.HoldingsLoadingStatus",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "data": {
      "type": "object",
      "description": "Status data",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Load Status Data Schema",
      "javaType": "org.folio.rest.jaxrs.model.LoadStatusData",
      "additionalProperties": false,
      "properties": {
        "type": {
          "type": "string",
          "description": "Type information",
          "enum": [
            "status"
          ],
          "example": "status"
        },
        "attributes": {
          "type": "object",
          "description": "Status Attributes",
          "$schema": "http://json-schema.org/draft-04/schema#",
          "title": "Load Status Attributes Schema",
          "javaType": "org.folio.rest.jaxrs.model.LoadStatusAttributes",
          "additionalProperties": false,
          "properties": {
            "credentialsId": {
              "type": "string",
              "description": "The UUID of credentials",
              "examples": "2ffa1940-2cf6-48b1-8cc9-5e539c61d93f",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[1-5][a-fA-F0-9]{3}-[89abAB][a-fA-F0-9]{3}-[a-fA-F0-9]{12}$"
            },
            "started": {
              "type": "string",
              "description": "Holdings loading started time",
              "example": "1999-12-31 14:59:59"
            },
            "updated": {
              "type": "string",
              "description": "Time of last update to status",
              "example": "1999-12-31 16:01:03"
            },
            "finished": {
              "type": "string",
              "description": "Holdings loading finished time",
              "example": "1999-12-31 16:30:47"
            },
            "totalCount": {
              "type": "integer",
              "description": "Total number of holdings",
              "example": 1234
            },
            "importedCount": {
              "type": "integer",
              "description": "Imported number of holdings",
              "example": 1000
            },
            "totalPages": {
              "type": "integer",
              "description": "Total number of holding pages",
              "example": 20
            },
            "importedPages": {
              "type": "integer",
              "description": "Imported number of holding pages",
              "example": 15
            },
            "status": {
              "type": "object",
              "description": "Current Status Information",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "title": "Load Status Details Schema",
              "javaType": "org.folio.rest.jaxrs.model.LoadStatusInformation",
              "additionalProperties": false,
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Current Status of holdings loading",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Load Status Name Schema",
                  "javaType": "org.folio.rest.jaxrs.model.LoadStatusNameEnum",
                  "additionalProperties": false,
                  "enum": [
                    "Not Started",
                    "Started",
                    "In Progress",
                    "Completed",
                    "Failed"
                  ]
                },
                "detail": {
                  "type": "string",
                  "description": "Current Status detail name of holdings loading",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Load Status Name Detail Schema",
                  "javaType": "org.folio.rest.jaxrs.model.LoadStatusNameDetailEnum",
                  "additionalProperties": false,
                  "enum": [
                    "Populating staging area",
                    "Loading holdings"
                  ]
                }
              },
              "required": [
                "name"
              ]
            },
            "errors": {
              "type": "array",
              "description": "Error Response List",
              "items": {
                "type": "object",
                "$schema": "http://json-schema.org/draft-04/schema#",
                "title": "Error Response object",
                "description": "Error Response Schema for JSON API",
                "javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
                "additionalProperties": false,
                "properties": {
                  "title": {
                    "type": "string",
                    "description": "Error Message Title",
                    "example": "Invalid KB API Credentials"
                  },
                  "detail": {
                    "type": "string",
                    "description": "Error Message Detail",
                    "example": "Kb api credentials are invalid"
                  },
                  "source": {
                    "type": "object",
                    "description": "Source of Error Message",
                    "example": {}
                  }
                }
              }
            }
          },
          "required": [
            "status"
          ]
        }
      },
      "required": [
        "type",
        "attributes"
      ]
    },
    "jsonapi": {
      "type": "object",
      "description": "version of json api",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "JSON API Version Schema",
      "javaType": "org.folio.rest.jaxrs.model.JsonAPI",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of json api being used",
          "example": "1.0"
        }
      },
      "required": [
        "version"
      ]
    }
  },
  "required": [
    "data",
    "jsonapi"
  ]
}

Example:

{
  "data": {
    "type": "status",
    "attributes": {
      "credentialsId": "99999999-9999-9999-9999-999999999999",
      "started": "1999-12-31 14:59:59",
      "finished": "1999-12-31 16:30:47",
      "totalCount": 1234,
      "status": {
        "name": "Completed"
      }
    }
  },
  "jsonapi": {
    "version": "1.0"
  }
}

Response 404

Not Found

Body

Media type: application/vnd.api+json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Error Response Schema",
  "description": "Error Response Schema for JSON API",
  "javaType": "org.folio.rest.jaxrs.model.JsonapiError",
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "errors": {
      "type": "array",
      "description": "Error Response List",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "title": "Error Response object",
        "description": "Error Response Schema for JSON API",
        "javaType": "org.folio.rest.jaxrs.model.JsonapiErrorResponse",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "description": "Error Message Title",
            "example": "Invalid KB API Credentials"
          },
          "detail": {
            "type": "string",
            "description": "Error Message Detail",
            "example": "Kb api credentials are invalid"
          },
          "source": {
            "type": "object",
            "description": "Source of Error Message",
            "example": {}
          }
        }
      }
    },
    "jsonapi": {
      "type": "object",
      "description": "JSON API Version",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "JSON API Version Schema",
      "javaType": "org.folio.rest.jaxrs.model.JsonAPI",
      "additionalProperties": false,
      "properties": {
        "version": {
          "type": "string",
          "description": "Version of json api being used",
          "example": "1.0"
        }
      },
      "required": [
        "version"
      ]
    }
  }
}

Example:

{
  "errors": [
    {
      "title": "KB credentials with id '99999999-9999-9999-9999-999999999999' not found"
    }
  ],
  "jsonapi": {
    "version": "1.0"
  }
}

Response 500

Internal server error

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator