There is a limit on the number of requests a tenant can make per day and per week.
- A day is the start of the day of the request. The end is the end of that day.
- A week starts for a tenant on the day of the week the API key is generated.
MVISION Cloud stores all valid requests that have responded with a valid response in the database.
For each new request, we calculate the number of requests that have been previously made that day and that week. MVISION Cloud sends a failed response if the quota is exceeded.
Table to store this data is as follows:
create table TenantRegistryAccessLog( id int, TenantRegistryAPIKeys_id int, request mediumtext, validRequest int COMMENT '1 if the request is valid and 0 if the request is invalid and no csp data was sent for the request', updateTimeStamp timestamp DEFAULT CURRENT_TIMESTAMP, Primary Key (id) );
create table TenantRegistryAPIUsage( id int, TenantRegistryAPIKeys_id int, CspCountToday int Default 0 , CspCountWeek int Default 0, CspCountTotal int Default 0, DateForTodayCount timestamp, DateForWeekCount timestamp, Primary Key (id) )