foliolib.folio.api.inventoryStorage.AuthoritiesReindex

class foliolib.folio.api.inventoryStorage.AuthoritiesReindex(tenant: str, okapi: Optional[foliolib.okapi.okapiClient.OkapiClient] = None)

Bases: foliolib.folio.FolioApi

Authority reindex

Reindex authorities by generating domain events for them

Parameters
  • tenant (str) – Tenant id

  • okapi (OkapiClient, optional) – Instance of OkapiClient. Defaults to None.

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 /authority-storage/reindex

delete_reindex(reindexId: str)

Cancell reindex job by id

DELETE /authority-storage/reindex/{reindexId}

Parameters

reindexId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

get_reindex(reindexId: str)

Get reindex job by id

GET /authority-storage/reindex/{reindexId}

Parameters

reindexId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – 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",
        "Authority",
        "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 /authority-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

  • 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

  • OkapiFatalError – 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 /authority-storage/reindex