Configure OpenAPI Defaults and Limits

To perform operations that heavily affect the system during off-hours, override the QueryBuilder properties. You can override several parameters in the QueryBuilder. The default parameter values that are defined in the OData limiters configuration file protect the system from OpenAPI queries that negatively affect the overall system performance. These parameters either limit the returned set of results, or define the timeout threshold for potentially large operations. You can customize and override the default parameter values, which vary according to the scale and capability of the system.
To perform operations that heavily affect the system during off-hours, override the QueryBuilder properties. You can override several parameters in the QueryBuilder. The default parameter values that are defined in the OData limiters configuration file protect the system from OpenAPI queries that negatively affect the overall system performance. These parameters either limit the returned set of results, or define the timeout threshold for potentially large operations. You can customize and override the default parameter values, which vary according to the scale and capability of the system.
Override an OpenAPI Parameter
To override a parameter, append the following code to the OpenAPI URL:
&<Override_parameter>=<override_value>
For example, to override  the number of rows that are returned for a device query, use the following URL:
http://
da_host
:8581/odata/api/devices?$expand=cpumfs&$select=Name,PrimaryIPAddress,cpumfs/im_MemoryUtilization,cpumfs/im_Utilization
&$top=200
The following parameters can be overridden:
Parameter
Default Value
Override
Description
defaultTopLimit
50
$top
Number of rows to return
defaultExpandTopLimit
100
top
Custom parameter for number of expanded rows to return
defaultQueryTimeoutSecs
30 (sec)
timeout
Custom parameter for overall time query can execute before timeout exception
Configure Web Service Parameter
The OpenAPI web service parameters limit concurrent use and limit the processing time for requests beyond that limit.
To override a web service parameter, edit the value in the following configuration file:
/opt/IMDataAggregator/apache-karaf-<
vers
>/etc/com.ca.im.odata.filters.OpenAPIRequestLimiterFilter.cfg
You can override the following web service parameters.
  • maxRequests
    Number of simultaneous OpenAPI requests. Other requests are suspended until one of the current queries finishes.
    Default:
    4
  • suspendMs
    The length of time, in milliseconds, that each additional request is suspended when the OpenAPI reaches the maximum number of simultaneous requests. For example, specifying 20000 suspends the request for 20 seconds, after which time the request is rejected. A rejected request generates the 503 Unavailable error, and the OpenAPI does not run the query again automatically.
    Default:
    -1 (Use the value of defaultQueryTimeoutSecs)
  • waitMS
    The length of time, in milliseconds, to wait before trying to accept a new request. This parameter is used when the
    maxRequests
    limit is reached. Set this parameter to the same value as
    defaultQueryTimeoutSecs
    in the following file:
    /opt/IMDataAggregator/apache-karaf-
    <vers>
    /etc/com.ca.im.odata.beans.ODataLimiters.cfg
    .
Configure Maximum Results
To modify the defaults or increase the limit, configure the values for the number of rows that OpenAPI queries return.
Follow these steps:
  1. Log on to the Data Aggregator host.
  2. Locate and edit the following file:
    /opt/IMDataAggregator/apache-karaf-
    <vers>
    /etc/com.ca.im.odata.beans.ODataLimiters.cfg
  3. Modify the file to set the limits and defaults. The following example shows the default values for this file. The bold attributes control the limits and defaults:
    defaultTopLimit=50
    defaultExpandTopLimit=100
    maxTopLimit=20000
    maxSubQueryLimit=2000000
    defaultRateTimeIntervalSecs=3600
    defaultHourlyTimeIntervalHours=168
    defaultDailyTimeIntervalDays=30
    defaultWeeklyTimeIntervalWeeks=52
    defaultQueryTimeoutSecs=30
    maxQueryTimeoutSecs=120
    • defaultTopLimit
      Defines the default value for the maximum number of rows in the output.
      Default:
      50
    • defaultExpandTopLimit
      Defines the default value for the maximum number of expanded rows in the output.
      Default:
      100
    • maxTopLimit
      Defines the limit for the value in the maximum number of rows in the output.
      Default:
      20000
    • maxSubQueryLimit
      Defines the maximum number of expanded rows that an OpenAPI query can return. In QueryBuilder, the limit for the maximum number of expanded rows is calculated by dividing this value by the specified value for the maximum number of rows.
      Default:
      2000000
    • defaultRateTimeIntervalSecs
      Defines the default value for the query time interval when the resolution equals rate. If the time interval is unspecified, the query time is for 3,600 seconds (one day).
      Default:
      3600
    • defaultHourlyTimeIntervalHours
      Defines the default value for the query time interval when the resolution equals hour. If the time interval is unspecified, the query time is for 168 hours (7 days).
      Default:
      168
    • defaultDailyTimeIntervalDays
      Defines the default value for the query time interval when the resolution equals day. If the time interval is unspecified, the query time is for 30 days.
      Default:
      30
    • defaultWeeklyTimeIntervalWeeks
      Defines the default value for the query time interval when the resolution equals week. If the time interval is unspecified, the query time is for 52 weeks.
      Default:
      52
    • defaultQueryTimeoutSecs
      Defines the standard timeout for all queries.
      Default:
      30
    • maxQueryTimeoutSecs
      Defines the maximum timeout, which can be specified in the URL with the
      timeout
      parameter.
      Default:
      120
  4. Save the changes.
    The new values apply when you load or reload QueryBuilder in the browser.