foliolib.folio.api.fincConfig.FincConfigMetadataSources

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

Bases: foliolib.folio.FolioApi

mod-finc-config API

This documents the API calls that can be made to query and manage metadata sources for all tenants/isils

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_metadataSource(metadataSourcesId)

Delete an metadata source identified by id

get_contacts(**kwargs)

Get all contacts defined in metadata sources

get_metadataSource(metadataSourcesId)

Get one metadata source identified by id

get_metadataSources(**kwargs)

Get all metadata sources

get_tinyMetadataSources(**kwargs)

Get all tiny metadata sources

modify_metadataSource(metadataSourcesId, ...)

Put an metadata source identified by id

set_contact(contact)

Post new metadata source

set_metadataSource(metadataSource)

Post new metadata source

set_tinyMetadataSource(tinyMetadataSource)

Post new metadata source

delete_metadataSource(metadataSourcesId: str)

Delete an metadata source identified by id

DELETE /finc-config/metadata-sources/{metadataSourcesId}

Parameters

metadataSourcesId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_contacts(**kwargs)

Get all contacts defined in metadata sources

GET /finc-config/contacts

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.

    Example

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

    • ((label=”Journals*” or sourceId=”Journals*”) and status=(“active” or “technical implementation”)) sortby label

  • orderBy (str) – Order by field: label, sourceId, status, solrShard, lastProcessed

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of contacts of metadata sources in finc app",
  "properties": {
    "contacts": {
      "type": "array",
      "description": "List of contacts",
      "id": "contacts",
      "items": {
        "type": "object",
        "$ref": "contact.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "contacts",
    "totalRecords"
  ]
}
get_metadataSource(metadataSourcesId: str)

Get one metadata source identified by id

GET /finc-config/metadata-sources/{metadataSourcesId}

Parameters

metadataSourcesId (str) –

Returns

See Schema below

Return type

dict

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Metadata Source Schema",
  "description": "Metadata source in finc config",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this metadata source"
    },
    "description": {
      "type": "string",
      "description": "A globally unique (UUID) identifier"
    },
    "status": {
      "type": "string",
      "description": "Current status of metadata source",
      "enum": [
        "active",
        "closed",
        "impossible",
        "implementation",
        "request"
      ]
    },
    "organization": {
      "type": "object",
      "description": "The organization delivering content of this metadata source",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the the sources content\u2019s organization, linked via uuid from organizations app."
        },
        "name": {
          "type": "string",
          "description": "Organization's name. If not given, it will be determined by backend module."
        }
      }
    },
    "contacts": {
      "type": "array",
      "description": "List of contacts",
      "minItems": 0,
      "items": {
        "type": "object",
        "$ref": "contact.json"
      }
    },
    "indexingLevel": {
      "type": "string",
      "description": "Level used for indexing (e.g. bibliographic)"
    },
    "generalNotes": {
      "type": "string",
      "description": "General notes not fitting into the other fields"
    },
    "lastProcessed": {
      "type": "string",
      "format": "date-time",
      "description": "Date of last processing"
    },
    "tickets": {
      "type": "array",
      "description": "Links to internal tickets corresponding to this metadata source",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "accessUrl": {
      "type": "string",
      "description": "URL to access metadata source"
    },
    "sourceId": {
      "type": "integer",
      "description": "The source id"
    },
    "solrShard": {
      "type": "string",
      "description": "Used solr shard",
      "enum": [
        "SLUB DBoD",
        "SLUB dswarm",
        "UBL ai",
        "UBL DNB",
        "UBL main"
      ]
    },
    "deliveryMethods": {
      "type": "array",
      "description": "Available delivery methods (e.g. API download)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "formats": {
      "type": "array",
      "description": "Available formats (e.g. MARC)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "updateRhythm": {
      "type": "string",
      "description": "Metadata source's update rhythm"
    },
    "inferiorTo": {
      "type": "array",
      "description": "Link to other metadata sources",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "selectedBy": {
      "type": "array",
      "description": "List of tenants/libraries which selected this metadata source",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "isil": {
            "type": "string",
            "description": "Isil of library/tenant which selected this metadata source"
          },
          "selected": {
            "description": "Indicator if the tenant/library has selected this metadata source",
            "enum": [
              "all",
              "some",
              "none"
            ]
          }
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "id",
    "label",
    "status",
    "sourceId"
  ],
  "additionalProperties": false
}
get_metadataSources(**kwargs)

Get all metadata sources

GET /finc-config/metadata-sources

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.

    Example

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

    • ((label=”Journals*” or sourceId=”Journals*”) and status=(“active” or “technical implementation”)) sortby label

  • orderBy (str) – Order by field: label, sourceId, status, solrShard, lastProcessed

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of metadata sources in finc config",
  "properties": {
    "fincConfigMetadataSources": {
      "type": "array",
      "id": "fincConfigMetadataSourcesData",
      "description": "List of metadata sources in finc config",
      "items": {
        "type": "object",
        "$ref": "fincConfigMetadataSource.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "sources",
    "totalRecords"
  ]
}
get_tinyMetadataSources(**kwargs)

Get all tiny metadata sources

GET /finc-config/tiny-metadata-sources

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.

    Example

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

    • ((label=”Journals*” or sourceId=”Journals*”) and status=(“active” or “technical implementation”)) sortby label

  • orderBy (str) – Order by field: label, sourceId, status, solrShard, lastProcessed

  • order (str (desc|asc) – ): (default=desc) Order

  • 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

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "description": "Collection of tiny metadata sources in finc app",
  "properties": {
    "tinyMetadataSources": {
      "type": "array",
      "description": "List of tiny metadata sources",
      "id": "tinyMetadataSourcesData",
      "items": {
        "type": "object",
        "$ref": "tinyMetadataSource.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "sources",
    "totalRecords"
  ]
}
modify_metadataSource(metadataSourcesId: str, metadataSource: dict)

Put an metadata source identified by id

PUT /finc-config/metadata-sources/{metadataSourcesId}

Parameters
  • metadataSourcesId (str) –

  • metadataSource (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Metadata Source Schema",
  "description": "Metadata source in finc config",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this metadata source"
    },
    "description": {
      "type": "string",
      "description": "A globally unique (UUID) identifier"
    },
    "status": {
      "type": "string",
      "description": "Current status of metadata source",
      "enum": [
        "active",
        "closed",
        "impossible",
        "implementation",
        "request"
      ]
    },
    "organization": {
      "type": "object",
      "description": "The organization delivering content of this metadata source",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the the sources content\u2019s organization, linked via uuid from organizations app."
        },
        "name": {
          "type": "string",
          "description": "Organization's name. If not given, it will be determined by backend module."
        }
      }
    },
    "contacts": {
      "type": "array",
      "description": "List of contacts",
      "minItems": 0,
      "items": {
        "type": "object",
        "$ref": "contact.json"
      }
    },
    "indexingLevel": {
      "type": "string",
      "description": "Level used for indexing (e.g. bibliographic)"
    },
    "generalNotes": {
      "type": "string",
      "description": "General notes not fitting into the other fields"
    },
    "lastProcessed": {
      "type": "string",
      "format": "date-time",
      "description": "Date of last processing"
    },
    "tickets": {
      "type": "array",
      "description": "Links to internal tickets corresponding to this metadata source",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "accessUrl": {
      "type": "string",
      "description": "URL to access metadata source"
    },
    "sourceId": {
      "type": "integer",
      "description": "The source id"
    },
    "solrShard": {
      "type": "string",
      "description": "Used solr shard",
      "enum": [
        "SLUB DBoD",
        "SLUB dswarm",
        "UBL ai",
        "UBL DNB",
        "UBL main"
      ]
    },
    "deliveryMethods": {
      "type": "array",
      "description": "Available delivery methods (e.g. API download)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "formats": {
      "type": "array",
      "description": "Available formats (e.g. MARC)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "updateRhythm": {
      "type": "string",
      "description": "Metadata source's update rhythm"
    },
    "inferiorTo": {
      "type": "array",
      "description": "Link to other metadata sources",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "selectedBy": {
      "type": "array",
      "description": "List of tenants/libraries which selected this metadata source",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "isil": {
            "type": "string",
            "description": "Isil of library/tenant which selected this metadata source"
          },
          "selected": {
            "description": "Indicator if the tenant/library has selected this metadata source",
            "enum": [
              "all",
              "some",
              "none"
            ]
          }
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "id",
    "label",
    "status",
    "sourceId"
  ],
  "additionalProperties": false
}
set_contact(contact: dict)

Post new metadata source

POST /finc-config/contacts

Parameters

contact (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created contact item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "title": "Contact",
  "description": "Contact schema",
  "properties": {
    "type": {
      "type": "string",
      "description": "The contact's type. This indicates if the contact originates from the users module or the organizations module.",
      "enum": [
        "user",
        "contact"
      ]
    },
    "externalId": {
      "type": "string",
      "description": "The external id of this contact in the module specified by the type (users or organizations module)."
    },
    "name": {
      "description": "The contact's name (lastName, firstName)",
      "type": "string"
    },
    "role": {
      "type": "string",
      "description": "The contact's role",
      "enum": [
        "subject specialist",
        "librarian",
        "technical",
        "vendor"
      ]
    }
  },
  "required": [
    "externalId",
    "type",
    "name",
    "role"
  ]
}
set_metadataSource(metadataSource: dict)

Post new metadata source

POST /finc-config/metadata-sources

Parameters

metadataSource (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created metadataSource item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Metadata Source Schema",
  "description": "Metadata source in finc config",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this metadata source"
    },
    "description": {
      "type": "string",
      "description": "A globally unique (UUID) identifier"
    },
    "status": {
      "type": "string",
      "description": "Current status of metadata source",
      "enum": [
        "active",
        "closed",
        "impossible",
        "implementation",
        "request"
      ]
    },
    "organization": {
      "type": "object",
      "description": "The organization delivering content of this metadata source",
      "properties": {
        "id": {
          "type": "string",
          "description": "Id of the the sources content\u2019s organization, linked via uuid from organizations app."
        },
        "name": {
          "type": "string",
          "description": "Organization's name. If not given, it will be determined by backend module."
        }
      }
    },
    "contacts": {
      "type": "array",
      "description": "List of contacts",
      "minItems": 0,
      "items": {
        "type": "object",
        "$ref": "contact.json"
      }
    },
    "indexingLevel": {
      "type": "string",
      "description": "Level used for indexing (e.g. bibliographic)"
    },
    "generalNotes": {
      "type": "string",
      "description": "General notes not fitting into the other fields"
    },
    "lastProcessed": {
      "type": "string",
      "format": "date-time",
      "description": "Date of last processing"
    },
    "tickets": {
      "type": "array",
      "description": "Links to internal tickets corresponding to this metadata source",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "accessUrl": {
      "type": "string",
      "description": "URL to access metadata source"
    },
    "sourceId": {
      "type": "integer",
      "description": "The source id"
    },
    "solrShard": {
      "type": "string",
      "description": "Used solr shard",
      "enum": [
        "SLUB DBoD",
        "SLUB dswarm",
        "UBL ai",
        "UBL DNB",
        "UBL main"
      ]
    },
    "deliveryMethods": {
      "type": "array",
      "description": "Available delivery methods (e.g. API download)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "formats": {
      "type": "array",
      "description": "Available formats (e.g. MARC)",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "updateRhythm": {
      "type": "string",
      "description": "Metadata source's update rhythm"
    },
    "inferiorTo": {
      "type": "array",
      "description": "Link to other metadata sources",
      "minItems": 0,
      "items": {
        "type": "string"
      }
    },
    "selectedBy": {
      "type": "array",
      "description": "List of tenants/libraries which selected this metadata source",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "isil": {
            "type": "string",
            "description": "Isil of library/tenant which selected this metadata source"
          },
          "selected": {
            "description": "Indicator if the tenant/library has selected this metadata source",
            "enum": [
              "all",
              "some",
              "none"
            ]
          }
        }
      }
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema"
    }
  },
  "required": [
    "id",
    "label",
    "status",
    "sourceId"
  ],
  "additionalProperties": false
}
set_tinyMetadataSource(tinyMetadataSource: dict)

Post new metadata source

POST /finc-config/tiny-metadata-sources

Parameters

tinyMetadataSource (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created tinyMetadataSource item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "title": "Metadata Source Tiny Schema",
  "description": "Tiny metadata source in finc select",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "A unique name for this metadata source"
    }
  },
  "required": [
    "id",
    "label"
  ],
  "additionalProperties": false
}