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. |
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. |
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 |
||
method |
string |
<optional> |
'get' | Request method ( |
tenant |
string | Name of the Dynatrace tenant ( |
||
baseURL |
string | URL of the Dynatrace tenant ( |
||
headers |
object |
<optional> |
Plain |
|
params |
object |
<optional> |
URL parameters to be sent with the request. Must be a plain |
|
data |
object |
<optional> |
Must be of one of the following types: |
|
noQueue |
boolean |
<optional> |
false | Specifies whether the request should be rejected if due to throttling it cannot immediately be issued ( |
timeout |
number |
<optional> |
5000 | Number of milliseconds before the request times out. If the request takes longer than |
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 |
|
responseType |
string |
<optional> |
'json' | Specifies the type of data that the server will respond with. Options are: |
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 |
cancelToken |
function |
<optional> |
Specifies a cancel token that can be used to cancel the request. See Axios documentation for details. Note that |
|
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 |
TenantConfig
Represents the configuration for a tenant.
Properties:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
name |
string | Name of tenant as used in the |
||
host |
string | The address of the tenant. Either this or the |
||
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 |
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. |