foliolib.folio.api.configuration.Config

class foliolib.folio.api.configuration.Config(tenant: str)

Bases: foliolib.folio.FolioApi

Configuration API updating system wide configurations

This documents the API calls that can be made to update configurations in the system

Base class of the Folio API

Parameters

tenant (str) – Tenant id

Methods

delete_entry(entryId)

Delete entry item with given {entryId}

get_audits(**kwargs)

Retrieve a list of audit items.

get_entries(**kwargs)

Retrieve a list of entry items.

get_entry(entryId)

Retrieve entry item with given {entryId}

modify_entry(entryId, entry)

Update entry item with given {entryId}

set_entry(entry)

Create a new entry item.

delete_entry(entryId: str)

Delete entry item with given {entryId}

DELETE /configurations/entries/{entryId}

Parameters

entryId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

get_audits(**kwargs)

Retrieve a list of audit items.

GET /configurations/audit

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: for example module = CIRCULATION

    Example

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

    • scope.institution_id=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

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "audits": {
      "id": "auditData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "audit.schema"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "audits",
    "totalRecords"
  ]
}
get_entries(**kwargs)

Retrieve a list of entry items.

GET /configurations/entries

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: for example module = CIRCULATION

    Example

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

    • scope.institution_id=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

  • facets (list) – facets to return in the collection result set, can be suffixed by a count of facet values to return, for example, patronGroup:10 default to top 5 facet values

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "configs": {
      "id": "configurationData",
      "type": "array",
      "items": {
        "type": "object",
        "$ref": "kv_configuration.schema"
      }
    },
    "totalRecords": {
      "type": "integer"
    },
    "resultInfo": {
      "$ref": "../raml-util/schemas/resultInfo.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "configs",
    "totalRecords"
  ]
}
get_entry(entryId: str)

Retrieve entry item with given {entryId}

GET /configurations/entries/{entryId}

Parameters

entryId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "module": {
      "type": "string"
    },
    "configName": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": {
      "type": "boolean"
    },
    "enabled": {
      "type": "boolean"
    },
    "value": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "metadata": {
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "module",
    "configName"
  ]
}
modify_entry(entryId: str, entry: dict)

Update entry item with given {entryId}

PUT /configurations/entries/{entryId}

Parameters
  • entryId (str) –

  • entry (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "module": {
      "type": "string"
    },
    "configName": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": {
      "type": "boolean"
    },
    "enabled": {
      "type": "boolean"
    },
    "value": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "metadata": {
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "module",
    "configName"
  ]
}
set_entry(entry: dict)

Create a new entry item.

POST /configurations/entries

Parameters

entry (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiRequestFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created entry item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "module": {
      "type": "string"
    },
    "configName": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "default": {
      "type": "boolean"
    },
    "enabled": {
      "type": "boolean"
    },
    "value": {
      "type": "string"
    },
    "userId": {
      "type": "string"
    },
    "metadata": {
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "module",
    "configName"
  ]
}