Aura configuration API routing filter plugin

Routing filter plugin description for aura-configuration-api

Introduction

The routing filter plugin defines services associated with the management of routing filter in aura-configuration-api server.

All these services are defined in the routing-filters namespace (/routing-filters).

Servers definition

By default, the servers defined in the swagger include the base path (for v2): /aura-services/v2/configuration.

Therefore, in order to access the services, the base path and service path must be used.

Examples:

  • aura-services/v2/configuration/routing-filters
  • aura-services/v2/configuration/routing-filters/{filterId}

Endpoints

Path Method Description
/routing-filters/ GET Get all routing filters information
/routing-filters/ POST Add a new routing filter
/routing-filters/{filterId} GET Get routing filter information using filter id
/routing-filters/{filterId} PUT Replace routing filter information associated to filter id
/routing-filters/{filterId} PATCH Update some fields of routing filter information using filter id
/routing-filters/{filterId} DELETE Delete routing filter information using filter id
/routing-filters/entities GET Get all entities associated with routing filters

You can read the complete documentation of each service in the aura-configuration-api swagger file.

Database for routing filters data

A database will be created, if it does not exist, to add the necessary collections for the filters to work. The database name is set in the environment variable AURA_ROUTING_FILTERS_DATA_DB and has as default value routing-filters-data-ENV.

Filters collections

Each filter has two collections associated with it, one for the raw data, which can be shared with other filters, and one for the summaries. These collections are created when the filter is created, and are deleted when the filter is deleted. The shared collection will only be deleted if there are no filters using it. The names for these collections are within the filter model.

......
    "dataBase": {
        "dataFilterCollection": {    <---- Raw Data
            "collectionName": "dataFilterTest",
            "expiration": 5184000,         <-- seconds to expire data
            "indexes": [
                { 
                 "seqId": 1 
                }
            ]
        },
        "dataSummaryCollection": {  <---- Summary Data>
            "collectionName": "dataSummaryTest",
            "expiration": 5184000,        <-- seconds to expire data
            "indexes": [
                { 
                 "itemId": 1 
                },
                {
                    "total": 1,
                    "month": 1,
                    "year": 1
                }
            ]
        }
    }
.....

Collections must have an expiration time so that the data does not remain permanently in Mongodb. The value of the expiration field is set to seconds. If create indexes is needed, these can be defined in “indexes” property.

Retrieving information from routing filters

Retrieving specific fields from routing filter information

It is possible to get only a specific list of fields for routing filter information, reducing the amount of data transmitted when necessary, using the includeFields query parameter.

curl --location --request GET 'http://aura-configuration-api:8999/aura-services/v2/configuration/routing-filters?includeFields=id,name' \
--header 'correlator: urn:uuid:c8a604ee-29f8-7cda-2979-d2ae6189c360' \
--header 'Accept: application/json' \
--header 'Authorization: XXX'

Response example:

[
    {
        "id": "b6340f13-34af-4891-8a88-22bdffe9485b",
        "name": "UserId_LLM_Limits"
    }
]

Excluding fields in filters information

It is also possible to exclude filters information fields using the excludeFields query parameter.

curl --location --request GET 'http://aura-configuration-api:8999/aura-services/v2/configuration/routing-filters?excludeFields=name,vars,match,metadata,applyFilter, fields, sourceFilters,summary,summaryFilter' \
--header 'correlator: urn:uuid:c8a604ee-29f8-7cda-2979-d2ae6189c360' \
--header 'Accept: application/json' \
--header 'Authorization: APIKEY XXX'

Response example:

[
    {
        "id": "b6340f13-34af-4891-8a88-22bdffe9485b",
        "description": "Limit the number of messages per user in a month for triage preset",
        "type": "userId",
        "entities": [
            "GATEWAYMESSAGE"
        ],
        "dataBase": {
            "dataFilterCollection": {
                "collectionName": "dataFilterTriage",
                "expiration": 89
            },
            "dataSummaryCollection": {
                "collectionName": "dataSummaryTriage",
                "expiration": 89
            }
        }
    }
]

Database

The complete definition of the data model can be found in routing-filters collection section within the administration module.