Constructor
new BalancedAPIRequest(limits, tenants)
Creates a pool of connections to reach multiple tenants and clusters.
Parameters:
| Name | Type | Description |
|---|---|---|
limits |
object | Default values for |
tenants |
Array.<TenantConfig> | The configurations for the tenants. |
- Source:
Methods
(async) fetch(options, onDoneopt) → {CancellableEventEmitter|CancellablePromise}
Note that in this class the RequestOptions object also supports the noQueue property.
Required properties in the RequestOptions object (unless an alias is used - see below):
url: URL relative to thetenant. Ex.:'/api/v2/entities'.tenant: Name of the Dynatrace tenant. Ex.:'PROD'.
For convenience aliases have been provided for the following request methods:
get(url, options[, onDone])delete(url, options[, onDone])post(url, data, options[, onDone])put(url, data, options[, onDone])
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
options |
RequestOptions | The request options, Axios-style. |
|
onDone |
RequestCallback |
<optional> |
Callback that handles the result (alternative to using a Promise). |
- Source:
Returns:
If onDone is provided, this method returns a CancellableEventEmitter.
Else, this method returns a CancellablePromise.
getHealthMetrics(frequencyopt, callbackopt)
Report the health of the connection pool. If no parameters are specified, the health report will be returned. If both parameters are specified, the callback will be called with the health report as its only parameter, per the specified frequency.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
frequency |
number |
<optional> |
The requency with which the health of the connection pool should be reported. |
callback |
function |
<optional> |
The function that consumes the health report. |
- Source:
restart()
Cancel all running and/or queued requests and reset the connection pool.
- Source:
shutdown()
Cancel all running and/or queued requests and delete the connection pool.
- Source: