Global

Type Definitions

RequestCallback(error, data)

Parameters:
Name Type Description
error RequestError

The error if the request could not be fulfilled.

data object

The Dynatrace API's response, as a parsed JSON object, if the request was succesful.

Source:

RequestError

A unified error object that consolidates the various types of errors that may happen while initializating a request, issuing it, and processing its response.

Properties:
Name Type Attributes Default Description
status object

An internal error code (string) or an HTTP status code (number).

message string

Human-readble description of the error.

url string

Original (relative) URL.

baseURL string

Effective base URL.

method string

Request method used.

params string <optional>
null

Query parameters passed.

data string <optional>
null

Data sent in the request body.

Source:

RequestOptions

The options object support all options supported by Axios, except where otherwise noted below. This implementation also adds a couple of additional options (i.e. tenant, noQueue and maxRetries) that are specific to this implementation. Note that either a tenant or a baseURL must be provided, but not both.

Properties:
Name Type Attributes Default Description
url string

URL relative to the baseURL or the tenant. Ex.: '/api/v2/entities'.

method string <optional>
'get'

Request method ('get', 'put', 'post', 'delete').

tenant string

Name of the Dynatrace tenant (BalancedAPIRequest only - not an Axios property). Ex.: 'PROD'.

baseURL string

URL of the Dynatrace tenant (DirectAPIRequest only). Ex.: 'https://abc12345.live.dynatrace.com'.

headers object <optional>

Plain object containing the headers to be set in the request. Ex.: { 'Authorization': 'token XYZ' }.

params object <optional>

URL parameters to be sent with the request. Must be a plain object or a URLSearchParams object. Ex.: { ID: 12345 }.

data object <optional>

Must be of one of the following types: string, object, ArrayBuffer, ArrayBufferView, URLSearchParams, Stream, Buffer. Ex.: { firstName: 'Bart' }.

noQueue boolean <optional>
false

Specifies whether the request should be rejected if due to throttling it cannot immediately be issued (BalancedAPIRequest only - not an Axios property).

timeout number <optional>
5000

Number of milliseconds before the request times out. If the request takes longer than timeout, it will be aborted (if it has been issued already) or cancelled (if it is still waiting in a queue).

retryAfter number <optional>

Number of milliseconds to wait before trying again after a 429 or 503 status is received and the response does not contain a 'Retry-After' header. If not provided, the default from the constructor is used.

maxRedirects number <optional>
5

Maximum number of redirects to follow. If set to 0, no redirects will be followed.

maxRetries number <optional>
3

Maximum number of retries allowed if a potentially transient error is encountered (not an Axios property).

maxBodyLength number <optional>
2000

Maximum size of the http request content in bytes.

maxContentLength number <optional>
2000

Maximum size of the http response content in bytes.

validateStatus function <optional>

IGNORED This parameter is set by BalancedAPIRequest and DirectAPIRequest internally.

responseType string <optional>
'json'

Specifies the type of data that the server will respond with. Options are: 'arraybuffer', 'document', 'json', 'text', 'stream'. Note: The automatic paging support only works then this value is set to 'json'.

withCredentials boolean <optional>
false

Specifies whether or not cross-site Access-Control requests should be made using credentials.

responseEncoding string <optional>
'utf8'

Encoding to use for decoding responses. Note: Ignored when responseType is 'stream'.

cancelToken function <optional>

Specifies a cancel token that can be used to cancel the request. See Axios documentation for details. Note that BalancedAPIRequest sets this property to create and return a CancellablePromise or a CancellableEventEmitter through which requests can be cancelled.

socketPath object <optional>

See Axios documentation.

proxy object <optional>

See Axios documentation.

httpAgent object <optional>

See Axios documentation.

httpsAgent object <optional>

See Axios documentation.

decompress boolean <optional>
true

Specifies whether or not the response body should be decompressed automatically. If set to true will also remove the 'content-encoding' header from the response objects of all decompressed responses. Note: The automatic paging support only works then this value is set to true.

Source:

TenantConfig

Represents the configuration for a tenant.

Properties:
Name Type Attributes Default Description
name string

Name of tenant as used in the tenant property of RequestOptions.

host string

The address of the tenant. Either this or the hosts property must be present.

hosts Array.<string>

A list of addresses of nodes at which the tenant can be reached. This is typically a subset of cluster nodes (for Managed Clusters).

url string

If the nodes(s) are of a Managed Cluster, this is the environment URL. Ex.: /e/123-456-345

token string

The Dynatrace API token to be used to execute the requests. The permissions this token should represent depends on the APIs that are permitted to be used.

maxRetries string <optional>
3

Maximum number of retries before reporting an error. Note that
retry attempts will stop once the 'timeout' value gets exceeded.

reqRateLimit string <optional>
200

Maximum number of API requests per minute allowed against this tenant.

maxQueueSize string <optional>
1000

Maximum length of the queue. The actual size is typically kept in check by virtue of the request rate limit.

maxQueueTime string <optional>
5000

Maximum number of milliseconds a request may be queued. A request will be cancelled with 408 status if it stays queued for too long.

requestLimit string <optional>
20

Maximum allowed number of concurrently active (i.e. issued) requests.

timeout string <optional>
5000

Number of milliseconds before a request times out once issued. If a request takes longer than this value, it will be aborted.

retryAfter string <optional>
5000

Number of milliseconds to wait before retrying after a 429 or 503 status where the response does not contain a 'Retry-After' header.

Source: