foliolib.folio.api.ermUsage.Aggregatorsettings

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

Bases: foliolib.folio.FolioApi

mod-erm-usage API

This documents the API calls that can be made to query and manage aggregator settings

Parameters
  • tenant (str) – Tenant id

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

Methods

delete_aggregatorSetting(aggregatorSettingsId)

Delete aggregator setting identified by id

get_aggregatorSetting(aggregatorSettingsId)

Get one aggregator setting identified by id

get_aggregatorSettings(**kwargs)

Get all aggregator settings

get_exportcredentials_by_aggregatorSetting(...)

Get SushiCredentials associated with this aggregator

modify_aggregatorSetting(...)

Put aggregator setting identified by id

set_aggregatorSetting(aggregatorSetting)

Post new aggregator settings

delete_aggregatorSetting(aggregatorSettingsId: str)

Delete aggregator setting identified by id

DELETE /aggregator-settings/{aggregatorSettingsId}

Parameters

aggregatorSettingsId (str) –

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

get_aggregatorSetting(aggregatorSettingsId: str)

Get one aggregator setting identified by id

GET /aggregator-settings/{aggregatorSettingsId}

Parameters

aggregatorSettingsId (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": "Aggregator Settings Schema",
  "title": "Aggregator Settings Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "description": "Aggregator label",
      "type": "string"
    },
    "serviceType": {
      "type": "string",
      "description": "Specifies implementation specific for this aggregator as defined in mod-erm-usage-harvester."
    },
    "serviceUrl": {
      "type": "string",
      "description": "Aggregator\u2019s service URL to use for harvesting."
    },
    "aggregatorConfig": {
      "type": "object",
      "description": "Additional key/value pairs for aggregator configuration"
    },
    "accountConfig": {
      "description": "Account configuration",
      "type": "object",
      "properties": {
        "configType": {
          "description": "Specifies how the vendor's access parameters are submitted to the aggregator. These parameters are used by the aggregator to login into the vendor in order to fetch the usage data.",
          "type": "string",
          "enum": [
            "Mail",
            "API",
            "Manual"
          ]
        },
        "configMail": {
          "description": "Given if configType == mail",
          "type": "string"
        },
        "displayContact": {
          "description": "Free text info to display to the user with the SUSHI settings in the eUsage app frontend.",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "configType"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "label",
    "serviceType",
    "serviceUrl",
    "accountConfig"
  ],
  "additionalProperties": true
}
get_aggregatorSettings(**kwargs)

Get all aggregator settings

GET /aggregator-settings

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=”Server*”) and aggregatorConfig.reportRelease=”4”

  • orderBy (str) – Order by field: label

  • 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#",
  "description": "List of AggregatorSettings",
  "type": "object",
  "properties": {
    "aggregatorSettings": {
      "type": "array",
      "description": "Entries",
      "id": "aggregatorsettings",
      "items": {
        "type": "object",
        "$ref": "aggregatorsetting.json"
      }
    },
    "totalRecords": {
      "type": "integer"
    }
  },
  "required": [
    "aggregatorSettings",
    "totalRecords"
  ]
}
get_exportcredentials_by_aggregatorSetting(aggregatorSettingsId: str, **kwargs)

Get SushiCredentials associated with this aggregator

GET /aggregator-settings/{aggregatorSettingsId}/exportcredentials

Parameters
  • aggregatorSettingsId (str) –

  • **kwargs (properties) – Keyword Arguments

Keyword Arguments

format (str) – (default=csv) Specify export format (default is CSV)

Raises
  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

modify_aggregatorSetting(aggregatorSettingsId: str, aggregatorSetting: dict)

Put aggregator setting identified by id

PUT /aggregator-settings/{aggregatorSettingsId}

Parameters
  • aggregatorSettingsId (str) –

  • aggregatorSetting (dict) – See Schema below

Raises
  • OkapiRequestNotFound – Not Found

  • OkapiRequestError – Bad Request

  • OkapiFatalError – Server Error

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Aggregator Settings Schema",
  "title": "Aggregator Settings Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "description": "Aggregator label",
      "type": "string"
    },
    "serviceType": {
      "type": "string",
      "description": "Specifies implementation specific for this aggregator as defined in mod-erm-usage-harvester."
    },
    "serviceUrl": {
      "type": "string",
      "description": "Aggregator\u2019s service URL to use for harvesting."
    },
    "aggregatorConfig": {
      "type": "object",
      "description": "Additional key/value pairs for aggregator configuration"
    },
    "accountConfig": {
      "description": "Account configuration",
      "type": "object",
      "properties": {
        "configType": {
          "description": "Specifies how the vendor's access parameters are submitted to the aggregator. These parameters are used by the aggregator to login into the vendor in order to fetch the usage data.",
          "type": "string",
          "enum": [
            "Mail",
            "API",
            "Manual"
          ]
        },
        "configMail": {
          "description": "Given if configType == mail",
          "type": "string"
        },
        "displayContact": {
          "description": "Free text info to display to the user with the SUSHI settings in the eUsage app frontend.",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "configType"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "label",
    "serviceType",
    "serviceUrl",
    "accountConfig"
  ],
  "additionalProperties": true
}
set_aggregatorSetting(aggregatorSetting: dict)

Post new aggregator settings

POST /aggregator-settings

Parameters

aggregatorSetting (dict) – See Schema below

Raises
  • OkapiRequestError – Bad Request

  • OkapiRequestUnauthorized – Authentication is required

  • OkapiFatalError – Server Error

  • OkapiRequestUnprocessableEntity – Unprocessable Entity

Headers

  • Location - URI to the created aggregatorSetting item

Schema

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "Aggregator Settings Schema",
  "title": "Aggregator Settings Schema",
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "label": {
      "description": "Aggregator label",
      "type": "string"
    },
    "serviceType": {
      "type": "string",
      "description": "Specifies implementation specific for this aggregator as defined in mod-erm-usage-harvester."
    },
    "serviceUrl": {
      "type": "string",
      "description": "Aggregator\u2019s service URL to use for harvesting."
    },
    "aggregatorConfig": {
      "type": "object",
      "description": "Additional key/value pairs for aggregator configuration"
    },
    "accountConfig": {
      "description": "Account configuration",
      "type": "object",
      "properties": {
        "configType": {
          "description": "Specifies how the vendor's access parameters are submitted to the aggregator. These parameters are used by the aggregator to login into the vendor in order to fetch the usage data.",
          "type": "string",
          "enum": [
            "Mail",
            "API",
            "Manual"
          ]
        },
        "configMail": {
          "description": "Given if configType == mail",
          "type": "string"
        },
        "displayContact": {
          "description": "Free text info to display to the user with the SUSHI settings in the eUsage app frontend.",
          "type": "array",
          "minItems": 0,
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "configType"
      ]
    },
    "metadata": {
      "description": "Metadata about creation and changes, provided by the server (client should not provide)",
      "type": "object",
      "$ref": "../raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "required": [
    "label",
    "serviceType",
    "serviceUrl",
    "accountConfig"
  ],
  "additionalProperties": true
}