Documentation of the Dynatrace Environment API v2. Resources here generally supersede those in v1. Migration of resources from v1 is in progress.
If you miss a resource, consider using the Dynatrace Environment API v1.
To read about use cases and examples, see Dynatrace Documentation.
To authorize, use a valid access token or personal access token. For usage in a Dynatrace app, refer to the Dynatrace Developer documentation.
Notes about compatibility:
- Operations marked as early adopter or preview may be changed in non-compatible ways, although we try to avoid this.
- We may add new enum constants without incrementing the API version; thus, clients need to handle unknown enum constants gracefully.
npm install @dynatrace-sdk/client-classic-environment-v2
- Visit SDK for Typescript guide in the Dynatrace Developer
- Ask a question in the Dynatrace Community
This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.
Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.
import { accessTokensActiveGateTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';
Creates a new ActiveGate token
One of the following scopes is required:
- environment-api:activegate-tokens:create
- environment-api:activegate-tokens:write
Required permission: environment:roles:manage-settings
The newly created token will be owned by the same user who owns the token used for authentication of the call.
Name | Type |
---|---|
config.body*required | ActiveGateTokenCreate |
Return type | Status code | Description |
---|---|---|
ActiveGateTokenCreated | 201 | Success. The token has been created. The body of the response contains the token secret. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.createToken({
body: {
activeGateType:
ActiveGateTokenCreateActiveGateType.Environment,
name: "myToken",
},
});
Gets metadata of an ActiveGate token
Required scope: environment-api:activegate-tokens:read Required permission: environment:roles:manage-settings
The token secret is not exposed.
Name | Type | Description |
---|---|---|
config.activeGateTokenIdentifier*required | string | The ActiveGate token identifier, consisting of prefix and public part of the token. |
Return type | Status code | Description |
---|---|---|
ActiveGateToken | 200 | Success. The response contains the metadata of the tokens. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.getToken({
activeGateTokenIdentifier: "...",
});
Lists all available ActiveGate tokens
Required scope: environment-api:activegate-tokens:read Required permission: environment:roles:manage-settings
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
Name | Type | Description |
---|---|---|
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of ActiveGate tokens in a single response payload. The maximal allowed page size is 3000 and the minimal size is 100. If not set, 100 is used. |
Return type | Status code | Description |
---|---|---|
ActiveGateTokenList | 200 | Success. The response contains the list of ActiveGate tokens. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.listTokens();
Deletes an ActiveGate token
Required scope: environment-api:activegate-tokens:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.activeGateTokenIdentifier*required | string | The ActiveGate token identifier, consisting of prefix and public part of the token to be deleted. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.revokeToken({
activeGateTokenIdentifier: "...",
});
import { accessTokensAgentTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';
Gets the agent connection token | maturity=EARLY_ADOPTER
Required scope: environment-api:agent-connection-tokens:read Required permission: environment:roles:agent-install
Returns the agent connection token.
Return type | Status code | Description |
---|---|---|
AgentConnectionToken | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { accessTokensAgentTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensAgentTokensClient.getAgentConnectionToken();
import { accessTokensApiTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';
Creates a new API token
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
The newly created token will be owned by the same user who owns the token used for authentication of the call.
Creating personal access tokens requires the environment:roles:viewer
permission. Creating access tokens requires the environment:roles:manage-settings
permission.
Name | Type |
---|---|
config.body*required | ApiTokenCreate |
Return type | Status code | Description |
---|---|---|
ApiTokenCreated | 201 | Success. The token has been created. The body of the response contains the token secret. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.createApiToken({
body: { name: "tokenName", scopes: ["metrics.read"] },
});
Deletes an API token
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.id*required | string |
The ID of the token to be deleted. You can specify either the ID or the secret of the token. You can't delete the token you're using for authentication of the request. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. You can't delete the token you're using for authentication of the request. | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.deleteApiToken({
id: "...",
});
Gets API token metadata by token ID
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
The token secret is not exposed.
Name | Type |
---|---|
config.id*required | string |
Return type | Status code | Description |
---|---|---|
ApiToken | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await accessTokensApiTokensClient.getApiToken({
id: "...",
});
Lists all available API tokens
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
Name | Type | Description |
---|---|---|
config.apiTokenSelector | string |
Filters the resulting sets of tokens. Only tokens matching the specified criteria are included into response. You can set one or more of the following criteria:
To set multiple criteria, separate them with commas ( |
config.fields | string |
Specifies the fields to be included in the response. The following fields are included by default:
To remove fields from the response, specify them with the minus ( You can include additional fields:
To add fields to the response, specify them with the plus ( Alternatively, you can define the desired set of fields in the response. Specify the required fields as a comma-separated list, without operators (for example, The fields string must be URL-encoded. |
config.from | string |
Filters tokens based on the last usage time. The start of the requested timeframe. You can use one of the following formats:
|
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of API tokens in a single response payload. The maximal allowed page size is 10000 and the minimal allowed page size is 100. If not set, 200 is used. |
config.sort | string |
The sort order of the token list. You can sort by the following properties with a sign prefix for the sort order:
If no prefix is set, + is used. If not set, tokens are sorted by creation date with newest first. |
config.to | string |
Filters tokens based on the last usage time. The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
ApiTokenList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.listApiTokens();
Gets API token metadata by token secret
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
Name | Type |
---|---|
config.body*required | ApiTokenSecret |
Return type | Status code | Description |
---|---|---|
ApiToken | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.lookupApiToken({
body: {
token:
"dt0c01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM",
},
});
Updates an API token
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.body*required | ApiTokenUpdate | |
config.id*required | string |
The ID of the token to be updated. You can't disable the token you're using for authentication of the request. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.updateApiToken({
id: "...",
body: {},
});
import { accessTokensTenantTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';
Cancels tenant token rotation
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Return type | Status code | Description |
---|---|---|
TenantTokenConfig | 200 | Success. Rotation process has been cancelled. The current tenant token remains valid. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. There is no ongoing rotation process. | Client side error. | Server side error. |
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensTenantTokensClient.cancelRotation();
Finishes tenant token rotation
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Return type | Status code | Description |
---|---|---|
TenantTokenConfig | 200 | Success. The rotation process is completed. The active field of the response contains the new tenant token. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | No ongoing rotation process. | Client side error. | Server side error. |
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensTenantTokensClient.finishRotation();
Starts tenant token rotation
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Return type | Status code | Description |
---|---|---|
TenantTokenConfig | 200 | Success. The new tenant token is created and will replace the old one. The active field of the response contains the new tenant token. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. Another rotation process is already in progress. | Client side error. | Server side error. |
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensTenantTokensClient.startRotation();
import { activeGatesActiveGateGroupsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Lists ActiveGate groups
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Return type | Status code | Description |
---|---|---|
ActiveGateGroups | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { activeGatesActiveGateGroupsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesActiveGateGroupsClient.getActiveGateGroups();
import { activeGatesAutoUpdateConfigurationClient } from '@dynatrace-sdk/client-classic-environment-v2';
Gets the configuration of auto-update for the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
Return type | Status code | Description |
---|---|---|
ActiveGateAutoUpdateConfig | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Not found. See response body for details. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.getAutoUpdateConfigById(
{ agId: "..." },
);
Gets the global auto-update configuration of environment ActiveGates.
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Return type | Status code | Description |
---|---|---|
ActiveGateGlobalAutoUpdateConfig | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant();
Updates the configuration of auto-update for the specified ActiveGate
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.body*required | ActiveGateAutoUpdateConfig |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. The auto-update configuration have been updated. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(
{
agId: "...",
body: {
setting:
ActiveGateAutoUpdateConfigSetting.Inherited,
},
},
);
Puts the global auto-update configuration of environment ActiveGates.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type |
---|---|
config.body*required | ActiveGateGlobalAutoUpdateConfig |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. The global auto-update configuration have been updated. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(
{
body: {
globalSetting:
ActiveGateGlobalAutoUpdateConfigGlobalSetting.Enabled,
},
},
);
Validates the payload for the POST /activeGates/{agId}/autoUpdate
request.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.body*required | ActiveGateAutoUpdateConfig |
Return type | Status code | Description |
---|---|---|
void | 204 | Validated. The submitted auto-update configuration is valid. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(
{
agId: "...",
body: {
setting:
ActiveGateAutoUpdateConfigSetting.Inherited,
},
},
);
Validates the payload for the POST /activeGates/autoUpdate
request.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type |
---|---|
config.body*required | ActiveGateGlobalAutoUpdateConfig |
Return type | Status code | Description |
---|---|---|
void | 204 | Validated. The submitted configuration is valid. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(
{
body: {
globalSetting:
ActiveGateGlobalAutoUpdateConfigGlobalSetting.Enabled,
},
},
);
import { activeGatesAutoUpdateJobsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Creates a new update job for the specified ActiveGate
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.body*required | UpdateJob |
Return type | Status code | Description |
---|---|---|
UpdateJob | 201 | Success. The update-job have been created. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.createUpdateJobForAg(
{
agId: "...",
body: { targetVersion: "1.190.0.20200301-130000" },
},
);
Deletes the specified update job
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.jobId*required | string | A unique identifier for a update-job of ActiveGate. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. The update-job have been deleted. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Not found. See response body for details. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.deleteUpdateJobByJobIdForAg(
{ agId: "...", jobId: "..." },
);
List ActiveGates with update jobs
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The response includes ActiveGates that have both completed (successful and failed) jobs and jobs in progress.
Name | Type | Description |
---|---|---|
config.from | string |
The start of the requested timeframe for update jobs. You can use one of the following formats:
If not set, the relative timeframe of one day is used ( Maximum timeframe is 31 days. |
config.lastUpdates | boolean | If true , filters the resulting set of update jobs to the most recent update of each type. |
config.startVersion | string | Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision> ). |
config.startVersionCompareType | "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL" |
Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. |
config.targetVersion | string | Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision> ). |
config.targetVersionCompareType | "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL" |
Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. |
config.to | string |
The end of the requested timeframe for update jobs. You can use one of the following formats:
If not set, the current timestamp is used. |
config.updateType | "SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE" | Filters the resulting set of update-jobs by the update type. |
Return type | Status code | Description |
---|---|---|
UpdateJobsAll | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.getAllUpdateJobList();
Gets the parameters of the specified update job
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.jobId*required | string | A unique identifier for a update-job of ActiveGate. |
Return type | Status code | Description |
---|---|---|
UpdateJob | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Not found. See response body for details. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.getUpdateJobByJobIdForAg(
{ agId: "...", jobId: "..." },
);
Lists update jobs for the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The job can update the ActiveGate to the specified version or the latest available one.
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.from | string |
The start of the requested timeframe for update jobs. You can use one of the following formats:
If not set, the relative timeframe of one week is used ( Maximum timeframe is 31 days. |
config.lastUpdates | boolean | If true , filters the resulting set of update jobs to the most recent update of each type. |
config.startVersion | string | Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision> ). |
config.startVersionCompareType | "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL" |
Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. |
config.targetVersion | string | Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision> ). |
config.targetVersionCompareType | "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL" |
Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. |
config.to | string |
The end of the requested timeframe for update jobs. You can use one of the following formats:
If not set, the current timestamp is used. |
config.updateType | "SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE" | Filters the resulting set of update-jobs by the update type. |
Return type | Status code | Description |
---|---|---|
UpdateJobList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Not found. See response body for details. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.getUpdateJobListByAgId(
{ agId: "..." },
);
Validates the payload for the POST /activeGates/{agId}/updateJobs
request.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
config.body*required | UpdateJob |
Return type | Status code | Description |
---|---|---|
void | 204 | Validated. The submitted update-job is valid. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.validateUpdateJobForAg(
{
agId: "...",
body: { targetVersion: "1.190.0.20200301-130000" },
},
);
import { activeGatesClient } from '@dynatrace-sdk/client-classic-environment-v2';
Lists all available ActiveGates
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The response includes all ActiveGates that are currently connected to the environment or have been connected during last 2 hours.
Name | Type | Description |
---|---|---|
config.autoUpdate | "ENABLED" | "DISABLED" | Filters the resulting set of ActiveGates by the actual state of auto-update. |
config.containerized | boolean | Filters the resulting set of ActiveGates to those which are running in container (true ) or not (false ). |
config.disabledModule | Array<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS"> | Filters the resulting set of ActiveGates by the disabled modules. |
config.enabledModule | Array<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS"> | Filters the resulting set of ActiveGates by the enabled modules. |
config.group | string |
Filters the resulting set of ActiveGates by the group. You can specify a partial name. In that case, the |
config.hostname | string |
Filters the resulting set of ActiveGates by the name of the host it's running on. You can specify a partial name. In that case, the |
config.loadBalancerAddress | string |
Filters the resulting set of ActiveGates by the Load Balancer address. You can specify a partial address. In that case, the |
config.networkAddress | string |
Filters the resulting set of ActiveGates by the network address. You can specify a partial address. In that case, the |
config.networkZone | string |
Filters the resulting set of ActiveGates by the network zone. You can specify a partial name. In that case, the |
config.online | boolean | Filters the resulting set of ActiveGates by the communication status. |
config.osArchitecture | "S390" | "X86" | "ARM" | Filters the resulting set of ActiveGates by the OS architecture of the host it's running on. |
config.osType | "LINUX" | "WINDOWS" | Filters the resulting set of ActiveGates by the OS type of the host it's running on. |
config.tokenExpirationSet | boolean | Filters the resulting set of ActiveGates to those with set expiration date for authorization token. |
config.tokenState | "UNKNOWN" | "ABSENT" | "EXPIRING" | "INVALID" | "UNSUPPORTED" | "VALID" | Filters the resulting set of ActiveGates to those with authorization token in specified state. |
config.type | "ENVIRONMENT" | "ENVIRONMENT_MULTI" | Filters the resulting set of ActiveGates by the ActiveGate type. |
config.updateStatus | "UNKNOWN" | "INCOMPATIBLE" | "OUTDATED" | "SCHEDULED" | "SUPPRESSED" | "UP2DATE" | "UPDATE_IN_PROGRESS" | "UPDATE_PENDING" | "UPDATE_PROBLEM" | Filters the resulting set of ActiveGates by the auto-update status. |
config.version | string |
Filters the resulting set of ActiveGates by the specified version. Specify the version in |
config.versionCompareType | "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL" |
Filters the resulting set of ActiveGates by the specified version. Specify the comparison operator here. |
Return type | Status code | Description |
---|---|---|
ActiveGateList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { activeGatesClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await activeGatesClient.getAllActiveGates();
Gets the details of the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.agId*required | string | The ID of the required ActiveGate. |
Return type | Status code | Description |
---|---|---|
ActiveGate | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Not found. See response body for details. | Client side error. | Server side error. |
Code example
import { activeGatesClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await activeGatesClient.getOneActiveGateById({
agId: "...",
});
import { attacksClient } from '@dynatrace-sdk/client-classic-environment-v2';
Gets the specified attack
Required scope: environment-api:attacks:read One of the following permissions is required:
- environment:roles:manage-security-problems
- environment:roles:view-security-problems
Name | Type | Description |
---|---|---|
config.fields | string |
A list of additional attack properties you can add to the response. The following properties are available (all other properties are always included and you can't remove them from the response):
To add properties, specify them in a comma-separated list and prefix each property with a plus (for example, |
config.id*required | string | The ID of the attack. |
Return type | Status code | Description |
---|---|---|
Attack | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { attacksClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await attacksClient.getAttack({ id: "..." });
Lists all attacks
Required scope: environment-api:attacks:read One of the following permissions is required:
- environment:roles:manage-security-problems
- environment:roles:view-security-problems
Name | Type | Description |
---|---|---|
config.attackSelector | string |
Defines the scope of the query. Only attacks matching the specified criteria are included in the response. You can add one or more of the following criteria. Values are not case-sensitive and the
To set several criteria, separate them with a comma ( Specify the value of a criterion as a quoted string. The following special characters must be escaped with a tilde (
|
config.fields | string |
A list of additional attack properties you can add to the response. The following properties are available (all other properties are always included and you can't remove them from the response):
To add properties, specify them in a comma-separated list and prefix each property with a plus (for example, |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of thirty days is used ( |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of attacks in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. |
config.sort | string |
Specifies one or more fields for sorting the attack list. Multiple fields can be concatenated using a comma ( You can sort by the following properties with a sign prefix for the sorting order.
|
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
AttackList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { attacksClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await attacksClient.getAttacks();
import { auditLogsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Gets the specified entry of the audit log | maturity=EARLY_ADOPTER
Required scope: environment-api:audit-logs:read Required permission: environment:roles:manage-settings
Name | Type | Description |
---|---|---|
config.id*required | string | The ID of the required log entry. |
Return type | Status code | Description |
---|---|---|
AuditLogEntry | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. Invalid ID format. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { auditLogsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await auditLogsClient.getLog({ id: "..." });
Gets the audit log of your Dynatrace environment | maturity=EARLY_ADOPTER
Required scope: environment-api:audit-logs:read Required permission: environment:roles:manage-settings
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
Name | Type | Description |
---|---|---|
config.filter | string |
Filters the audit log. You can use the following criteria:
For each criterion, you can specify multiple alternatives with comma-separated values. In this case, the OR logic applies. For example, You can specify multiple comma-separated criteria, such as Specify the value of a criterion as a quoted string. The following special characters must be escaped with a tilde (
|
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two weeks is used ( |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of log entries in a single response payload. The maximal allowed page size is 5000. If not set, 1000 is used. |
config.sort | string |
The sorting of audit log entries:
If not set, the newest first sorting is applied. |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
AuditLog | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { auditLogsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await auditLogsClient.getLogs();
import { businessEventsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Ingests a business event
Required scope: storage:events:write Required permission: storage:events:write
The maximum payload size of a single request is 5 MiB. Requests with a greater payload are rejected, and the API returns a 413 response code.
The ingestion of business events is subject to licensing (see licensing documentation).
Name | Type |
---|---|
config.body*required | CloudEvent | Array<CloudEvent> | IngestBody |
config.type*required | "application/cloudevent+json" | "application/cloudevents+json" | "application/cloudevent-batch+json" | "application/cloudevents-batch+json" | "application/json; charset=utf-8" |
Return type | Status code | Description |
---|---|---|
void | 202 | The provided business events are all accepted and will be processed. |
Error Type | Error Message |
---|---|
BizEventIngestResultError | Some business events are invalid. Valid business events are accepted and will be processed. | Content too large | Too many requests | Service is temporarily unavailable |
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { businessEventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await businessEventsClient.ingest({
type: "application/cloudevent+json",
body: {
specversion: "1.0",
id: "1",
source: "custom.source",
type: "com.mycompany.shop.checkout",
dtcontext:
'dt.session_id="234234234324235345345",dt.entity.rum_application="APPLICATION-53453458340758",host.name="123.123.123.123"',
dataschema:
"http://dynatrace.com/schema/bizevents/generic/1.0",
traceparent:
"00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-00",
data: {
id: "OR-838475",
paymentType: "paypal",
plannedDeliveryDate: "01.01.2021",
total: 234,
},
},
});
import { credentialVaultClient } from '@dynatrace-sdk/client-classic-environment-v2';
Creates a new credentials set.
Required scope: environment-api:credentials:write Required permission: environment:roles:viewer
The body must not provide an ID. An ID is assigned automatically by the Dynatrace server.
Name | Type |
---|---|
config.body*required | Credentials |
Return type | Status code | Description |
---|---|---|
CredentialsId | 201 | Success. The new credentials set has been created. The response contains the ID of the set. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await credentialVaultClient.createCredentials({
body: {
name: "...",
scopes: [CredentialsScopesItem.AppEngine],
},
});
Gets the metadata of the specified credentials set.
Required scope: environment-api:credentials:read Required permission: environment:roles:viewer
The credentials set itself (e.g. username/certificate and password) is not included in the response.
Name | Type | Description |
---|---|---|
config.id*required | string | The Dynatrace entity ID of the required credentials set. |
Return type | Status code | Description |
---|---|---|
CredentialsResponseElement | 200 | Success. The response contains the metadata of the credentials set. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await credentialVaultClient.getCredentials({
id: "...",
});
Gets the details of the specified credentials set.
Required scope: environment-api:credentials:read
The credentials set including username/certificate, password or token is included in the response.
Name | Type | Description |
---|---|---|
config.id*required | string | The Dynatrace entity ID of the required credentials set. |
Return type | Status code | Description |
---|---|---|
AbstractCredentialsResponseElement | 200 | Success. The response contains the details of the credentials set. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. E.g. Requested credentials with unsupported scope. Only APP_ENGINE scope is supported. | Failed. Requested credentials belong to another user. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await credentialVaultClient.getCredentialsDetails({
id: "...",
});
Lists all sets of credentials in your environment.
Required scope: environment-api:credentials:read Required permission: environment:roles:viewer
The credentials set itself (username/certificate and password) is not included in the response.
Name | Type | Description |
---|---|---|
config.name | string | Filters the result by the name. When in quotation marks, whole phrase is taken. Case insensitive. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of credentials in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. |
config.scope | string | Filters credentials with specified scope. |
config.type | "CERTIFICATE" | "TOKEN" | "USERNAME_PASSWORD" | "AWS_MONITORING_KEY_BASED" | "AWS_MONITORING_ROLE_BASED" | "SNMPV3" | Filters the result by the specified credentials type. |
config.user | string | Filters credentials accessible to the user (owned by the user or the ones that are accessible for all). |
Return type | Status code | Description |
---|---|---|
CredentialsList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await credentialVaultClient.listCredentials();
Deletes the specified credentials set
Required scope: environment-api:credentials:write Required permission: environment:roles:viewer
Provide credential ID in the path.
Name | Type | Description |
---|---|---|
config.id*required | string | The ID of the credentials set to be deleted. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. The credentials set has been deleted. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await credentialVaultClient.removeCredentials({
id: "...",
});
Updates the specified credentials set.
Required scope: environment-api:credentials:write Required permission: environment:roles:viewer
The body must not provide an ID. The ID should be provided in the path.
Name | Type | Description |
---|---|---|
config.body*required | Credentials | |
config.id*required | string | The Dynatrace entity ID of the credentials set to be updated. |
Return type | Status code | Description |
---|---|---|
CredentialsId | 201 | Success. The new credentials set has been created. The response contains the ID of the set. |
void | 204 | Success. The credentials set has been updated. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { credentialVaultClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await credentialVaultClient.updateCredentials({
id: "...",
body: {
name: "...",
scopes: [CredentialsScopesItem.AppEngine],
},
});
import { davisSecurityAdvisorClient } from '@dynatrace-sdk/client-classic-environment-v2';
Provides advice for security problems.
Required scope: environment-api:security-problems:read One of the following permissions is required:
- environment:roles:manage-security-problems
- environment:roles:view-security-problems
You can narrow down the output by providing the management zone and pagination. If you specify a management zone, only problems originating from that zone are included to the request.
Name | Type | Description |
---|---|---|
config.managementZoneFilter | string |
To specify management zones, use one of the options listed below. For each option you can specify multiple comma-separated values. If several values are specified, the OR logic applies. All values are case-sensitive and must be quoted.
You can specify several comma-separated criteria (for example, |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of security advices in a single response payload. The maximal allowed page size is 500. If not set, 5 is used. |
Return type | Status code | Description |
---|---|---|
DavisSecurityAdviceList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { davisSecurityAdvisorClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await davisSecurityAdvisorClient.getAdviceForSecurityProblems();
import { eventsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Ingests a custom event
One of the following scopes is required:
- storage:events:write
- environment-api:events:write
One of the following permissions is required:
- environment:roles:viewer
- storage:events:write
The ingestion of custom events is subject to licensing (see licensing documentation).
Name | Type |
---|---|
config.body*required | EventIngest |
Return type | Status code | Description |
---|---|---|
EventIngestResults | 201 | The event ingest request was received by the server. The response body indicates for each event whether its creation was successful. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.createEvent({
body: {
eventType: EventIngestEventType.AvailabilityEvent,
title: "...",
},
});
Gets the properties of an event
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.eventId*required | string | The ID of the required event. |
Return type | Status code | Description |
---|---|---|
Event | 200 | Success. The response contains the configuration of the event. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEvent({
eventId: "...",
});
Lists all event properties
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of event properties in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. |
Return type | Status code | Description |
---|---|---|
EventPropertiesList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEventProperties();
Gets the details of an event property
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.propertyKey*required | string | The event property key you're inquiring. |
Return type | Status code | Description |
---|---|---|
EventPropertyDetails | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEventProperty({
propertyKey: "...",
});
Gets the properties of an event type
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.eventType*required | string | The event type you're inquiring. |
Return type | Status code | Description |
---|---|---|
EventType | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEventType({
eventType: "...",
});
Lists all event types
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of event types in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. |
Return type | Status code | Description |
---|---|---|
EventTypeList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEventTypes();
Lists events within the specified timeframe
Required scope: environment-api:events:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.entitySelector | string |
The entity scope of the query. You must set one of these criteria:
You can add one or more of the following criteria. Values are case-sensitive and the
For more information, see Entity selector in Dynatrace Documentation. To set several criteria, separate them with a comma ( The maximum string length is 2,000 characters. The number of entities that can be selected is limited to 10000. |
config.eventSelector | string |
Defines the scope of the query. Only events matching the specified criteria are included in the response. You can add one or several of the criteria listed below. For each criterion you can specify multiple comma-separated values, unless stated otherwise. If several values are specified, the OR logic applies.
To set several criteria, separate them with commas ( |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two hours is used ( |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of events in a single response payload. The maximal allowed page size is 1000. If not set, 100 is used. |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
EventList | 200 | Success. The response contains the list of events. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { eventsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await eventsClient.getEvents();
import { extensions_2_0Client } from '@dynatrace-sdk/client-classic-environment-v2';
Activates the environment configuration from the specified version of the extension 2.0
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.body*required | ExtensionEnvironmentConfigurationVersion | |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionEnvironmentConfigurationVersion | 200 | Success. Environment configuration created. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.activateExtensionEnvironmentConfiguration(
{ extensionName: "...", body: { version: "1.2.3" } },
);
Creates new monitoring configuration for the specified extension 2.0
Required scope: environment-api:extension-configurations:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:write
Name | Type | Description |
---|---|---|
config.body*required | Array<MonitoringConfigurationDto> | |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
MonitoringConfigurationResponse | 200 | Success |
ErrorEnvelope | 207 | Multi-Status, if not all requests resulted in the same status |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.createMonitoringConfiguration({
extensionName: "...",
body: [{ scope: "HOST-D3A3C5A146830A79" }],
});
Name | Type | Description |
---|---|---|
config.body*required | Array<MonitoringConfigurationDto> | |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
MonitoringConfigurationResponse | 200 | Success |
ErrorEnvelope | 207 | Multi-Status, if not all requests resulted in the same status |
Deactivates the environment configuration of the specified extension 2.0
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionEnvironmentConfigurationVersion | 200 | Success. Environment configuration deactivated. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.deleteEnvironmentConfiguration(
{ extensionName: "..." },
);
Executes Data Source action of Active Gate or Host
Required scope: environment-api:extension-configuration-actions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configuration.actions:write
Name | Type | Description |
---|---|---|
config.body*required | ExecuteActionsDto | |
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExecuteActionsResponse | 202 | Accepted. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Authentication failed | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.executeExtensionMonitoringConfigurationActions(
{
extensionName: "...",
configurationId: "...",
body: {},
},
);
Gets the configuration schema of the specified version of the extension 2.0
Required scope: environment-api:extension-configurations:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
config.extensionVersion*required | string | The version of the requested extension 2.0 |
Return type | Status code | Description |
---|---|---|
SchemaDefinitionRestDto | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.extensionConfigurationSchema({
extensionName: "...",
extensionVersion: "...",
});
Gets details of the specified version of the extension 2.0
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/json; charset=utf-8" | |
config.extensionName*required | string | The name of the requested extension 2.0. |
config.extensionVersion*required | string | The version of the requested extension 2.0 |
Return type | Status code | Description |
---|---|---|
void | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.extensionDetails({
acceptType: "application/json; charset=utf-8",
extensionName: "...",
extensionVersion: "...",
});
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/octet-stream" | |
config.extensionName*required | string | The name of the requested extension 2.0. |
config.extensionVersion*required | string | The version of the requested extension 2.0 |
Return type | Status code | Description |
---|---|---|
void | 200 | Success |
Lists all the monitoring configurations of the specified extension 2.0
Required scope: environment-api:extension-configurations:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:read
Name | Type | Description |
---|---|---|
config.active | boolean | Filters the resulting set of configurations by the active state. |
config.extensionName*required | string | The name of the requested extension 2.0. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of extensions in a single response payload. The maximal allowed page size is 100. If not set, 20 is used. |
config.version | string | Filters the resulting set of configurations by extension 2.0 version. |
Return type | Status code | Description |
---|---|---|
ExtensionMonitoringConfigurationsList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.extensionMonitoringConfigurations(
{ extensionName: "..." },
);
Gets the active environment configuration version of the specified extension 2.0
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionEnvironmentConfigurationVersion | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getActiveEnvironmentConfiguration(
{ extensionName: "..." },
);
List all activeGate groups available for extension
Required scope: environment-api:extension-configurations:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:write
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
config.extensionVersion*required | string | The version of the requested extension 2.0 |
Return type | Status code | Description |
---|---|---|
ActiveGateGroupsInfoDto | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getActiveGateGroupsInfo({
extensionName: "...",
extensionVersion: "...",
});
Gets the information about assets in an active extension 2.0
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionAssetsDto | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getEnvironmentConfigurationAssetsInfo(
{ extensionName: "..." },
);
List of the latest extension environment configuration events
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.content | string | Content of the event |
config.extensionName*required | string | The name of the requested extension 2.0. |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two hours is used ( |
config.status | "ERROR" | "INFO" | "NONE" | "WARN" | Status of the event |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
ExtensionEventsList | 200 | List of the latest extension environment configuration events |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getEnvironmentConfigurationEvents(
{ extensionName: "..." },
);
Gets the list of the events linked to specific monitoring configuration
Required scope: environment-api:extension-configurations:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:read
Name | Type | Description |
---|---|---|
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.content | string | Content of the event |
config.dtActiveGateId | string |
Hexadecimal ID of Active Gate that uses this monitoring configuration. Example: |
config.dtEntityHost | string |
Host that uses this monitoring configuration. Example: |
config.dtExtensionDs | string |
Data source that uses this monitoring configuration. Example: |
config.extensionName*required | string | The name of the requested extension 2.0. |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two hours is used ( |
config.status | "ERROR" | "INFO" | "NONE" | "WARN" | Status of the event |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
ExtensionEventsList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getExtensionMonitoringConfigurationEvents(
{ extensionName: "...", configurationId: "..." },
);
Gets the most recent status of the execution of given monitoring configuration
Required scope: environment-api:extension-configurations:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:read
Name | Type | Description |
---|---|---|
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionStatusDto | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.getExtensionMonitoringConfigurationStatus(
{ extensionName: "...", configurationId: "..." },
);
Gets the extension 2.0 schema file in the specified version
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.fileName*required | string | The name of the schema file. |
config.schemaVersion*required | string | The version of the schema. |
Return type | Status code | Description |
---|---|---|
JsonNode | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.getSchemaFile({
schemaVersion: "...",
fileName: "...",
});
Installs Extension from HUB
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
config.version | string | Filters the resulting set of configurations by extension 2.0 version. |
Return type | Status code | Description |
---|---|---|
RegisteredExtensionResultDto | 200 | Success. The extension 2.0 has been uploaded. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.installExtension({
extensionName: "...",
});
Lists all the extensions 2.0 available in your environment with additional metadata
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.name | string | Filters the resulting set of extensions 2.0 by name. You can specify a partial name. In that case, the CONTAINS operator is used. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of extensions in a single response payload. The maximal allowed page size is 100. If not set, 20 is used. |
Return type | Status code | Description |
---|---|---|
ExtensionInfoList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.listExtensionInfos();
Lists all versions of the extension 2.0
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of extensions in a single response payload. The maximal allowed page size is 100. If not set, 20 is used. |
Return type | Status code | Description |
---|---|---|
ExtensionList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.listExtensionVersions({
extensionName: "...",
});
Lists all the extensions 2.0 available in your environment
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.name | string | Filters the resulting set of extensions 2.0 by name. You can specify a partial name. In that case, the CONTAINS operator is used. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of extensions in a single response payload. The maximal allowed page size is 100. If not set, 20 is used. |
Return type | Status code | Description |
---|---|---|
ExtensionList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.listExtensions();
Lists all the files available for the specified extension 2.0 schema version
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/json; charset=utf-8" | |
config.schemaVersion*required | string | The version of the schema. |
Return type | Status code | Description |
---|---|---|
void | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.listSchemaFiles({
acceptType: "application/json; charset=utf-8",
schemaVersion: "...",
});
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/octet-stream" | |
config.schemaVersion*required | string | The version of the schema. |
Return type | Status code | Description |
---|---|---|
void | 200 | Success |
Lists all the extension 2.0 schemas versions available in your environment
Required scope: environment-api:extensions:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:read
Return type | Status code | Description |
---|---|---|
SchemasList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.listSchemas();
Gets the details of the specified monitoring configuration
Required scope: environment-api:extension-configurations:read One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:read
Name | Type | Description |
---|---|---|
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionMonitoringConfiguration | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.monitoringConfigurationDetails(
{ extensionName: "...", configurationId: "..." },
);
Deletes the specified version of the extension 2.0
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.extensionName*required | string | The name of the requested extension 2.0. |
config.extensionVersion*required | string | The version of the requested extension 2.0 |
Return type | Status code | Description |
---|---|---|
Extension | 200 | Success. The extension 2.0 version has been deleted. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.removeExtension({
extensionName: "...",
extensionVersion: "...",
});
Deletes the specified monitoring configuration
Required scope: environment-api:extension-configurations:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:write
Name | Type | Description |
---|---|---|
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
void | 204 | Success. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.removeMonitoringConfiguration({
extensionName: "...",
configurationId: "...",
});
Updates the active environment configuration version of the extension 2.0
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.body*required | ExtensionEnvironmentConfigurationVersion | |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
ExtensionEnvironmentConfigurationVersion | 200 | Success. Environment configuration updated. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.updateExtensionEnvironmentConfiguration(
{ extensionName: "...", body: { version: "1.2.3" } },
);
Updates the specified monitoring configuration
Required scope: environment-api:extension-configurations:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:configurations:write
Name | Type | Description |
---|---|---|
config.body*required | MonitoringConfigurationUpdateDto | |
config.configurationId*required | string | The ID of the requested monitoring configuration. |
config.extensionName*required | string | The name of the requested extension 2.0. |
Return type | Status code | Description |
---|---|---|
MonitoringConfigurationResponse | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await extensions_2_0Client.updateMonitoringConfiguration({
extensionName: "...",
configurationId: "...",
body: {},
});
Uploads or verifies a new extension 2.0
Required scope: environment-api:extensions:write One of the following permissions is required:
- environment:roles:manage-settings
- extensions:definitions:write
Name | Type | Description |
---|---|---|
config.body*required | Blob | |
config.validateOnly | boolean | Only run validation but do not persist the extension even if validation was successful. |
Return type | Status code | Description |
---|---|---|
ExtensionUploadResponseDto | 200 | The extension is valid |
ExtensionUploadResponseDto | 201 | Success. The extension 2.0 has been uploaded. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input file is invalid. | Upload not possible yet, please try again in a few seconds. | Client side error. | Server side error. |
Code example
import { extensions_2_0Client } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await extensions_2_0Client.uploadExtension({
body: new Blob(),
});
import { logsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Exports log records | maturity=EARLY_ADOPTER
Required scope: storage:logs:read One of the following permissions is required:
- environment:roles:logviewer
- storage:logs:read
Returns the first X records (specified in the pageSize query parameter).
Unlike the search API, this API does not split the result into slices and has no limit for the total number of records. Log records are sorted by the criteria specified in the sort query parameter.
In order to fetch large amount of records (exceeding the pageSize value), one should repeat the export call with nextPageKey param.
Please note that export works only for Logs Classic.
Name | Type | Description |
---|---|---|
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two weeks is used ( |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number | The number of results per result page. |
config.query | string |
The log search query. The query must use the Dynatrace search query language. |
config.sort | string |
Defines the ordering of the log records. Each field has a sign prefix (+/-) for sorting order. If no sign prefix is set, then the Currently, ordering is available only for the timestamp (+timestamp for the oldest records first, or -timestamp for the newest records first). When millisecond resolution provided by the timestamp is not enough, log records are sorted based on the order in which they appear in the log source (remote process writing to REST API endpoint or remote process from which logs are collected). |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
ExportedLogRecordList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. The server either does not recognize the request method, or it lacks the ability to fulfill the request. May happen when Grail log storage is enabled. | Client side error. | Server side error. |
Code example
import { logsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await logsClient.exportLogRecords();
Gets aggregated log records | maturity=EARLY_ADOPTER
Required scope: storage:logs:read One of the following permissions is required:
- environment:roles:logviewer
- storage:logs:read
Returns the aggregated number of occurrences of log values divided into time slots.
It is possible that the timeframe covered by results exceeds the specified timeframe. In that case the request returns fewer time slots than specified in the timeBuckets query parameter.
If Log Management and Analytics, powered by Grail is enabled,
then a bearer OAuth token (with storage:logs:read
and storage:buckets:read
scopes)
needs to be used for authentication.
Please note that Dynatrace API explorer does not currently support OAuth authentication.
Logs on Grail:
It is not recommended to run Grail queries using Logs v2 API, please use Grail API instead.
Name | Type | Description |
---|---|---|
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two weeks is used ( |
config.groupBy | Array<string> |
The groupings to be included in the response. You can specify several groups in the following format: If not set, all possible groups are returned. You can use this option to check for possible grouping values. Unique log data attributes (high-cardinality attributes) for example, |
config.maxGroupValues | number |
The maximum number of values in each group. You can get up to 100 values per group. If not set, 10 is used. |
config.query | string |
The log search query. The query must use the Dynatrace search query language. |
config.timeBuckets | number |
The number of time slots in the result. The query timeframe is divided equally into the specified number of slots. The minimum length of a slot is 1 ms. If not set, 1 is used. |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
AggregatedLog | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { logsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await logsClient.getLogHistogramData();
Reads log records | maturity=EARLY_ADOPTER
Required scope: storage:logs:read One of the following permissions is required:
- environment:roles:logviewer
- storage:logs:read
Returns the first X records (specified in the limit query parameter). Log records are sorted by the criteria specified in the sort query parameter.
If the query is too large to be processed in a single request, it is divided into slices (slices are unsupported on Log Management and Analytics, powered by Grail). In that case the first response contains the nextSliceKey cursor for the second slice. Use it in the nextSliceKey query parameter to obtain the second slice, which contains nextSliceKey cursor for the third slice, and so on.
Results can be distributed unevenly between slices and some slices might be empty.
If Log Management and Analytics, powered by Grail is enabled,
then a bearer OAuth token (with storage:logs:read
and storage:buckets:read
scopes)
needs to be used for authentication.
Please note that Dynatrace API explorer does not currently support OAuth authentication.
Logs on Grail:
It is not recommended to run Grail queries using Logs v2 API, please use Grail API instead.
Name | Type | Description |
---|---|---|
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two weeks is used ( |
config.limit | number |
The desired amount of log records. The maximal allowed limit is 1000. If not set, 1000 is used. |
config.nextSliceKey | string |
The cursor for the next slice of results. You can find it in the nextSliceKey field of the previous response. The first slice is always returned if you don't specify this parameter. If this parameter is set, all other query parameters are ignored. Unsupported on Log Management and Analytics, powered by Grail. |
config.query | string |
The log search query. The query must use the Dynatrace search query language. |
config.sort | string |
Defines the ordering of the log records. Each field has a sign prefix (+/-) for sorting order. If no sign prefix is set, then the Currently, ordering is available only for the timestamp (+timestamp for the oldest records first, or -timestamp for the newest records first). When millisecond resolution provided by the timestamp is not enough, log records are sorted based on the order in which they appear in the log source (remote process writing to REST API endpoint or remote process from which logs are collected). |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
LogRecordsList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Client side error. | Server side error. |
Code example
import { logsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await logsClient.getLogRecords();
Pushes log records to Dynatrace
Required scope: storage:logs:write Required permission: storage:logs:write
Ingested logs are stored in the indexed log storage.
This endpoint requires an ActiveGate with the Log Analytics Collector module enabled.
High-cardinality attributes:
Unique log data attributes (high-cardinality attributes) such as span_id
and trace_id
generate unnecessarily excessive facet lists that may impact log viewer performance. Because of this, they aren't listed in log viewer facets. You can still use them in a log viewer advanced search query.
Limitations:
Please refer to the following documentation pages:
Error handling:
The following HTTP status codes are considered retryable:
- 429 Too Many Requests
- 502 Bad Gateway
- 503 Service Unavailable
- 504 Gateway Timeout
It is recommended to use an exponential backoff strategy for retrying requests.
Name | Type |
---|---|
config.body*required | LogMessageJson | LogMessagePlain |
config.type*required | "application/json" | "application/json; charset=utf-8" | "text/plain; charset=utf-8" |
Return type | Status code | Description |
---|---|---|
SuccessEnvelope | 200 | Only a part of input events were ingested due to event invalidity. For details, check the response body. |
void | 204 | Success. Response doesn't have a body. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Failed. The input is invalid. | Failed. This is due either to the status of your licensing agreement or because you've exhausted your DPS license. | Failed. The requested resource doesn't exist. This may happen when no ActiveGate is available with the Log Analytics Collector module enabled. | Failed. Request payload size is too big. This may happen when the payload byte size exceeds the limit or when the ingested payload is a JSON array with the size exceeding the limit. | Failed. Too Many Requests. This may happen when ActiveGate is unable to process more requests at the moment or when log ingest is disabled. Retryable with exponential backoff strategy. | Failed. The server either does not recognize the request method, or it lacks the ability to fulfil the request. In Log Monitoring Classic, this may happen when indexed log storage is not enabled. | Failed. The server is currently unable to handle the request. This may happen when ActiveGate is overloaded. Retryable with exponential backoff strategy. | Client side error. | Server side error. |
Code example
import { logsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await logsClient.storeLog({
type: "application/json",
body: [
{
content:
"Exception: Custom error log sent via Generic Log Ingest",
"log.source": "/var/log/syslog",
timestamp: "2022-01-17T22:12:31.0000",
severity: "error",
"custom.attribute": "attribute value",
},
{
content:
"Exception: Custom error log sent via Generic Log Ingest",
"log.source": "/var/log/syslog",
timestamp: "2022-01-17T22:12:35.0000",
},
{
content:
"Exception: Custom error log sent via Generic Log Ingest",
"log.source": "/var/log/syslog",
},
{
content:
"Exception: Custom error log sent via Generic Log Ingest",
},
],
});
import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Lists all available metrics
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
You can narrow down the output by selecting metrics in the metricSelector field.
You can additionally limit the output by using pagination:
-
Specify the number of results per page in the pageSize query parameter.
-
Then use the cursor from the nextPageKey field of the response in the nextPageKey query parameter to obtain subsequent pages. All other query parameters must be omitted.
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8" | |
config.fields | string |
Defines the list of metric properties included in the response.
To add properties, list them with leading plus To specify several properties, join them with a comma (for example If you specify just one property, the response contains the metric key and the specified property. To return metric keys only, specify |
config.metadataSelector | string |
The metadata scope of the query. Only metrics with specified properties are included to the response. You can set one or more of the following criteria. Values are case-sensitive and the
To set several criteria, separate them with a comma ( For example, to list metrics that have the tags feature AND cloud with a unit of Percent OR MegaByte AND a dimension with a dimension key location, use this metadataSelector: |
config.metricSelector | string |
Selects metrics for the query by their keys. You can specify multiple metric keys separated by commas (for example, You can select a full set of related metrics by using a trailing asterisk ( You can set additional transformation operators, separated by a colon ( Only If the metric key contains any symbols you must quote (
For example, to query the metric with the key of ext:selfmonitoring.jmx.Agents: Type "APACHE" you must specify this selector:
To find metrics based on a search term, rather than metricId, use the text query parameter instead of this one. |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of metric schemata in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. If a value higher than 500 is used, only 500 results per page are returned. |
config.text | string | Metric registry search term. Only show metrics that contain the term in their key, display name, or description. Use the metricSelector parameter instead of this one to select a complete metric hierarchy instead of doing a text-based search. |
config.writtenSince | string |
Filters the resulted set of metrics to those that have data points within the specified timeframe. You can use one of the following formats:
|
Return type | Status code | Description |
---|---|---|
MetricDescriptorCollection | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsClient.allMetrics({
acceptType: "application/json; charset=utf-8",
});
Deletes the specified metric
Required scope: environment-api:metrics:write Required permission: environment:roles:manage-settings
Deletion cannot be undone! You can't delete a metric if it has data points ingested within the last two hours.
Name | Type | Description |
---|---|---|
config.metricKey*required | string | The key of the required metric. |
Return type | Status code | Description |
---|---|---|
void | 202 | Success. The deletion of the metric has been triggered. |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsClient.delete({
metricKey: "...",
});
Pushes metric data points to Dynatrace
Required scope: storage:metrics:write Required permission: storage:metrics:write
Name | Type |
---|---|
config.body*required | string |
Return type | Status code | Description |
---|---|---|
void | 202 | The provided business events are all accepted and will be processed. |
Error Type | Error Message |
---|---|
ValidationResponseError | Some data points are invalid. Valid data points are accepted and will be processed in the background. |
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsClient.ingest({
body: "server.cpu.temperature,cpu.id=0 42",
});
Gets the descriptor of the specified metric
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8" | |
config.metricKey*required | string |
The key of the required metric. You can set additional transformation operators, separated by a colon ( |
Return type | Status code | Description |
---|---|---|
MetricDescriptor | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsClient.metric({
acceptType: "application/json; charset=utf-8",
metricKey: "...",
});
Gets data points of the specified metrics
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
The following limits apply:
- The amount of aggregated data points in the response is limited to 1,000
- The amount of series in the response is limited to 1,000
- The amount of data points per series is limited to 10,080 (minutes of one week)
- The overall amount of data points is limited to 100,000
The dataPointCountRatio specifies the ratio of queried data points divided by the maximum number of data points per metric that are allowed in a single query. The dimensionCountRatio specifies the ratio of queried dimension tuples divided by the maximum number of dimension tuples allowed in a single query.
Name | Type | Description |
---|---|---|
config.acceptType*required | "application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8" | |
config.entitySelector | string |
Specifies the entity scope of the query. Only data points delivered by matched entities are included in response. You must set one of these criteria:
You can add one or more of the following criteria. Values are case-sensitive and the
For more information, see Entity selector in Dynatrace Documentation. To set several criteria, separate them with a comma ( The maximum string length is 2,000 characters. Use the To set a universal scope matching all entities, omit this parameter. |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of two hours is used ( |
config.metricSelector | string |
Selects metrics for the query by their keys. You can select up to 10 metrics for one query. You can specify multiple metric keys separated by commas (for example, If the metric key contains any symbols you must quote (
For example, to query the metric with the key of ext:selfmonitoring.jmx.Agents: Type "APACHE" you must specify this selector:
You can set additional transformation operators, separated by a colon ( |
config.mzSelector | string |
The management zone scope of the query. Only metrics data relating to the specified management zones are included to the response. You can set one or more of the following criteria. Values are case-sensitive and the
|
config.resolution | string |
The desired resolution of data points. You can use one of the following options:
Valid units for the timespan are:
If not set, the default is 120 data points. For example:
|
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
MetricData | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsClient.query({
acceptType: "application/json; charset=utf-8",
});
import { metricsUnitsClient } from '@dynatrace-sdk/client-classic-environment-v2';
Lists all available units
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
You can narrow down the output by providing filter criteria in the unitSelector field.
Name | Type | Description |
---|---|---|
config.fields | string |
Defines the list of properties to be included in the response. The ID of the unit is always included. The following additional properties are available:
By default, the ID, the display name, and the symbol are included. To add properties, list them with leading plus To specify several properties, join them with a comma (for example If you specify just one property, the response contains the unitId and the specified property. To return unit IDs only, specify |
config.unitSelector | string |
Selects units to be included to the response. Available criteria:
|
Return type | Status code | Description |
---|---|---|
UnitList | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsUnitsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsUnitsClient.allUnits();
Converts a value from a source unit into a target unit
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
If no target unit is set, the request finds an appropriate target unit automatically, taking into account the preferred number format (if specified).
Name | Type | Description |
---|---|---|
config.numberFormat | string |
The preferred number format of the target value. You can specify the following formats:
`Only used if the target unit if not set. |
config.targetUnit | string |
The ID of the target unit. If not set, the request finds an appropriate target unit automatically, based on the specified number format. |
config.unitId*required | string | The ID of the source unit. |
config.value*required | number | The value to be converted. |
Return type | Status code | Description |
---|---|---|
UnitConversionResult | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsUnitsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsUnitsClient.convert({
unitId: "...",
value: 10,
});
Gets the properties of the specified unit
Required scope: environment-api:metrics:read Required permission: environment:roles:viewer
Name | Type |
---|---|
config.unitId*required | string |
Return type | Status code | Description |
---|---|---|
Unit | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { metricsUnitsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await metricsUnitsClient.unit({
unitId: "...",
});
import { monitoredEntitiesClient } from '@dynatrace-sdk/client-classic-environment-v2';
Deletes the security context for all entities matching the entity selector.
Required scope: settings:objects:write One of the following permissions is required:
- environment:roles:manage-settings
- settings:objects:write
Automatic management zone rules will apply again to entities without a security context.
Name | Type | Description |
---|---|---|
config.entitySelector*required | string |
Defines the scope of the entities to set the security context for. Only entities that can have management zones are considered for this operation You must set one of these criteria:
You can add one or more of the following criteria. Values are case-sensitive and the
For more information, see Entity selector in Dynatrace Documentation. To set several criteria, separate them with a comma ( The maximum string length is 2,000 characters. |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of three days is used ( |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
If not set, the current timestamp is used. |
Return type | Status code | Description |
---|---|---|
SecurityContextResultDto | 200 | Success |
Error Type | Error Message |
---|---|
ErrorEnvelopeError | Client side error. | Server side error. |
Code example
import { monitoredEntitiesClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await monitoredEntitiesClient.deleteSecurityContext({
entitySelector: "...",
});
Gets the information about monitored entities
Required scope: environment-api:entities:read Required permission: environment:roles:viewer
Lists entities observed within the specified timeframe along with their properties.
When you query entities of the SERVICE_METHOD
type, only the following requests are returned:
- Key requests
- Top X requests that are used for baselining
- Requests that have caused a problem
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
Name | Type | Description |
---|---|---|
config.entitySelector | string |
Defines the scope of the query. Only entities matching the specified criteria are included into response. You must set one of these criteria:
You can add one or more of the following criteria. Values are case-sensitive and the
For more information, see Entity selector in Dynatrace Documentation. To set several criteria, separate them with a comma ( The maximum string length is 2,000 characters. The field is required when you're querying the first page of results. |
config.fields | string |
Defines the list of entity properties included in the response. The ID and the name of an entity are always included to the response. To add properties, list them with leading plus Use the GET entity type request to fetch the list of properties available for your entity type. Fields from the properties object must be specified in the When requesting large amounts of relationship fields, throttling can apply. |
config.from | string |
The start of the requested timeframe. You can use one of the following formats:
If not set, the relative timeframe of three days is used ( |
config.nextPageKey | string |
The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number |
The amount of entities. If not set, 50 is used. |
config.sort | string |
Defines the ordering of the entities returned. This field is optional, each field has a sign prefix (+/-), which corresponds to sorting order ( + for ascending and - for descending). If no sign prefix is set, then default ascending sorting order will be applied. Currently ordering is only available for the display name (for example |
config.to | string |
The end of the requested timeframe. You can use one of the following formats:
|