@dynatrace-sdk/client-classic-environment-v2
TypeScript icon, indicating that this package has built-in type declarations

3.7.0 • Public • Published

@dynatrace-sdk/client-classic-environment-v2

npm License

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.

Installation

npm install @dynatrace-sdk/client-classic-environment-v2

Getting help

License

This SDK is distributed under the Apache License, Version 2.0, see LICENSE for more information.

API reference

Full API reference for the latest version of the SDK is also available at the Dynatrace Developer.

accessTokensActiveGateTokensClient

import { accessTokensActiveGateTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';

createToken

accessTokensActiveGateTokensClient.createToken(config): Promise<ActiveGateTokenCreated>

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.

Parameters

Name Type
config.body*required ActiveGateTokenCreate

Returns

Return type Status code Description
ActiveGateTokenCreated 201 Success. The token has been created. The body of the response contains the token secret.

Throws

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",
    },
  });

getToken

accessTokensActiveGateTokensClient.getToken(config): Promise<ActiveGateToken>

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.

Parameters

Name Type Description
config.activeGateTokenIdentifier*required string The ActiveGate token identifier, consisting of prefix and public part of the token.

Returns

Return type Status code Description
ActiveGateToken 200 Success. The response contains the metadata of the tokens.

Throws

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: "...",
  });

listTokens

accessTokensActiveGateTokensClient.listTokens(config): Promise<ActiveGateTokenList>

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:

  1. Specify the number of results per page in the pageSize query parameter.
  2. Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.

Parameters

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.

Returns

Return type Status code Description
ActiveGateTokenList 200 Success. The response contains the list of ActiveGate tokens.

Throws

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();

revokeToken

accessTokensActiveGateTokensClient.revokeToken(config): Promise<void>

Deletes an ActiveGate token

Required scope: environment-api:activegate-tokens:write Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.activeGateTokenIdentifier*required string The ActiveGate token identifier, consisting of prefix and public part of the token to be deleted.

Returns

Return type Status code Description
void 204 Success. Response doesn't have a body.

Throws

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: "...",
  });

accessTokensAgentTokensClient

import { accessTokensAgentTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';

getAgentConnectionToken

accessTokensAgentTokensClient.getAgentConnectionToken(config): Promise<AgentConnectionToken>

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.

Returns

Return type Status code Description
AgentConnectionToken 200 Success

Throws

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();

accessTokensApiTokensClient

import { accessTokensApiTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';

createApiToken

accessTokensApiTokensClient.createApiToken(config): Promise<ApiTokenCreated>

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.

Parameters

Name Type
config.body*required ApiTokenCreate

Returns

Return type Status code Description
ApiTokenCreated 201 Success. The token has been created. The body of the response contains the token secret.

Throws

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"] },
  });

deleteApiToken

accessTokensApiTokensClient.deleteApiToken(config): Promise<void>

Deletes an API token

Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer

Parameters

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.

Returns

Return type Status code Description
void 204 Success. Response doesn't have a body.

Throws

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: "...",
  });

getApiToken

accessTokensApiTokensClient.getApiToken(config): Promise<ApiToken>

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.

Parameters

Name Type
config.id*required string

Returns

Return type Status code Description
ApiToken 200 Success

Throws

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: "...",
});

listApiTokens

accessTokensApiTokensClient.listApiTokens(config): Promise<ApiTokenList>

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:

  1. Specify the number of results per page in the pageSize query parameter.
  2. Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.

Parameters

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:

  • Owner: owner("value"). The user that owns the token. Case-sensitive.
  • Personal access token: personalAccessToken(false). Set to true to include only personal access tokens or to false to include only API tokens.
  • Token scope: scope("scope1","scope2"). If several values are specified, the OR logic applies.

To set multiple criteria, separate them with commas (,). Only results matching all criteria are included into response.

config.fields string

Specifies the fields to be included in the response.

The following fields are included by default:

  • id
  • name
  • enabled
  • owner
  • creationDate

To remove fields from the response, specify them with the minus (-) operator as a comma-separated list (for example, -creationDate,-owner).

You can include additional fields:

  • personalAccessToken

  • expirationDate

  • lastUsedDate

  • lastUsedIpAddress

  • modifiedDate

  • scopes

  • additionalMetadata

To add fields to the response, specify them with the plus (+) operator as a comma-separated list (for example, +expirationDate,+scopes). You can combine adding and removing of fields (for example, +scopes,-creationDate).

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, creationDate,expirationDate,owner). The ID is always included in the response.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years
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:

  • name: token name (+ a...z or - z...a)
  • lastUsedDate last used (+ never used tokens first - most recently used tokens first)
  • creationDate (+ oldest tokens first - newest tokens first)
  • expirationDate (+ tokens that expire soon first - unlimited tokens first)
  • modifiedDate last modified (+ never modified tokens first - most recently modified tokens first)

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
ApiTokenList 200 Success

Throws

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();

lookupApiToken

accessTokensApiTokensClient.lookupApiToken(config): Promise<ApiToken>

Gets API token metadata by token secret

Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer

Parameters

Name Type
config.body*required ApiTokenSecret

Returns

Return type Status code Description
ApiToken 200 Success

Throws

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",
    },
  });

updateApiToken

accessTokensApiTokensClient.updateApiToken(config): Promise<void>

Updates an API token

Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer

Parameters

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.

Returns

Return type Status code Description
void 204 Success. Response doesn't have a body.

Throws

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: {},
  });

accessTokensTenantTokensClient

import { accessTokensTenantTokensClient } from '@dynatrace-sdk/client-classic-environment-v2';

cancelRotation

accessTokensTenantTokensClient.cancelRotation(config): Promise<TenantTokenConfig>

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.

Returns

Return type Status code Description
TenantTokenConfig 200 Success. Rotation process has been cancelled. The current tenant token remains valid.

Throws

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();

finishRotation

accessTokensTenantTokensClient.finishRotation(config): Promise<TenantTokenConfig>

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.

Returns

Return type Status code Description
TenantTokenConfig 200 Success. The rotation process is completed. The active field of the response contains the new tenant token.

Throws

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();

startRotation

accessTokensTenantTokensClient.startRotation(config): Promise<TenantTokenConfig>

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.

Returns

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.

Throws

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();

activeGatesActiveGateGroupsClient

import { activeGatesActiveGateGroupsClient } from '@dynatrace-sdk/client-classic-environment-v2';

getActiveGateGroups

activeGatesActiveGateGroupsClient.getActiveGateGroups(config): Promise<ActiveGateGroups>

Lists ActiveGate groups

Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings

Returns

Return type Status code Description
ActiveGateGroups 200 Success

Throws

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();

activeGatesAutoUpdateConfigurationClient

import { activeGatesAutoUpdateConfigurationClient } from '@dynatrace-sdk/client-classic-environment-v2';

getAutoUpdateConfigById

activeGatesAutoUpdateConfigurationClient.getAutoUpdateConfigById(config): Promise<ActiveGateAutoUpdateConfig>

Gets the configuration of auto-update for the specified ActiveGate

Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.

Returns

Return type Status code Description
ActiveGateAutoUpdateConfig 200 Success

Throws

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: "..." },
  );

getGlobalAutoUpdateConfigForTenant

activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant(config): Promise<ActiveGateGlobalAutoUpdateConfig>

Gets the global auto-update configuration of environment ActiveGates.

Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings

Returns

Return type Status code Description
ActiveGateGlobalAutoUpdateConfig 200 Success

Throws

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();

putAutoUpdateConfigById

activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(config): Promise<void>

Updates the configuration of auto-update for the specified ActiveGate

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.
config.body*required ActiveGateAutoUpdateConfig

Returns

Return type Status code Description
void 204 Success. The auto-update configuration have been updated. Response doesn't have a body.

Throws

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,
      },
    },
  );

putGlobalAutoUpdateConfigForTenant

activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(config): Promise<void>

Puts the global auto-update configuration of environment ActiveGates.

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type
config.body*required ActiveGateGlobalAutoUpdateConfig

Returns

Return type Status code Description
void 204 Success. The global auto-update configuration have been updated. Response doesn't have a body.

Throws

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,
      },
    },
  );

validateAutoUpdateConfigById

activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(config): Promise<void>

Validates the payload for the POST /activeGates/{agId}/autoUpdate request.

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.
config.body*required ActiveGateAutoUpdateConfig

Returns

Return type Status code Description
void 204 Validated. The submitted auto-update configuration is valid. Response doesn't have a body.

Throws

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,
      },
    },
  );

validateGlobalAutoUpdateConfigForTenant

activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(config): Promise<void>

Validates the payload for the POST /activeGates/autoUpdate request.

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type
config.body*required ActiveGateGlobalAutoUpdateConfig

Returns

Return type Status code Description
void 204 Validated. The submitted configuration is valid. Response doesn't have a body.

Throws

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,
      },
    },
  );

activeGatesAutoUpdateJobsClient

import { activeGatesAutoUpdateJobsClient } from '@dynatrace-sdk/client-classic-environment-v2';

createUpdateJobForAg

activeGatesAutoUpdateJobsClient.createUpdateJobForAg(config): Promise<UpdateJob>

Creates a new update job for the specified ActiveGate

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.
config.body*required UpdateJob

Returns

Return type Status code Description
UpdateJob 201 Success. The update-job have been created.

Throws

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" },
    },
  );

deleteUpdateJobByJobIdForAg

activeGatesAutoUpdateJobsClient.deleteUpdateJobByJobIdForAg(config): Promise<void>

Deletes the specified update job

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

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.

Returns

Return type Status code Description
void 204 Success. The update-job have been deleted. Response doesn't have a body.

Throws

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: "..." },
  );

getAllUpdateJobList

activeGatesAutoUpdateJobsClient.getAllUpdateJobList(config): Promise<UpdateJobsAll>

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.

Parameters

Name Type Description
config.from string

The start of the requested timeframe for update jobs.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of one day is used (now-1d).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

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.

Returns

Return type Status code Description
UpdateJobsAll 200 Success

Throws

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();

getUpdateJobByJobIdForAg

activeGatesAutoUpdateJobsClient.getUpdateJobByJobIdForAg(config): Promise<UpdateJob>

Gets the parameters of the specified update job

Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings

Parameters

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.

Returns

Return type Status code Description
UpdateJob 200 Success

Throws

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: "..." },
  );

getUpdateJobListByAgId

activeGatesAutoUpdateJobsClient.getUpdateJobListByAgId(config): Promise<UpdateJobList>

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.

Parameters

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of one week is used (now-1w).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

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.

Returns

Return type Status code Description
UpdateJobList 200 Success

Throws

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: "..." },
  );

validateUpdateJobForAg

activeGatesAutoUpdateJobsClient.validateUpdateJobForAg(config): Promise<void>

Validates the payload for the POST /activeGates/{agId}/updateJobs request.

Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.
config.body*required UpdateJob

Returns

Return type Status code Description
void 204 Validated. The submitted update-job is valid. Response doesn't have a body.

Throws

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" },
    },
  );

activeGatesClient

import { activeGatesClient } from '@dynatrace-sdk/client-classic-environment-v2';

getAllActiveGates

activeGatesClient.getAllActiveGates(config): Promise<ActiveGateList>

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.

Parameters

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 CONTAINS operator is used.

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 CONTAINS operator is used.

config.loadBalancerAddress string

Filters the resulting set of ActiveGates by the Load Balancer address.

You can specify a partial address. In that case, the CONTAINS operator is used.

config.networkAddress string

Filters the resulting set of ActiveGates by the network address.

You can specify a partial address. In that case, the CONTAINS operator is used.

config.networkZone string

Filters the resulting set of ActiveGates by the network zone.

You can specify a partial name. In that case, the CONTAINS operator is used.

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 <major>.<minor>.<revision> format (for example, 1.195.0) here.

config.versionCompareType "EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"

Filters the resulting set of ActiveGates by the specified version.

Specify the comparison operator here.

Returns

Return type Status code Description
ActiveGateList 200 Success

Throws

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();

getOneActiveGateById

activeGatesClient.getOneActiveGateById(config): Promise<ActiveGate>

Gets the details of the specified ActiveGate

Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.agId*required string The ID of the required ActiveGate.

Returns

Return type Status code Description
ActiveGate 200 Success

Throws

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: "...",
});

attacksClient

import { attacksClient } from '@dynatrace-sdk/client-classic-environment-v2';

getAttack

attacksClient.getAttack(config): Promise<Attack>

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

Parameters

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):

  • attackTarget: The targeted host/database of an attack.
  • request: The request that was sent from the attacker.
  • entrypoint: The entry point used by an attacker to start a specific attack.
  • vulnerability: The vulnerability utilized by the attack.
  • securityProblem: The related security problem.
  • attacker: The attacker of an attack.
  • managementZones: The related management zones.

To add properties, specify them in a comma-separated list and prefix each property with a plus (for example, +attackTarget,+securityProblem).

config.id*required string The ID of the attack.

Returns

Return type Status code Description
Attack 200 Success

Throws

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: "..." });

getAttacks

attacksClient.getAttacks(config): Promise<AttackList>

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

Parameters

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 EQUALS operator is used unless otherwise specified.

  • State: state("value"). The state of the attack. Possible values are EXPLOITED, BLOCKED, and ALLOWLISTED.
  • Attack Type: attackType("value"). The type of the attack. Find the possible values in the description of the attackType field of the response.
  • Country Code: countryCode("value"). The country code of the attacker. Supported values include all ISO-3166-1 alpha-2 country codes (2-letter). Supplying empty filter value countryCode() will return attacks, where location is not available.
  • Request path contains: requestPathContains("value"). Filters for a substring in the request path. The CONTAINS operator is used. A maximum of 48 characters are allowed.
  • Process group name contains: processGroupNameContains("value"). Filters for a substring in the targeted process group's name. The CONTAINS operator is used.
  • Vulnerability ID: vulnerabilityId("123456789"). The exact ID of the vulnerability.
  • Source IPs: sourceIps("93.184.216.34", "63.124.6.12"). The exact IPv4/IPv6 addresses of the attacker.
  • Management zone ID: managementZoneIds("mzId-1", "mzId-2").
  • Management zone name: managementZones("name-1", "name-2"). Values are case sensitive.
  • Technology: technology("technology-1", "technology-2"). Find the possible values in the description of the technology field of the response. The EQUALS operator is used.

To set several criteria, separate them with a comma (,). Only results matching (all criteria are included in the response.

Specify the value of a criterion as a quoted string. The following special characters must be escaped with a tilde (~) inside quotes:

  • Tilde ~
  • Quote "
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):

  • attackTarget: The targeted host/database of an attack.
  • request: The request that was sent from the attacker.
  • entrypoint: The entry point used by an attacker to start a specific attack.
  • vulnerability: The vulnerability utilized by the attack.
  • securityProblem: The related security problem.
  • attacker: The attacker of an attack.
  • managementZones: The related management zones.
  • affectedEntities: The affected entities of an attack.

To add properties, specify them in a comma-separated list and prefix each property with a plus (for example, +attackTarget,+securityProblem).

config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of thirty days is used (now-30d).

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 (,) as a separator (e.g. +state,-timestamp).

You can sort by the following properties with a sign prefix for the sorting order.

  • displayId: The attack's display ID.
  • displayName: The attack's display name.
  • attackType: The type of the attack (e.g. SQL_INJECTION, JNDI_INJECTION, etc.).
  • state: The state of the attack. (+ low severity state first - high severity state first)
  • sourceIp: The IP address of the attacker. Sorts by the numerical IP value.
  • requestPath: The request path where the attack was started.
  • timestamp: When the attack was executed. (+ old attacks first or - new attacks first) If no prefix is set, + is used.
config.to string

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
AttackList 200 Success

Throws

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();

auditLogsClient

import { auditLogsClient } from '@dynatrace-sdk/client-classic-environment-v2';

getLog

auditLogsClient.getLog(config): Promise<AuditLogEntry>

Gets the specified entry of the audit log | maturity=EARLY_ADOPTER

Required scope: environment-api:audit-logs:read Required permission: environment:roles:manage-settings

Parameters

Name Type Description
config.id*required string The ID of the required log entry.

Returns

Return type Status code Description
AuditLogEntry 200 Success

Throws

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: "..." });

getLogs

auditLogsClient.getLogs(config): Promise<AuditLog>

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:

  1. Specify the number of results per page in the pageSize query parameter.
  2. Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.

Parameters

Name Type Description
config.filter string

Filters the audit log. You can use the following criteria:

  • User: user("userIdentification"). The EQUALS operator applies.
  • Event type: eventType("value"). The EQUALS operator applies.
  • Category of a logged operation: category("value"). The EQUALS operator applies.
  • Entity ID: entityId("id"). The CONTAINS operator applies.
  • Settings schema ID: dt.settings.schema_id("id"). The EQUALS operator applies.
  • Settings scope ID: dt.settings.scope_id("id"). The EQUALS operator applies.
  • Settings key: dt.settings.key("key"). The EQUALS operator applies.
  • Settings object ID: dt.settings.object_id("id"). The EQUALS operator applies.

For each criterion, you can specify multiple alternatives with comma-separated values. In this case, the OR logic applies. For example, eventType("CREATE","UPDATE") means eventType can be "CREATE" or "UPDATE".

You can specify multiple comma-separated criteria, such as eventType("CREATE","UPDATE"),category("CONFIG"). Only results matching all criteria are included in response.

Specify the value of a criterion as a quoted string. The following special characters must be escaped with a tilde (~) inside quotes:

  • Tilde ~
  • Quote "
config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

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:

  • timestamp: Oldest first.
  • -timestamp: Newest first.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
AuditLog 200 Success

Throws

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();

businessEventsClient

import { businessEventsClient } from '@dynatrace-sdk/client-classic-environment-v2';

ingest

businessEventsClient.ingest(config): Promise<void>

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).

Parameters

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"

Returns

Return type Status code Description
void 202 The provided business events are all accepted and will be processed.

Throws

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,
    },
  },
});

credentialVaultClient

import { credentialVaultClient } from '@dynatrace-sdk/client-classic-environment-v2';

createCredentials

credentialVaultClient.createCredentials(config): Promise<CredentialsId>

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.

Parameters

Name Type
config.body*required Credentials

Returns

Return type Status code Description
CredentialsId 201 Success. The new credentials set has been created. The response contains the ID of the set.

Throws

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],
  },
});

getCredentials

credentialVaultClient.getCredentials(config): Promise<CredentialsResponseElement>

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.

Parameters

Name Type Description
config.id*required string The Dynatrace entity ID of the required credentials set.

Returns

Return type Status code Description
CredentialsResponseElement 200 Success. The response contains the metadata of the credentials set.

Throws

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: "...",
});

getCredentialsDetails

credentialVaultClient.getCredentialsDetails(config): Promise<AbstractCredentialsResponseElement>

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.

Parameters

Name Type Description
config.id*required string The Dynatrace entity ID of the required credentials set.

Returns

Return type Status code Description
AbstractCredentialsResponseElement 200 Success. The response contains the details of the credentials set.

Throws

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: "...",
  });

listCredentials

credentialVaultClient.listCredentials(config): Promise<CredentialsList>

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.

Parameters

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).

Returns

Return type Status code Description
CredentialsList 200 Success

Throws

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();

removeCredentials

credentialVaultClient.removeCredentials(config): Promise<void>

Deletes the specified credentials set

Required scope: environment-api:credentials:write Required permission: environment:roles:viewer

Provide credential ID in the path.

Parameters

Name Type Description
config.id*required string The ID of the credentials set to be deleted.

Returns

Return type Status code Description
void 204 Success. The credentials set has been deleted. Response doesn't have a body.

Throws

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: "...",
});

updateCredentials

credentialVaultClient.updateCredentials(config): Promise<void | CredentialsId>

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.

Parameters

Name Type Description
config.body*required Credentials
config.id*required string The Dynatrace entity ID of the credentials set to be updated.

Returns

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.

Throws

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],
  },
});

davisSecurityAdvisorClient

import { davisSecurityAdvisorClient } from '@dynatrace-sdk/client-classic-environment-v2';

getAdviceForSecurityProblems

davisSecurityAdvisorClient.getAdviceForSecurityProblems(config): Promise<DavisSecurityAdviceList>

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.

Parameters

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.

  • Management zone ID: ids("mzId-1", "mzId-2").
  • Management zone names: names("mz-1", "mz-2").

You can specify several comma-separated criteria (for example, names("myMz"),ids("9130632296508575249")).

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.

Returns

Return type Status code Description
DavisSecurityAdviceList 200 Success

Throws

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();

eventsClient

import { eventsClient } from '@dynatrace-sdk/client-classic-environment-v2';

createEvent

eventsClient.createEvent(config): Promise<EventIngestResults>

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).

Parameters

Name Type
config.body*required EventIngest

Returns

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.

Throws

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: "...",
  },
});

getEvent

eventsClient.getEvent(config): Promise<Event>

Gets the properties of an event

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

Name Type Description
config.eventId*required string The ID of the required event.

Returns

Return type Status code Description
Event 200 Success. The response contains the configuration of the event.

Throws

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: "...",
});

getEventProperties

eventsClient.getEventProperties(config): Promise<EventPropertiesList>

Lists all event properties

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

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.

Returns

Return type Status code Description
EventPropertiesList 200 Success

Throws

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();

getEventProperty

eventsClient.getEventProperty(config): Promise<EventPropertyDetails>

Gets the details of an event property

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

Name Type Description
config.propertyKey*required string The event property key you're inquiring.

Returns

Return type Status code Description
EventPropertyDetails 200 Success

Throws

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: "...",
});

getEventType

eventsClient.getEventType(config): Promise<EventType>

Gets the properties of an event type

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

Name Type Description
config.eventType*required string The event type you're inquiring.

Returns

Return type Status code Description
EventType 200 Success

Throws

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: "...",
});

getEventTypes

eventsClient.getEventTypes(config): Promise<EventTypeList>

Lists all event types

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

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.

Returns

Return type Status code Description
EventTypeList 200 Success

Throws

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();

getEvents

eventsClient.getEvents(config): Promise<EventList>

Lists events within the specified timeframe

Required scope: environment-api:events:read Required permission: environment:roles:viewer

Parameters

Name Type Description
config.entitySelector string

The entity scope of the query. You must set one of these criteria:

  • Entity type: type("TYPE")
  • Dynatrace entity ID: entityId("id"). You can specify several IDs, separated by a comma (entityId("id-1","id-2")). All requested entities must be of the same type.

You can add one or more of the following criteria. Values are case-sensitive and the EQUALS operator is used unless otherwise specified.

  • Tag: tag("value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. Any colons (:) that are part of the key or value must be escaped with a backslash(\). Otherwise, it will be interpreted as the separator between the key and the value. All tag values are case-sensitive.
  • Management zone ID: mzId(123)
  • Management zone name: mzName(&quot;value&quot;)
  • Entity name:
    • entityName.equals: performs a non-casesensitive EQUALS query.
    • entityName.startsWith: changes the operator to BEGINS WITH.
    • entityName.in: enables you to provide multiple values. The EQUALS operator applies.
    • caseSensitive(entityName.equals(&quot;value&quot;)): takes any entity name criterion as an argument and makes the value case-sensitive.
  • Health state (HEALTHY,UNHEALTHY): healthState(&quot;HEALTHY&quot;)
  • First seen timestamp: firstSeenTms.&lt;operator&gt;(now-3h). Use any timestamp format from the from /to parameters. The following operators are available:
    • lte: earlier than or at the specified time
    • lt: earlier than the specified time
    • gte: later than or at the specified time
    • gt: later than the specified time
  • Entity attribute: &lt;attribute&gt;(&quot;value1&quot;,&quot;value2&quot;) and &lt;attribute&gt;.exists(). To fetch the list of available attributes, execute the GET entity type request and check the properties field of the response.
  • Relationships: fromRelationships.&lt;relationshipName&gt;() and toRelationships.&lt;relationshipName&gt;(). This criterion takes an entity selector as an attribute. To fetch the list of available relationships, execute the GET entity type request and check the fromRelationships and toRelationships fields.
  • Negation: not(&lt;criterion&gt;). Inverts any criterion except for type.

For more information, see Entity selector in Dynatrace Documentation.

To set several criteria, separate them with a comma (,). For example, type(&quot;HOST&quot;),healthState(&quot;HEALTHY&quot;). Only results matching all criteria are included in the response.

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.

  • Event ID: eventId("id-1", "id-2").
  • ID of related entity: entityId("id-1", "id-2").
  • Event status: status("OPEN") or status("CLOSED"). You can specify only one status.
  • Management zone ID: managementZoneId("123", "321").
  • Event type: eventType("event-type"). You can specify only one event type. You can fetch the list of possible event types with the GET event types call.
  • Correlation ID: correlationId("id-1", "id-2").
  • Happened during maintenance (true, false): underMaintenance(true).
  • Notifications are suppressed (true, false): suppressAlert(true).
  • Problem creation is suppressed (true, false): suppressProblem(true).
  • Frequent event (true, false): frequentEvent(true).
  • Event property: property.<key>("value-1", "value-2"). Only properties with the filterable property set to true can be used. You can check event properties via the GET event properties call.

To set several criteria, separate them with commas (,). Only results matching all criteria are included in the response.

config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two hours is used (now-2h).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
EventList 200 Success. The response contains the list of events.

Throws

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();

extensions_2_0Client

import { extensions_2_0Client } from '@dynatrace-sdk/client-classic-environment-v2';

activateExtensionEnvironmentConfiguration

extensions_2_0Client.activateExtensionEnvironmentConfiguration(config): Promise<ExtensionEnvironmentConfigurationVersion>

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

Parameters

Name Type Description
config.body*required ExtensionEnvironmentConfigurationVersion
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
ExtensionEnvironmentConfigurationVersion 200 Success. Environment configuration created.

Throws

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" } },
  );

createMonitoringConfiguration

extensions_2_0Client.createMonitoringConfiguration(config): Promise<Array<MonitoringConfigurationResponse>>

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

Parameters

Name Type Description
config.body*required Array<MonitoringConfigurationDto>
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
MonitoringConfigurationResponse 200 Success
ErrorEnvelope 207 Multi-Status, if not all requests resulted in the same status

Throws

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" }],
  });
extensions_2_0Client.createMonitoringConfiguration(config): Promise<Array<ErrorEnvelope | MonitoringConfigurationResponse>>

Parameters

Name Type Description
config.body*required Array<MonitoringConfigurationDto>
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
MonitoringConfigurationResponse 200 Success
ErrorEnvelope 207 Multi-Status, if not all requests resulted in the same status

deleteEnvironmentConfiguration

extensions_2_0Client.deleteEnvironmentConfiguration(config): Promise<ExtensionEnvironmentConfigurationVersion>

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

Parameters

Name Type Description
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
ExtensionEnvironmentConfigurationVersion 200 Success. Environment configuration deactivated.

Throws

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: "..." },
  );

executeExtensionMonitoringConfigurationActions

extensions_2_0Client.executeExtensionMonitoringConfigurationActions(config): Promise<ExecuteActionsResponse>

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

Parameters

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.

Returns

Return type Status code Description
ExecuteActionsResponse 202 Accepted. Response doesn't have a body.

Throws

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: {},
    },
  );

extensionConfigurationSchema

extensions_2_0Client.extensionConfigurationSchema(config): Promise<SchemaDefinitionRestDto>

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

Parameters

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

Returns

Return type Status code Description
SchemaDefinitionRestDto 200 Success

Throws

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: "...",
  });

extensionDetails

extensions_2_0Client.extensionDetails(config): Promise<Extension>

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

Parameters

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

Returns

Return type Status code Description
void 200 Success

Throws

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: "...",
});
extensions_2_0Client.extensionDetails(config): Promise<Binary>

Parameters

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

Returns

Return type Status code Description
void 200 Success

extensionMonitoringConfigurations

extensions_2_0Client.extensionMonitoringConfigurations(config): Promise<ExtensionMonitoringConfigurationsList>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionMonitoringConfigurationsList 200 Success

Throws

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: "..." },
  );

getActiveEnvironmentConfiguration

extensions_2_0Client.getActiveEnvironmentConfiguration(config): Promise<ExtensionEnvironmentConfigurationVersion>

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

Parameters

Name Type Description
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
ExtensionEnvironmentConfigurationVersion 200 Success

Throws

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: "..." },
  );

getActiveGateGroupsInfo

extensions_2_0Client.getActiveGateGroupsInfo(config): Promise<ActiveGateGroupsInfoDto>

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

Parameters

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

Returns

Return type Status code Description
ActiveGateGroupsInfoDto 200 Success

Throws

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: "...",
  });

getEnvironmentConfigurationAssetsInfo

extensions_2_0Client.getEnvironmentConfigurationAssetsInfo(config): Promise<ExtensionAssetsDto>

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

Parameters

Name Type Description
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
ExtensionAssetsDto 200 Success

Throws

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: "..." },
  );

getEnvironmentConfigurationEvents

extensions_2_0Client.getEnvironmentConfigurationEvents(config): Promise<ExtensionEventsList>

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

Parameters

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two hours is used (now-2h).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
ExtensionEventsList 200 List of the latest extension environment configuration events

Throws

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: "..." },
  );

getExtensionMonitoringConfigurationEvents

extensions_2_0Client.getExtensionMonitoringConfigurationEvents(config): Promise<ExtensionEventsList>

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

Parameters

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: 0x1a2b3c4d

config.dtEntityHost string

Host that uses this monitoring configuration.

Example: HOST-ABCDEF0123456789

config.dtExtensionDs string

Data source that uses this monitoring configuration.

Example: snmp

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two hours is used (now-2h).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
ExtensionEventsList 200 Success

Throws

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: "..." },
  );

getExtensionMonitoringConfigurationStatus

extensions_2_0Client.getExtensionMonitoringConfigurationStatus(config): Promise<ExtensionStatusDto>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionStatusDto 200 Success

Throws

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: "..." },
  );

getSchemaFile

extensions_2_0Client.getSchemaFile(config): Promise<JsonNode>

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

Parameters

Name Type Description
config.fileName*required string The name of the schema file.
config.schemaVersion*required string The version of the schema.

Returns

Return type Status code Description
JsonNode 200 Success

Throws

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: "...",
});

installExtension

extensions_2_0Client.installExtension(config): Promise<RegisteredExtensionResultDto>

Installs Extension from HUB

Required scope: environment-api:extensions:write One of the following permissions is required:

  • environment:roles:manage-settings
  • extensions:definitions:write

Parameters

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.

Returns

Return type Status code Description
RegisteredExtensionResultDto 200 Success. The extension 2.0 has been uploaded.

Throws

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: "...",
});

listExtensionInfos

extensions_2_0Client.listExtensionInfos(config): Promise<ExtensionInfoList>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionInfoList 200 Success

Throws

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();

listExtensionVersions

extensions_2_0Client.listExtensionVersions(config): Promise<ExtensionList>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionList 200 Success

Throws

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: "...",
  });

listExtensions

extensions_2_0Client.listExtensions(config): Promise<ExtensionList>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionList 200 Success

Throws

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();

listSchemaFiles

extensions_2_0Client.listSchemaFiles(config): Promise<SchemaFiles>

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

Parameters

Name Type Description
config.acceptType*required "application/json; charset=utf-8"
config.schemaVersion*required string The version of the schema.

Returns

Return type Status code Description
void 200 Success

Throws

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: "...",
});
extensions_2_0Client.listSchemaFiles(config): Promise<Binary>

Parameters

Name Type Description
config.acceptType*required "application/octet-stream"
config.schemaVersion*required string The version of the schema.

Returns

Return type Status code Description
void 200 Success

listSchemas

extensions_2_0Client.listSchemas(config): Promise<SchemasList>

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

Returns

Return type Status code Description
SchemasList 200 Success

Throws

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();

monitoringConfigurationDetails

extensions_2_0Client.monitoringConfigurationDetails(config): Promise<ExtensionMonitoringConfiguration>

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

Parameters

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.

Returns

Return type Status code Description
ExtensionMonitoringConfiguration 200 Success

Throws

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: "..." },
  );

removeExtension

extensions_2_0Client.removeExtension(config): Promise<Extension>

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

Parameters

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

Returns

Return type Status code Description
Extension 200 Success. The extension 2.0 version has been deleted.

Throws

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: "...",
});

removeMonitoringConfiguration

extensions_2_0Client.removeMonitoringConfiguration(config): Promise<void>

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

Parameters

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.

Returns

Return type Status code Description
void 204 Success. Response doesn't have a body.

Throws

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: "...",
  });

updateExtensionEnvironmentConfiguration

extensions_2_0Client.updateExtensionEnvironmentConfiguration(config): Promise<ExtensionEnvironmentConfigurationVersion>

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

Parameters

Name Type Description
config.body*required ExtensionEnvironmentConfigurationVersion
config.extensionName*required string The name of the requested extension 2.0.

Returns

Return type Status code Description
ExtensionEnvironmentConfigurationVersion 200 Success. Environment configuration updated.

Throws

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" } },
  );

updateMonitoringConfiguration

extensions_2_0Client.updateMonitoringConfiguration(config): Promise<MonitoringConfigurationResponse>

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

Parameters

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.

Returns

Return type Status code Description
MonitoringConfigurationResponse 200 Success

Throws

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: {},
  });

uploadExtension

extensions_2_0Client.uploadExtension(config): Promise<ExtensionUploadResponseDto>

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

Parameters

Name Type Description
config.body*required Blob
config.validateOnly boolean Only run validation but do not persist the extension even if validation was successful.

Returns

Return type Status code Description
ExtensionUploadResponseDto 200 The extension is valid
ExtensionUploadResponseDto 201 Success. The extension 2.0 has been uploaded.

Throws

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(),
});

logsClient

import { logsClient } from '@dynatrace-sdk/client-classic-environment-v2';

exportLogRecords

logsClient.exportLogRecords(config): Promise<ExportedLogRecordList>

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.

Parameters

Name Type Description
config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

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 + option will be applied.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
ExportedLogRecordList 200 Success

Throws

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();

getLogHistogramData

logsClient.getLogHistogramData(config): Promise<AggregatedLog>

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.

Parameters

Name Type Description
config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

config.groupBy Array<string>

The groupings to be included in the response.

You can specify several groups in the following format: groupBy=status&groupBy=log.source.

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, span_id or trace_id cannot be used for grouping.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
AggregatedLog 200 Success

Throws

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();

getLogRecords

logsClient.getLogRecords(config): Promise<LogRecordsList>

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.

Parameters

Name Type Description
config.from string

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

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 + option will be applied.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
LogRecordsList 200 Success

Throws

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();

storeLog

logsClient.storeLog(config): Promise<void | SuccessEnvelope>

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.

Parameters

Name Type
config.body*required LogMessageJson | LogMessagePlain
config.type*required "application/json" | "application/json; charset=utf-8" | "text/plain; charset=utf-8"

Returns

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.

Throws

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",
    },
  ],
});

metricsClient

import { metricsClient } from '@dynatrace-sdk/client-classic-environment-v2';

allMetrics

metricsClient.allMetrics(config): Promise<MetricDescriptorCollection>

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:

  1. Specify the number of results per page in the pageSize query parameter.

  2. 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.

Parameters

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.

metricId is always included in the result. The following additional properties are available:

  • displayName: The name of the metric in the user interface. Enabled by default.
  • description: A short description of the metric. Enabled by default.
  • unit: The unit of the metric. Enabled by default.
  • tags: The tags of the metric.
  • dduBillable: An indicator whether the usage of metric consumes Davis data units. Deprecated and always false for Dynatrace Platform Subscription. Superseded by billable.
  • billable: An indicator whether the usage of metric is billable.
  • created: The timestamp (UTC milliseconds) when the metrics has been created.
  • lastWritten: The timestamp (UTC milliseconds) when metric data points have been written for the last time.
  • aggregationTypes: The list of allowed aggregations for the metric. Note that it may be different after a transformation is applied.
  • defaultAggregation: The default aggregation of the metric. It is used when no aggregation is specified or the :auto transformation is set.
  • dimensionDefinitions: The fine metric division (for example, process group and process ID for some process-related metric).
  • transformations: A list of transformations that can be applied to the metric.
  • entityType: A list of entity types supported by the metric.
  • minimumValue: The minimum allowed value of the metric.
  • maximumValue: The maximum allowed value of the metric.
  • rootCauseRelevant: Whether (true or false) the metric is related to a root cause of a problem. A root-cause relevant metric represents a strong indicator for a faulty component.
  • impactRelevant: Whether (true or false) the metric is relevant to a problem's impact. An impact-relevant metric is highly dependent on other metrics and changes because an underlying root-cause metric has changed.
  • metricValueType: The type of the metric's value. You have these options:
    • score: A score metric is a metric where high values indicate a good situation, while low values indicate trouble. An example of such a metric is a success rate.
    • error: An error metric is a metric where high values indicate trouble, while low values indicate a good situation. An example of such a metric is an error count.
  • latency: The latency of the metric, in minutes. The latency is the expected reporting delay (for example, caused by constraints of cloud vendors or other third-party data sources) between the observation of a metric data point and its availability in Dynatrace. The allowed value range is from 1 to 60 minutes.
  • metricSelector: The underlying metric selector used by a func: metric.
  • scalar: Indicates whether the metric expression resolves to a scalar (true) or to a series (false). A scalar result always contains one data point. The amount of data points in a series result depends on the resolution you're using.
  • resolutionInfSupported: If true, resolution=Inf can be applied to the metric query.

To add properties, list them with leading plus +. To exclude default properties, list them with leading minus -.

To specify several properties, join them with a comma (for example fields=+aggregationTypes,-description).

If you specify just one property, the response contains the metric key and the specified property. To return metric keys only, specify metricId here.

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 EQUALS operator is used. If several values are specified, the OR logic applies.

  • unit("unit-1","unit-2")

  • tags("tag-1","tag-2")

  • dimensionKey("dimkey-1","dimkey-2"). The filtering applies only to dimensions that were written within the last 14 days.

  • custom("true"). "true" to include only user-defined metrics metrics (without namespace or with ext:, calc:, func:, appmon:), "false" to filter them out.

  • exported("true"). "true" to include only exported metrics, "false" to filter them out.

To set several criteria, separate them with a comma (,). For example, tags("feature","cloud"),unit("Percent"),dimensionKey("location"),custom("true"). Only results matching all criteria are included in response.

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: tags("feature"),unit("Percent","MegaByte"),tags("cloud"),dimensionKey("location").

config.metricSelector string

Selects metrics for the query by their keys.

You can specify multiple metric keys separated by commas (for example, metrickey1,metrickey2). To select multiple metrics belonging to the same parent, list the last part of the required metric keys in parentheses, separated by commas, while keeping the common part untouched. For example, to list the builtin:host.cpu.idle and builtin:host.cpu.user metric, write: builtin:host.cpu.(idle,user).

You can select a full set of related metrics by using a trailing asterisk (*) wildcard. For example, builtin:host.* selects all host-based metrics and builtin:* selects all Dynatrace-provided metrics.

You can set additional transformation operators, separated by a colon (:). See Metrics selector transformations in Dynatrace Documentation for additional information on available result transformations and syntax.

Only aggregation, merge, parents, and splitBy transformations are supported by this endpoint.

If the metric key contains any symbols you must quote (") the key. The following characters inside of a quoted metric key must be escaped with a tilde (~):

  • Quotes (")
  • Tildes (~)

For example, to query the metric with the key of ext:selfmonitoring.jmx.Agents: Type "APACHE" you must specify this selector:

"ext:selfmonitoring.jmx.Agents: Type ~"APACHE~""

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

Returns

Return type Status code Description
MetricDescriptorCollection 200 Success

Throws

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",
});

delete

metricsClient.delete(config): Promise<void>

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.

Parameters

Name Type Description
config.metricKey*required string The key of the required metric.

Returns

Return type Status code Description
void 202 Success. The deletion of the metric has been triggered.

Throws

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: "...",
});

ingest

metricsClient.ingest(config): Promise<ValidationResponse>

Pushes metric data points to Dynatrace

Required scope: storage:metrics:write Required permission: storage:metrics:write

Parameters

Name Type
config.body*required string

Returns

Return type Status code Description
void 202 The provided business events are all accepted and will be processed.

Throws

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",
});

metric

metricsClient.metric(config): Promise<MetricDescriptor>

Gets the descriptor of the specified metric

Required scope: environment-api:metrics:read Required permission: environment:roles:viewer

Parameters

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 (:). See Metrics selector transformations in Dynatrace Documentation for additional information on available result transformations and syntax.

Returns

Return type Status code Description
MetricDescriptor 200 Success

Throws

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: "...",
});

query

metricsClient.query(config): Promise<MetricData>

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.

Parameters

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:

  • Entity type: type("TYPE")
  • Dynatrace entity ID: entityId("id"). You can specify several IDs, separated by a comma (entityId("id-1","id-2")). All requested entities must be of the same type.

You can add one or more of the following criteria. Values are case-sensitive and the EQUALS operator is used unless otherwise specified.

  • Tag: tag("value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. Any colons (:) that are part of the key or value must be escaped with a backslash(\). Otherwise, it will be interpreted as the separator between the key and the value. All tag values are case-sensitive.
  • Management zone ID: mzId(123)
  • Management zone name: mzName(&quot;value&quot;)
  • Entity name:
    • entityName.equals: performs a non-casesensitive EQUALS query.
    • entityName.startsWith: changes the operator to BEGINS WITH.
    • entityName.in: enables you to provide multiple values. The EQUALS operator applies.
    • caseSensitive(entityName.equals(&quot;value&quot;)): takes any entity name criterion as an argument and makes the value case-sensitive.
  • Health state (HEALTHY,UNHEALTHY): healthState(&quot;HEALTHY&quot;)
  • First seen timestamp: firstSeenTms.&lt;operator&gt;(now-3h). Use any timestamp format from the from /to parameters. The following operators are available:
    • lte: earlier than or at the specified time
    • lt: earlier than the specified time
    • gte: later than or at the specified time
    • gt: later than the specified time
  • Entity attribute: &lt;attribute&gt;(&quot;value1&quot;,&quot;value2&quot;) and &lt;attribute&gt;.exists(). To fetch the list of available attributes, execute the GET entity type request and check the properties field of the response.
  • Relationships: fromRelationships.&lt;relationshipName&gt;() and toRelationships.&lt;relationshipName&gt;(). This criterion takes an entity selector as an attribute. To fetch the list of available relationships, execute the GET entity type request and check the fromRelationships and toRelationships fields.
  • Negation: not(&lt;criterion&gt;). Inverts any criterion except for type.

For more information, see Entity selector in Dynatrace Documentation.

To set several criteria, separate them with a comma (,). For example, type(&quot;HOST&quot;),healthState(&quot;HEALTHY&quot;). Only results matching all criteria are included in the response.

The maximum string length is 2,000 characters.

Use the GET /metrics/\{metricId} call to fetch the list of possible entity types for your metric.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two hours is used (now-2h).

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, metrickey1,metrickey2). To select multiple metrics belonging to the same parent, list the last part of the required metric keys in parentheses, separated by commas, while keeping the common part untouched. For example, to list the builtin:host.cpu.idle and builtin:host.cpu.user metric, write: builtin:host.cpu.(idle,user).

If the metric key contains any symbols you must quote (") the key. The following characters inside of a quoted metric key must be escaped with a tilde (~):

  • Quotes (")
  • Tildes (~)

For example, to query the metric with the key of ext:selfmonitoring.jmx.Agents: Type "APACHE" you must specify this selector:

"ext:selfmonitoring.jmx.Agents: Type ~"APACHE~""

You can set additional transformation operators, separated by a colon (:). See Metrics selector transformations in Dynatrace Documentation for additional information on available result transformations and syntax.

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 EQUALS operator is used. If several values are specified, the OR logic applies.

  • mzId(123,456)
  • mzName("name-1","name-2") To set several criteria, separate them with a comma (,). For example, mzName("name-1","name-2"),mzId(1234). Only results matching all of the criteria are included in the response.For example, to list metrics that have the id 123 OR 234 AND the name name-1 OR name-2, use this mzSelector: `mzId(123,234),mzName("name-1","name-2").
config.resolution string

The desired resolution of data points.

You can use one of the following options:

  • The desired amount of data points. This is the default option. This is a reference number of points, which is not necessarily equal to the number of the returned data points.
  • The desired timespan between data points. This is a reference timespan, which is not necessarily equal to the returned timespan. To use this option, specify the unit of the timespan.

Valid units for the timespan are:

  • m: minutes
  • h: hours
  • d: days
  • w: weeks
  • M: months
  • q: quarters
  • y: years

If not set, the default is 120 data points.

For example:

  • Get data points which are 10 minutes apart: resolution=10m
  • Get data points which are 3 weeks apart: resolution=3w
config.to string

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
MetricData 200 Success

Throws

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",
});

metricsUnitsClient

import { metricsUnitsClient } from '@dynatrace-sdk/client-classic-environment-v2';

allUnits

metricsUnitsClient.allUnits(config): Promise<UnitList>

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.

Parameters

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:

  • displayName: The display name of the unit.
  • symbol: The symbol of the unit.
  • description: A short description of the unit.

By default, the ID, the display name, and the symbol are included.

To add properties, list them with leading plus +. To exclude default properties, list them with leading minus -.

To specify several properties, join them with a comma (for example fields=+description,-symbol).

If you specify just one property, the response contains the unitId and the specified property. To return unit IDs only, specify unitId here.

config.unitSelector string

Selects units to be included to the response. Available criteria:

  • Compatibility: compatibleTo("unit","display-format"). Returns units that can be converted to the specified unit. The optional display format (binary or decimal) argument is supported by bit- and byte-based units and returns only units for the specified format.

Returns

Return type Status code Description
UnitList 200 Success

Throws

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();

convert

metricsUnitsClient.convert(config): Promise<UnitConversionResult>

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).

Parameters

Name Type Description
config.numberFormat string

The preferred number format of the target value. You can specify the following formats:

  • binary
  • decimal

`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.

Returns

Return type Status code Description
UnitConversionResult 200 Success

Throws

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,
});

unit

metricsUnitsClient.unit(config): Promise<Unit>

Gets the properties of the specified unit

Required scope: environment-api:metrics:read Required permission: environment:roles:viewer

Parameters

Name Type
config.unitId*required string

Returns

Return type Status code Description
Unit 200 Success

Throws

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: "...",
});

monitoredEntitiesClient

import { monitoredEntitiesClient } from '@dynatrace-sdk/client-classic-environment-v2';

deleteSecurityContext

monitoredEntitiesClient.deleteSecurityContext(config): Promise<SecurityContextResultDto>

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.

Parameters

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:

  • Entity type: type("TYPE")
  • Dynatrace entity ID: entityId("id"). You can specify several IDs, separated by a comma (entityId("id-1","id-2")). All requested entities must be of the same type.

You can add one or more of the following criteria. Values are case-sensitive and the EQUALS operator is used unless otherwise specified.

  • Tag: tag("value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. Any colons (:) that are part of the key or value must be escaped with a backslash(\). Otherwise, it will be interpreted as the separator between the key and the value. All tag values are case-sensitive.
  • Management zone ID: mzId(123)
  • Management zone name: mzName(&quot;value&quot;)
  • Entity name:
    • entityName.equals: performs a non-casesensitive EQUALS query.
    • entityName.startsWith: changes the operator to BEGINS WITH.
    • entityName.in: enables you to provide multiple values. The EQUALS operator applies.
    • caseSensitive(entityName.equals(&quot;value&quot;)): takes any entity name criterion as an argument and makes the value case-sensitive.
  • Health state (HEALTHY,UNHEALTHY): healthState(&quot;HEALTHY&quot;)
  • First seen timestamp: firstSeenTms.&lt;operator&gt;(now-3h). Use any timestamp format from the from /to parameters. The following operators are available:
    • lte: earlier than or at the specified time
    • lt: earlier than the specified time
    • gte: later than or at the specified time
    • gt: later than the specified time
  • Entity attribute: &lt;attribute&gt;(&quot;value1&quot;,&quot;value2&quot;) and &lt;attribute&gt;.exists(). To fetch the list of available attributes, execute the GET entity type request and check the properties field of the response.
  • Relationships: fromRelationships.&lt;relationshipName&gt;() and toRelationships.&lt;relationshipName&gt;(). This criterion takes an entity selector as an attribute. To fetch the list of available relationships, execute the GET entity type request and check the fromRelationships and toRelationships fields.
  • Negation: not(&lt;criterion&gt;). Inverts any criterion except for type.

For more information, see Entity selector in Dynatrace Documentation.

To set several criteria, separate them with a comma (,). For example, type(&quot;HOST&quot;),healthState(&quot;HEALTHY&quot;). Only results matching all criteria are included in the response.

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of three days is used (now-3d).

config.to string

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

Returns

Return type Status code Description
SecurityContextResultDto 200 Success

Throws

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: "...",
  });

getEntities

monitoredEntitiesClient.getEntities(config): Promise<EntitiesList>

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:

You can limit the output by using pagination:

  1. Specify the number of results per page in the pageSize query parameter.
  2. Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.

Parameters

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:

  • Entity type: type("TYPE")
  • Dynatrace entity ID: entityId("id"). You can specify several IDs, separated by a comma (entityId("id-1","id-2")). All requested entities must be of the same type.

You can add one or more of the following criteria. Values are case-sensitive and the EQUALS operator is used unless otherwise specified.

  • Tag: tag("value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. Any colons (:) that are part of the key or value must be escaped with a backslash(\). Otherwise, it will be interpreted as the separator between the key and the value. All tag values are case-sensitive.
  • Management zone ID: mzId(123)
  • Management zone name: mzName(&quot;value&quot;)
  • Entity name:
    • entityName.equals: performs a non-casesensitive EQUALS query.
    • entityName.startsWith: changes the operator to BEGINS WITH.
    • entityName.in: enables you to provide multiple values. The EQUALS operator applies.
    • caseSensitive(entityName.equals(&quot;value&quot;)): takes any entity name criterion as an argument and makes the value case-sensitive.
  • Health state (HEALTHY,UNHEALTHY): healthState(&quot;HEALTHY&quot;)
  • First seen timestamp: firstSeenTms.&lt;operator&gt;(now-3h). Use any timestamp format from the from /to parameters. The following operators are available:
    • lte: earlier than or at the specified time
    • lt: earlier than the specified time
    • gte: later than or at the specified time
    • gt: later than the specified time
  • Entity attribute: &lt;attribute&gt;(&quot;value1&quot;,&quot;value2&quot;) and &lt;attribute&gt;.exists(). To fetch the list of available attributes, execute the GET entity type request and check the properties field of the response.
  • Relationships: fromRelationships.&lt;relationshipName&gt;() and toRelationships.&lt;relationshipName&gt;(). This criterion takes an entity selector as an attribute. To fetch the list of available relationships, execute the GET entity type request and check the fromRelationships and toRelationships fields.
  • Negation: not(&lt;criterion&gt;). Inverts any criterion except for type.

For more information, see Entity selector in Dynatrace Documentation.

To set several criteria, separate them with a comma (,). For example, type(&quot;HOST&quot;),healthState(&quot;HEALTHY&quot;). Only results matching all criteria are included in the response.

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 +. You can specify several properties, separated by a comma (for example fields=+lastSeenTms,+properties.BITNESS).

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 properties.FIELD format (for example, properties.BITNESS).

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:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of three days is used (now-3d).

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 sort=name or sort =+name for ascending, sort=-name for descending)

config.to string

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days

Readme

Keywords

none

Package Sidebar

Install

npm i @dynatrace-sdk/client-classic-environment-v2

Weekly Downloads

299

Version

3.7.0

License

Apache-2.0

Unpacked Size

4.38 MB

Total Files

730

Last publish

Collaborators

  • dynatrace-nodejs
  • stefan.wolfsteiner.dynatrace
  • wasserb