foliolib.folio.api.inventoryStorage.InstanceReindex

class foliolib.folio.api.inventoryStorage.InstanceReindex(tenant: str)

Bases: foliolib.folio.FolioApi

Instance reindex

Reindex instances by generating domain events for them

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_reindex(reindexId)

Cancell reindex job by id

get_reindex(reindexId)

Get reindex job by id

get_reindices(**kwargs)

Get all reindex jobs

set_reindex()

POST /instance-storage/reindex

delete_reindex(reindexId: str)

Cancell reindex job by id

DELETE /instance-storage/reindex/{reindexId}

Parameters

reindexId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

get_reindex(reindexId: str)

Get reindex job by id

GET /instance-storage/reindex/{reindexId}

Parameters

reindexId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Get job by id response",
  "type": "object",
  "properties": {
    "id": {
      "description": "Job id",
      "type": "string",
      "$ref": "../raml-util/schemas/uuid.schema"
    },
    "published": {
      "description": "Number of records that was published so far",
      "type": "integer",
      "minimum": 0,
      "default": 0
    },
    "jobStatus": {
      "description": "Overall job status",
      "type": "string",
      "enum": [
        "In progress",
        "Id publishing failed",
        "Ids published",
        "Pending cancel",
        "Id publishing cancelled"
      ]
    },
    "resourceName": {
      "description": "Reindex resource name",
      "type": "string",
      "enum": [
        "Instance",
        "Unknown"
      ]
    },
    "submittedDate": {
      "description": "Timestamp when the job has been submitted",
      "type": "string",
      "format": "date-time"
    }
  },
  "additionalProperties": false
}
get_reindices(**kwargs)

Get all reindex jobs

GET /instance-storage/reindex

Parameters

**kwargs (properties) – Keyword Arguments

Keyword Arguments
  • query (str) –

    A query expressed as a CQL string (see [dev.folio.org/reference/glossary#cql](https://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.

    with valid searchable fields

    Example

    • (username==”ab*” or personal.firstName==”ab*” or personal.lastName==”ab*”) and active==”true” sortby personal.lastName personal.firstName barcode

    • name=aaa

  • 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

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A collection of reindex jobs",
  "type": "object",
  "properties": {
    "reindexJobs": {
      "description": "List of reindex jobs",
      "id": "reindexJob",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "get-job-by-id-response.json"
      }
    },
    "totalRecords": {
      "description": "Estimated or exact total number of records",
      "type": "integer"
    }
  },
  "required": [
    "reindexJobs",
    "totalRecords"
  ]
}
set_reindex()

POST /instance-storage/reindex