Skip to main content

Classic Environment V2

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 .

Notes about compatibility:

  • Operations marked as early adopter or preview may be changed in non-compatible ways, although we try to avoid this.
  • We may add new enum constants without incrementing the API version; thus, clients need to handle unknown enum constants gracefully.
npm install @dynatrace-sdk/client-classic-environment-v2

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

NameType
config.body*requiredActiveGateTokenCreate

Returns

Success. The token has been created. The body of the response contains the token secret.

Code example

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

const data =
await accessTokensActiveGateTokensClient.createToken({
body: { 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

NameTypeDescription
config.activeGateTokenIdentifier*requiredstringThe ActiveGate token identifier, consisting of prefix and public part of the token.

Returns

Success. The response contains the metadata of the tokens.

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

NameTypeDescription
config.nextPageKeystring

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

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

Success. The response contains the list of ActiveGate tokens.

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

NameTypeDescription
config.activeGateTokenIdentifier*requiredstringThe ActiveGate token identifier, consisting of prefix and public part of the token to be deleted.

Code example

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

const data =
await accessTokensActiveGateTokensClient.revokeToken({
activeGateTokenIdentifier: "...",
});

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

NameType
config.body*requiredApiTokenCreate

Returns

Success. The token has been created. The body of the response contains the token secret.

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

NameTypeDescription
config.id*requiredstring

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.

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

NameType
config.id*requiredstring

Returns

Success

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

NameTypeDescription
config.apiTokenSelectorstring

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

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

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

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

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

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.

default: "-creationDate"
config.tostring

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

Success

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

NameType
config.body*requiredApiTokenSecret

Returns

Success

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

NameTypeDescription
config.body*requiredApiTokenUpdate
config.id*requiredstring

The ID of the token to be updated.

You can't disable the token you're using for authentication of the request.

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(abortSignal?): 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

Success. Rotation process has been cancelled. The current tenant token remains valid.

Code example

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

const data =
await accessTokensTenantTokensClient.cancelRotation();

finishRotation

accessTokensTenantTokensClient.finishRotation(abortSignal?): 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

Success. The rotation process is completed. The active field of the response contains the new tenant token.

Code example

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

const data =
await accessTokensTenantTokensClient.finishRotation();

startRotation

accessTokensTenantTokensClient.startRotation(abortSignal?): 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

Success. The new tenant token is created and will replace the old one. The active field of the response contains the new tenant token.

Code example

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

const data =
await accessTokensTenantTokensClient.startRotation();

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.

Returns

Success

Code example

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

const data =
await activeGatesAutoUpdateConfigurationClient.getAutoUpdateConfigById(
{ agId: "..." },
);

getGlobalAutoUpdateConfigForTenant

activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant(abortSignal?): Promise<ActiveGateGlobalAutoUpdateConfig>

Gets the global auto-update configuration of environment ActiveGates.

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

Returns

Success

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.body*requiredActiveGateAutoUpdateConfig

Code example

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

const data =
await activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(
{ agId: "...", body: {} },
);

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

NameType
config.body*requiredActiveGateGlobalAutoUpdateConfig

Code example

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

const data =
await activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(
{ body: {} },
);

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.body*requiredActiveGateAutoUpdateConfig

Code example

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

const data =
await activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(
{ agId: "...", body: {} },
);

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

NameType
config.body*requiredActiveGateGlobalAutoUpdateConfig

Code example

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

const data =
await activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(
{ body: {} },
);

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.body*requiredUpdateJob

Returns

Success. The update-job have been created.

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.jobId*requiredstringA unique identifier for a update-job of ActiveGate.

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

NameTypeDescription
config.fromstring

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.lastUpdatesbooleanIf true, filters the resulting set of update jobs to the most recent update of each type. default: false
config.startVersionstringFilters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>).
config.startVersionCompareTypeGetAllUpdateJobListQueryStartVersionCompareType

Filters the resulting set of update jobs by the specified initial version.

Specify the comparison operator here.

default: "EQUAL"
config.targetVersionstringFilters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>).
config.targetVersionCompareTypeGetAllUpdateJobListQueryTargetVersionCompareType

Filters the resulting set of update jobs by the specified target version.

Specify the comparison operator here.

default: "EQUAL"
config.tostring

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.updateTypeGetAllUpdateJobListQueryUpdateTypeFilters the resulting set of update-jobs by the update type.

Returns

Success

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.jobId*requiredstringA unique identifier for a update-job of ActiveGate.

Returns

Success

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.fromstring

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.lastUpdatesbooleanIf true, filters the resulting set of update jobs to the most recent update of each type. default: false
config.startVersionstringFilters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>).
config.startVersionCompareTypeGetUpdateJobListByAgIdQueryStartVersionCompareType

Filters the resulting set of update jobs by the specified initial version.

Specify the comparison operator here.

default: "EQUAL"
config.targetVersionstringFilters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>).
config.targetVersionCompareTypeGetUpdateJobListByAgIdQueryTargetVersionCompareType

Filters the resulting set of update jobs by the specified target version.

Specify the comparison operator here.

default: "EQUAL"
config.tostring

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.updateTypeGetUpdateJobListByAgIdQueryUpdateTypeFilters the resulting set of update-jobs by the update type.

Returns

Success

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.
config.body*requiredUpdateJob

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

NameTypeDescription
config.autoUpdateGetAllActiveGatesQueryAutoUpdateFilters the resulting set of ActiveGates by the actual state of auto-update.
config.containerizedbooleanFilters the resulting set of ActiveGates to those which are running in container (true) or not (false).
config.disabledModuleArray<GetAllActiveGatesQueryDisabledModuleItem>Filters the resulting set of ActiveGates by the disabled modules.
config.enabledModuleArray<GetAllActiveGatesQueryEnabledModuleItem>Filters the resulting set of ActiveGates by the enabled modules.
config.groupstring

Filters the resulting set of ActiveGates by the group.

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

config.hostnamestring

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

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

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

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.onlinebooleanFilters the resulting set of ActiveGates by the communication status.
config.osArchitectureGetAllActiveGatesQueryOsArchitectureFilters the resulting set of ActiveGates by the OS architecture of the host it's running on.
config.osTypeGetAllActiveGatesQueryOsTypeFilters the resulting set of ActiveGates by the OS type of the host it's running on.
config.tokenExpirationSetbooleanFilters the resulting set of ActiveGates to those with set expiration date for authorization token.
config.tokenStateGetAllActiveGatesQueryTokenStateFilters the resulting set of ActiveGates to those with authorization token in specified state.
config.typeGetAllActiveGatesQueryTypeFilters the resulting set of ActiveGates by the ActiveGate type.
config.updateStatusGetAllActiveGatesQueryUpdateStatusFilters the resulting set of ActiveGates by the auto-update status.
config.versionstring

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

Filters the resulting set of ActiveGates by the specified version.

Specify the comparison operator here.

default: "EQUAL"

Returns

Success

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

NameTypeDescription
config.agId*requiredstringThe ID of the required ActiveGate.

Returns

Success

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

NameTypeDescription
config.fieldsstring

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*requiredstringThe ID of the attack.

Returns

Success

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

NameTypeDescription
config.attackSelectorstring

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

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

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

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

The amount of attacks in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

config.sortstring

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

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

Success

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

NameTypeDescription
config.id*requiredstringThe ID of the required log entry.

Returns

Success

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

NameTypeDescription
config.filterstring

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

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

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

The amount of log entries in a single response payload.

The maximal allowed page size is 5000.

If not set, 1000 is used.

config.sortstring

The sorting of audit log entries:

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

If not set, the newest first sorting is applied.

default: "-timestamp"
config.tostring

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

Success

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

Returns

The provided business events are all accepted and will be processed.

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

NameType
config.body*requiredCredentials

Returns

Success. The new credentials set has been created. The response contains the ID of the set.

Code example

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

const data = await credentialVaultClient.createCredentials({
body: {
name: "...",
scopes: [CredentialsScopesItem.Extension],
},
});

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

NameTypeDescription
config.id*requiredstringThe Dynatrace entity ID of the required credentials set.

Returns

Success. The response contains the metadata of the credentials set.

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

NameTypeDescription
config.id*requiredstringThe Dynatrace entity ID of the required credentials set.

Returns

Success. The response contains the details of the credentials set.

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

NameTypeDescription
config.namestringFilters the result by the name. When in quotation marks, whole phrase is taken. Case insensitive.
config.nextPageKeystring

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

The amount of credentials in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

config.scopestringFilters credentials with specified scope.
config.typeListCredentialsQueryTypeFilters the result by the specified credentials type.
config.userstringFilters credentials accessible to the user (owned by the user or the ones that are accessible for all).

Returns

Success

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

NameTypeDescription
config.id*requiredstringThe ID of the credentials set to be deleted.

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

NameTypeDescription
config.body*requiredCredentials
config.id*requiredstringThe Dynatrace entity ID of the credentials set to be updated.

Returns

Success. The new credentials set has been created. The response contains the ID of the set.

Code example

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

const data = await credentialVaultClient.updateCredentials({
id: "...",
body: {
name: "...",
scopes: [CredentialsScopesItem.Extension],
},
});

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

NameTypeDescription
config.managementZoneFilterstring

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

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

The amount of security advices in a single response payload.

The maximal allowed page size is 500.

If not set, 5 is used.

Returns

Success

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

NameType
config.body*requiredEventIngest

Returns

The event ingest request was received by the server. The response body indicates for each event whether its creation was successful.

Code example

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

const data = await eventsClient.createEvent({
body: { 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

NameTypeDescription
config.eventId*requiredstringThe ID of the required event.

Returns

Success. The response contains the configuration of the event.

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

NameTypeDescription
config.nextPageKeystring

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

The amount of event properties in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

Returns

Success

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

NameTypeDescription
config.propertyKey*requiredstringThe event property key you're inquiring.

Returns

Success

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

NameTypeDescription
config.eventType*requiredstringThe event type you're inquiring.

Returns

Success

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

NameTypeDescription
config.nextPageKeystring

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

The amount of event types in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

Returns

Success

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

NameTypeDescription
config.entitySelectorstring

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

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

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

config.fromstring

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

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

The amount of events in a single response payload.

The maximal allowed page size is 1000.

If not set, 100 is used.

config.tostring

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

Success. The response contains the list of events.

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

NameTypeDescription
config.body*requiredExtensionEnvironmentConfigurationVersion
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success. Environment configuration created.

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

NameTypeDescription
config.body*requiredArray<MonitoringConfigurationDto>
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success | Multi-Status, if not all requests resulted in the same status

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

NameTypeDescription
config.body*requiredArray<MonitoringConfigurationDto>
config.extensionName*requiredstringThe name of the requested extension 2.0.

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success. Environment configuration deactivated.

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

NameTypeDescription
config.body*requiredExecuteActionsDto
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Accepted. Response doesn&apos;t have a body.

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.extensionVersion*requiredstringThe version of the requested extension 2.0

Returns

Success

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

NameTypeDescription
config.acceptType*required"application/json; charset=utf-8"
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.extensionVersion*requiredstringThe version of the requested extension 2.0

Returns

Success

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

NameTypeDescription
config.acceptType*required"application/octet-stream"
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.extensionVersion*requiredstringThe version of the requested extension 2.0

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

NameTypeDescription
config.activebooleanFilters the resulting set of configurations by the active state.
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.nextPageKeystring

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

The amount of extensions in a single response payload.

The maximal allowed page size is 100.

If not set, 20 is used.

config.versionstringFilters the resulting set of configurations by extension 2.0 version.

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.extensionVersion*requiredstringThe version of the requested extension 2.0

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success

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

NameTypeDescription
config.contentstringContent of the event
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.fromstring

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.statusGetEnvironmentConfigurationEventsQueryStatusStatus of the event
config.tostring

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

List of the latest extension environment configuration events

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

NameTypeDescription
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.contentstringContent of the event
config.dtActiveGateIdstring

Hexadecimal ID of Active Gate that uses this monitoring configuration.

Example: 0x1a2b3c4d

config.dtEntityHoststring

Host that uses this monitoring configuration.

Example: HOST-ABCDEF0123456789

config.dtExtensionDsstring

Data source that uses this monitoring configuration.

Example: snmp

config.extensionName*requiredstringThe name of the requested extension 2.0.
config.fromstring

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.statusGetExtensionMonitoringConfigurationEventsQueryStatusStatus of the event
config.tostring

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

Success

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

NameTypeDescription
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success

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

NameTypeDescription
config.fileName*requiredstringThe name of the schema file.
config.schemaVersion*requiredstringThe version of the schema.

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.versionstringFilters the resulting set of configurations by extension 2.0 version.

Returns

Success. The extension 2.0 has been uploaded.

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

NameTypeDescription
config.namestringFilters the resulting set of extensions 2.0 by name. You can specify a partial name. In that case, the CONTAINS operator is used.
config.nextPageKeystring

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

The amount of extensions in a single response payload.

The maximal allowed page size is 100.

If not set, 20 is used.

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.nextPageKeystring

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

The amount of extensions in a single response payload.

The maximal allowed page size is 100.

If not set, 20 is used.

Returns

Success

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

NameTypeDescription
config.namestringFilters the resulting set of extensions 2.0 by name. You can specify a partial name. In that case, the CONTAINS operator is used.
config.nextPageKeystring

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

The amount of extensions in a single response payload.

The maximal allowed page size is 100.

If not set, 20 is used.

Returns

Success

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

NameTypeDescription
config.acceptType*required"application/json; charset=utf-8"
config.schemaVersion*requiredstringThe version of the schema.

Returns

Success

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

NameTypeDescription
config.acceptType*required"application/octet-stream"
config.schemaVersion*requiredstringThe version of the schema.

listSchemas

extensions_2_0Client.listSchemas(abortSignal?): 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

Success

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

NameTypeDescription
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success

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

NameTypeDescription
config.extensionName*requiredstringThe name of the requested extension 2.0.
config.extensionVersion*requiredstringThe version of the requested extension 2.0

Returns

Success. The extension 2.0 version has been deleted.

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

NameTypeDescription
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.extensionName*requiredstringThe name of the requested extension 2.0.

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

NameTypeDescription
config.body*requiredExtensionEnvironmentConfigurationVersion
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success. Environment configuration updated.

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

NameTypeDescription
config.body*requiredMonitoringConfigurationUpdateDto
config.configurationId*requiredstringThe ID of the requested monitoring configuration.
config.extensionName*requiredstringThe name of the requested extension 2.0.

Returns

Success

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

NameTypeDescription
config.body*requiredBlob
config.type*required"application/octet-stream" | "multipart/form-data"
config.validateOnlybooleanOnly run validation but do not persist the extension even if validation was successful. default: false

Returns

The extension is valid | Success. The extension 2.0 has been uploaded.

Code example

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

const data = await extensions_2_0Client.uploadExtension({
type: "application/octet-stream",
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.

Disabled on Log Management and Analytics, powered by Grail.

Parameters

NameTypeDescription
config.fromstring

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

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.pageSizenumberThe number of results per result page. default: 1000
config.querystring

The log search query.

The query must use the Dynatrace search query language.

default: ""
config.sortstring

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

default: "-timestamp"
config.tostring

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

Success

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.

Parameters

NameTypeDescription
config.fromstring

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.groupByArray<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.maxGroupValuesnumber

The maximum number of values in each group.

You can get up to 100 values per group.

If not set, 10 is used.

default: 10
config.querystring

The log search query.

The query must use the Dynatrace search query language.

default: ""
config.timeBucketsnumber

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.

default: 1
config.tostring

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

Success

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.

Parameters

NameTypeDescription
config.fromstring

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

The desired amount of log records.

The maximal allowed limit is 1000.

If not set, 1000 is used.

default: 1000
config.nextSliceKeystring

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

The log search query.

The query must use the Dynatrace search query language.

default: ""
config.sortstring

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

default: "-timestamp"
config.tostring

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

Success

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.

The maximum payload size of a single request is 5 MB. Requests with a greater payload are rejected, and the API returns a 413 response code.

If the ingested payload is a JSON array, the maximum array size is 50000. Requests with a greater payload are rejected, and the API returns a 413 response code.

Log events per minute (SaaS):

Grail tenants: no limit, other tenants: 1M per minute by default.

If your log data stream within your cluster exceeds the limit, all log events above the limit are ignored.

Log events per minute (Managed):

1k/minute per cluster by default.

If your log data stream within your cluster exceeds the limit, all log events above the limit are ignored.

If you increase resources (RAM) in your nodes, you can increase the limit based on the cluster resources size using an API call or Cluster Management Console (CMC).

Refresh cluster limit using the API call

See Update log events per cluster for Log Monitoring.

Refresh cluster limit using Cluster Management Console (CMC)

  1. In the CMC, select Environments and the environment for which you wish to update the total log events per cluster.

  2. On the environment details page, in the Cluster overload prevention settings section, select the Refresh cluster limit.

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.

Returns

Only a part of input events were ingested due to event invalidity. For details, check the response body.

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

NameTypeDescription
config.acceptType*required"application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8"
config.fieldsstring

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

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

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

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

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.textstringMetric 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.writtenSincestring

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

Success

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

NameTypeDescription
config.metricKey*requiredstringThe key of the required metric.

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

NameType
config.body*requiredstring

Returns

The provided metric data points are accepted and will be processed in the background.

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

NameTypeDescription
config.acceptType*required"application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8"
config.metricKey*requiredstring

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

Success

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

NameTypeDescription
config.acceptType*required"application/json; charset=utf-8" | "text/csv; header=absent; charset=utf-8" | "text/csv; header=present; charset=utf-8"
config.entitySelectorstring

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

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

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

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

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

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

Success

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

NameTypeDescription
config.fieldsstring

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

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

Success

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

NameTypeDescription
config.numberFormatstring

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

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*requiredstringThe ID of the source unit.
config.value*requirednumberThe value to be converted.

Returns

Success

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

NameType
config.unitId*requiredstring

Returns

Success

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

NameTypeDescription
config.entitySelector*requiredstring

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

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

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

Success

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

NameTypeDescription
config.entitySelectorstring

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

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

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

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

The amount of entities.

If not set, 50 is used.

config.sortstring

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

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

Success

Code example

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

const data = await monitoredEntitiesClient.getEntities();

getEntity

monitoredEntitiesClient.getEntity(config): Promise<Entity>

Gets the properties of the specified monitored entity

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

Parameters

NameTypeDescription
config.entityId*requiredstringThe ID of the required entity.
config.fieldsstring

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

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

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

Success

Code example

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

const data = await monitoredEntitiesClient.getEntity({
entityId: "...",
});

getEntityType

monitoredEntitiesClient.getEntityType(config): Promise<EntityType>

Gets a list of properties for the specified entity type

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

Parameters

NameTypeDescription
config.type*requiredstringThe required entity type.

Returns

Success

Code example

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

const data = await monitoredEntitiesClient.getEntityType({
type: "...",
});

getEntityTypes

monitoredEntitiesClient.getEntityTypes(config): Promise<EntityTypeList>

Gets a list of properties for all entity types

Required scope: environment-api:entities: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

NameTypeDescription
config.nextPageKeystring

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

The amount of entity types in a single response payload.

The maximal allowed page size is 500.

If not set, 50 is used.

Returns

Success

Code example

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

const data = await monitoredEntitiesClient.getEntityTypes();

pushCustomDevice

monitoredEntitiesClient.pushCustomDevice(config): Promise<void | CustomDeviceCreationResult>

Creates or updates a custom device

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

Parameters

NameTypeDescription
config.body*requiredCustomDeviceCreation
config.uiBasedbooleanIf true, it will be handled as if it was created via UI. It will be refreshed automatically and won't age out.

Returns

Success

Code example

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

const data = await monitoredEntitiesClient.pushCustomDevice(
{ body: { customDeviceId: "...", displayName: "..." } },
);

setSecurityContext

monitoredEntitiesClient.setSecurityContext(config): Promise<SecurityContextResultDto>

Sets the given 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

Matching entities will have a management zone assigned, if the given security context matches the name of an already existing management zone. This endpoint does not create a new management zone, if there is no management zone with the provided name. Automatic management zone rules will not apply to entities with a set security context. It will need to be removed, to have them apply again.

Parameters

NameTypeDescription
config.body*requiredSecurityContextDtoImpl
config.entitySelector*requiredstring

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

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

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

Success

Code example

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

const data =
await monitoredEntitiesClient.setSecurityContext({
entitySelector: "...",
body: {},
});

monitoredEntitiesCustomTagsClient

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

deleteTags

monitoredEntitiesCustomTagsClient.deleteTags(config): Promise<DeletedEntityTags>

Deletes the specified tag from the specified entities

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

Parameters

NameTypeDescription
config.deleteAllWithKeyboolean
  • If true, all tags with the specified key are deleted, regardless of the value.
  • If false, only tags with exact match of key and value are deleted.

If not set, false is used.

config.entitySelector*requiredstring

Specifies the entities where you want to delete tags.

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

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 24 hours is used (now-24h).

config.key*requiredstring

The key of the tag to be deleted.

If deleteAllWithKey is true, then all tags with this key are deleted. Otherwise, only tags with exact match of key and value are deleted.

For value-only tags, specify the value here.

config.tostring

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.

config.valuestring

The value of the tag to be deleted. The value is ignored if deleteAllWithKey is true.

For value-only tags, specify the value in the key parameter.

Returns

Success

Code example

import { monitoredEntitiesCustomTagsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await monitoredEntitiesCustomTagsClient.deleteTags({
key: "...",
entitySelector: "...",
});

getTags

monitoredEntitiesCustomTagsClient.getTags(config): Promise<CustomEntityTags>

Gets a list of custom tags applied to the specified entities

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

Automatically applied tags and imported tags are not included.

Parameters

NameTypeDescription
config.entitySelector*requiredstring

Specifies the entities where you want to read tags.

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

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 24 hours is used (now-24h).

config.tostring

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

Success

Code example

import { monitoredEntitiesCustomTagsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await monitoredEntitiesCustomTagsClient.getTags({
entitySelector: "...",
});

postTags

monitoredEntitiesCustomTagsClient.postTags(config): Promise<AddedEntityTags>

Adds custom tags to the specified entities

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

All existing tags remain unaffected.

Parameters

NameTypeDescription
config.body*requiredAddEntityTags
config.entitySelector*requiredstring

Specifies the entities where you want to update tags.

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

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 24 hours is used (now-24h).

config.tostring

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

Success

Code example

import { monitoredEntitiesCustomTagsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await monitoredEntitiesCustomTagsClient.postTags({
entitySelector: "...",
body: { tags: [{ key: "..." }] },
});

monitoredEntitiesMonitoringStateClient

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

getStates

monitoredEntitiesMonitoringStateClient.getStates(config): Promise<MonitoredStates>

Lists monitoring states of entities

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

Only process group instances are supported.

Parameters

NameTypeDescription
config.entitySelectorstring

Specifies the process group instances where you're querying the state. Use the PROCESS_GROUP_INSTANCE entity type.

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

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

The amount of monitoring states in a single response payload.

The maximal allowed page size is 500.

If not set, 500 is used.

Returns

Success

Code example

import { monitoredEntitiesMonitoringStateClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await monitoredEntitiesMonitoringStateClient.getStates();

networkZonesClient

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

createOrUpdateNetworkZone

networkZonesClient.createOrUpdateNetworkZone(config): Promise<void | EntityShortRepresentation>

Updates an existing network zone or creates a new one

Required scope: environment-api:network-zones:write Required permission: environment:roles:manage-settings

If the network zone with the specified ID does not exist, a new network zone is created.

The ID is not case sensitive. Dynatrace stores the ID in lowercase.

Parameters

NameTypeDescription
config.body*requiredNetworkZone
config.id*requiredstring

The ID of the network zone to be updated.

If you set the ID in the body as well, it must match this ID.

The ID is not case sensitive. Dynatrace stores the ID in lowercase.

Returns

Success. The new network zone has been created. The response body contains the ID of the new network zone.

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await networkZonesClient.createOrUpdateNetworkZone({
id: "...",
body: {},
});

deleteNetworkZone

networkZonesClient.deleteNetworkZone(config): Promise<void>

Deletes the specified network zone

Required scope: environment-api:network-zones:write Required permission: environment:roles:manage-settings

You can only delete an empty network zone (a zone that no ActiveGate or OneAgent is using).

If the network zone is used as an alternative zone for any OneAgent, it will be automatically removed from the list of possible alternatives.

Parameters

NameTypeDescription
config.id*requiredstringThe ID of the network zone to be deleted.

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await networkZonesClient.deleteNetworkZone({
id: "...",
});

getAllNetworkZones

networkZonesClient.getAllNetworkZones(abortSignal?): Promise<NetworkZoneList>

Lists all existing network zones

Required scope: environment-api:network-zones:read Required permission: environment:roles:viewer

Returns

Success

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await networkZonesClient.getAllNetworkZones();

getHostStats

networkZonesClient.getHostStats(config): Promise<NetworkZoneConnectionStatistics>

Gets the statistics about hosts using the network zone

Required scope: environment-api:network-zones:read Required permission: environment:roles:manage-settings

Parameters

NameTypeDescription
config.filterGetHostStatsQueryFilter

Filters the resulting set of hosts:

  • all: All hosts using the zone.
  • configuredButNotConnectedOnly: Hosts from the network zone that use other zones.
  • connectedAsAlternativeOnly: Hosts that use the network zone as an alternative.
  • connectedAsFailoverOnly: Hosts from other zones that use the zone (not configured as an alternative) even though ActiveGates of higher priority are available.
  • connectedAsFailoverWithoutOwnActiveGatesOnly: Hosts from other zones that use the zone (not configured as an alternative) and no ActiveGates of higher priority are available.

If not set, all is used.

default: "all"
config.id*requiredstringThe ID of the required network zone.

Returns

Success

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await networkZonesClient.getHostStats({
id: "...",
});

getNetworkZoneSettings

networkZonesClient.getNetworkZoneSettings(abortSignal?): Promise<NetworkZoneSettings>

Gets the global configuration of network zones

Required scope: environment-api:network-zones:read Required permission: environment:roles:viewer

Returns

Success

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await networkZonesClient.getNetworkZoneSettings();

getSingleNetworkZone

networkZonesClient.getSingleNetworkZone(config): Promise<NetworkZone>

Gets parameters of the specified network zone

Required scope: environment-api:network-zones:read Required permission: environment:roles:viewer

Parameters

NameTypeDescription
config.id*requiredstringThe ID of the required network zone.

Returns

Success

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await networkZonesClient.getSingleNetworkZone({
id: "...",
});

updateNetworkZoneSettings

networkZonesClient.updateNetworkZoneSettings(config): Promise<void>

Updates the global configuration of network zones

Required scope: environment-api:network-zones:write Required permission: environment:roles:manage-settings

Parameters

NameType
config.body*requiredNetworkZoneSettings

Code example

import { networkZonesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await networkZonesClient.updateNetworkZoneSettings({
body: {},
});

problemsClient

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

closeProblem

problemsClient.closeProblem(config): Promise<void | ProblemCloseResult>

Closes the specified problem and adds a closing comment on it

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

Parameters

NameTypeDescription
config.body*requiredProblemCloseRequestDtoImpl
config.problemId*requiredstringThe ID of the required problem.

Returns

Success

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.closeProblem({
problemId: "...",
body: { message: "..." },
});

createComment

problemsClient.createComment(config): Promise<void>

Adds a new comment on the specified problem

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

Parameters

NameTypeDescription
config.body*requiredCommentRequestDtoImpl
config.problemId*requiredstringThe ID of the required problem.

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.createComment({
problemId: "...",
body: { message: "..." },
});

deleteComment

problemsClient.deleteComment(config): Promise<void>

Deletes the specified comment from a problem

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

Parameters

NameTypeDescription
config.commentId*requiredstringThe ID of the required comment.
config.problemId*requiredstringThe ID of the required problem.

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.deleteComment({
problemId: "...",
commentId: "...",
});

getComment

problemsClient.getComment(config): Promise<Comment>

Gets the specified comment on a problem

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

Parameters

NameTypeDescription
config.commentId*requiredstringThe ID of the required comment.
config.problemId*requiredstringThe ID of the required problem.

Returns

Success

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.getComment({
problemId: "...",
commentId: "...",
});

getComments

problemsClient.getComments(config): Promise<CommentsList>

Gets all comments on the specified problem

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

Parameters

NameTypeDescription
config.nextPageKeystring

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 except the optional fields parameter.

config.pageSizenumber

The amount of comments in a single response payload.

The maximal allowed page size is 500.

If not set, 10 is used.

config.problemId*requiredstringThe ID of the required problem.

Returns

Success

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.getComments({
problemId: "...",
});

getProblem

problemsClient.getProblem(config): Promise<Problem>

Gets the properties of the specified problem

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

Parameters

NameTypeDescription
config.fieldsstring

A list of additional problem 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):

  • evidenceDetails: The details of the root cause.
  • impactAnalysis: The impact analysis of the problem on other entities/users.
  • recentComments: A list of the most recent comments to the problem.

To add properties, specify them as a comma-separated list (for example, evidenceDetails,impactAnalysis).

config.problemId*requiredstringThe ID of the required problem.

Returns

Success

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.getProblem({
problemId: "...",
});

getProblems

problemsClient.getProblems(config): Promise<Problems>

Lists problems observed within the specified timeframe

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

Parameters

NameTypeDescription
config.entitySelectorstring

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 maximum number of entities that may be selected is limited to 10000.

config.fieldsstring

A list of additional problem 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):

  • evidenceDetails: The details of the root cause.
  • impactAnalysis: The impact analysis of the problem on other entities/users.
  • recentComments: A list of the most recent comments to the problem.

To add properties, specify them as a comma-separated list (for example, evidenceDetails,impactAnalysis).

The field is valid only for the current page of results. You must set it for each page you're requesting.

config.fromstring

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

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 except the optional fields parameter.

config.pageSizenumber

The amount of problems in a single response payload.

The maximal allowed page size is 500.

If not set, 50 is used.

config.problemSelectorstring

Defines the scope of the query. Only problems matching the specified criteria are included into 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. All values must be quoted.

  • Status: status("open") or status("closed"). You can specify only one status.
  • Severity level: severityLevel("level-1","level-2"). Find the possible values in the description of the severityLevel field of the response.
  • Impact level: impactLevel("level-11","level-2") Find the possible values in the description of the impactLevel field of the response.
  • Root cause entity: rootCauseEntity("id-1", "id-2").
  • Management zone ID: managementZoneIds("mZId-1", "mzId-2").
  • Management zone name: managementZones("value-1","value-2").
  • Impacted entities: impactedEntities("id-1", "id-2").
  • Affected entities: affectedEntities("id-1", "id-2").
  • Type of affected entities: affectedEntityTypes("value-1","value-2").
  • Problem ID: problemId("id-1", "id-2").
  • Alerting profile ID: problemFilterIds("id-1", "id-2").
  • Alerting profile name (contains, case-insensitive): problemFilterNames("value-1","value-2").
  • Alerting profile name (exact match, case-insensitive): problemFilterNames.equals("value-1","value-2").
  • Entity tags: entityTags("[context]key:value","key:value"). Tags in [context]key:value, key:value, and value formats are detected and parsed automatically. If a value-only tag has a colon (:) in it, you must escape the colon with a backslash(\). Otherwise, the tag will be parsed as a key:value tag. All tag values are case-sensitive.
  • Display ID of the problem: displayId(&quot;id-1&quot;, &quot;id-2&quot;).
  • Under maintenance: underMaintenance(true|false). Shows (true) or hides (false) all problems created during maintenance mode.
  • Text search: text(&quot;value&quot;). Text search on the following fields: problem title, event titles, displayId and the id of affected and impacted entities. The text search is case insensitive, partial matching and based on a relevance score. Therefore the relevance sort option should be used to get the most relevant problems first. The special characters \~ and &quot; need to be escaped using a \~ (e.g. double quote search text(&quot;\~&quot;&quot;)). The search value is limited to 30 characters.

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

config.sortstring

Specifies a set of comma-separated (,) fields for sorting in the problem list.

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

  • status: problem status (+ open problems first or - closed problems first)
  • startTime: problem start time (+ old problems first or - new problems first)
  • relevance: problem relevance (+ least relevant problems first or - most relevant problems first) - can be used only in combination with text search

If no prefix is set, + is used.

You can specify several levels of sorting. For example, +status,-startTime sorts problems by status, open problems first. Within the status, problems are sorted by start time, oldest first.

config.tostring

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

Success

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.getProblems();

updateComment

problemsClient.updateComment(config): Promise<void>

Updates the specified comment on a problem

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

Parameters

NameTypeDescription
config.body*requiredCommentRequestDtoImpl
config.commentId*requiredstringThe ID of the required comment.
config.problemId*requiredstringThe ID of the required problem.

Code example

import { problemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await problemsClient.updateComment({
problemId: "...",
commentId: "...",
body: { message: "..." },
});

releasesClient

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

getReleases

releasesClient.getReleases(config): Promise<Releases>

Returns all releases

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

Parameters

NameTypeDescription
config.demobooleanGet your Releases (false) or a set of demo Releases (true). default: false
config.fromstring

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

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

The amount of Releases in a single response payload.

The maximal allowed page size is 1000.

If not set, 100 is used.

config.releasesSelectorstring

Defines the scope of the query. Only Releases matching the provided criteria are included in the response.

You can add one or several of the criteria listed below.

  • Management zone: type(PROCESS_GROUP_INSTANCE),mzName("ManagementZone-A"). Filters for all releases in the given management zone. The filter is case-sensitive.
  • Monitoring state: monitoringState("Active") or monitoringState("Inactive"). You can specify only one monitoring state.
  • Health state: healthState("HEALTHY") or healthState("UNHEALTHY"). You can specify only one health state.
  • Security vulnerability: affectedBySecurityProblem("Detected") or affectedBySecurityProblem("Not detected"). You can specify only one security vulnerability state.
  • Name: entityName("name"). Filters for all releases that contain the given value in their name. The filter is case-insensitive.
  • Entity ID: entityId("id").
  • Product: releasesProduct("product"). Filters for all releases that contain the given value in their product. The filter is case-insensitive.
  • Stage: releasesStage("stage"). Filters for all releases that contain the given value in their stage. The filter is case-insensitive.
  • Version: releasesVersion("version"). Filters for all releases that contain the given value in their version. The filter is case-insensitive.

To set several criteria, separate them with comma (,). Only results matching all criteria are included in the response. e.g., .../api/v2/releases?releasesSelector=name("Server"),monitoringState("Active"),healthState("HEALTHY"),releasesVersion("1.0.7").

The special characters ~ and " need to be escaped using a ~ (e.g. double quote search entityName("~"").

default: ""
config.sortstring

Specifies the field that is used for sorting the releases list. The field has a sign prefix (+/-) which corresponds to the sorting order ('+' for ascending and '-' for descending). If no sign prefix is set, then the default ascending sorting order will be applied. You can sort by the following properties:

  • 'product': Product name
  • 'name': Release name
  • 'stage': Stage name
  • 'version': Version
  • 'instances': Instances
  • 'traffic': Traffic

If not set, the ascending order sorting for name is applied.

default: "name"
config.tostring

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

Success

Code example

import { releasesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await releasesClient.getReleases();

securityProblemsClient

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

bulkMuteRemediationItems

securityProblemsClient.bulkMuteRemediationItems(config): Promise<RemediationItemsBulkMuteResponse>

Mutes several remediation items

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredRemediationItemsBulkMute
config.id*requiredstringThe ID of the requested third-party security problem.

Returns

Success. The remediation item(s) have been muted.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.bulkMuteRemediationItems({
id: "...",
body: { remediationItemIds: ["..."] },
});

bulkMuteSecurityProblems

securityProblemsClient.bulkMuteSecurityProblems(config): Promise<SecurityProblemsBulkMuteResponse>

Mutes several security problems

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameType
config.body*requiredSecurityProblemsBulkMute

Returns

Success. The security problem(s) have been muted.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.bulkMuteSecurityProblems({
body: { securityProblemIds: ["..."] },
});

bulkUnmuteRemediationItems

securityProblemsClient.bulkUnmuteRemediationItems(config): Promise<RemediationItemsBulkUnmuteResponse>

Un-mutes several remediation items

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredRemediationItemsBulkUnmute
config.id*requiredstringThe ID of the requested third-party security problem.

Returns

Success. The remediation item(s) have been un-muted.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.bulkUnmuteRemediationItems({
id: "...",
body: { remediationItemIds: ["..."] },
});

bulkUnmuteSecurityProblems

securityProblemsClient.bulkUnmuteSecurityProblems(config): Promise<SecurityProblemsBulkUnmuteResponse>

Un-mutes several security problems

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameType
config.body*requiredSecurityProblemsBulkUnmute

Returns

Success. The security problem(s) have been un-muted.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.bulkUnmuteSecurityProblems({
body: { securityProblemIds: ["..."] },
});

getEventsForSecurityProblem

securityProblemsClient.getEventsForSecurityProblem(config): Promise<SecurityProblemEventsList>

Lists all events of a security problem

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.fromstring

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.id*requiredstringThe ID of the requested security problem.
config.tostring

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

Success. The response contains the list of security problem events.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getEventsForSecurityProblem({
id: "...",
});

getRemediationItem

securityProblemsClient.getRemediationItem(config): Promise<RemediationDetailsItem>

Gets parameters of a remediation item of a security problem

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.id*requiredstringThe ID of the requested third-party security problem.
config.remediationItemId*requiredstringThe ID of the remediation item.

Returns

Success. The response contains details of a single remediation item of a security problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getRemediationItem({
id: "...",
remediationItemId: "...",
});

getRemediationItems

securityProblemsClient.getRemediationItems(config): Promise<RemediationItemList>

Lists remediation items of a third-party security problem

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.id*requiredstringThe ID of the requested third-party security problem.
config.remediationItemSelectorstring

Defines the scope of the query. Only remediable entities 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.

  • Vulnerability state: vulnerabilityState("value"). Find the possible values in the description of the vulnerabilityState field of the response. If not set, all entities are returned.
  • Muted: muted("value"). Possible values are TRUE or FALSE.
  • Reachable data asset assessment: assessment.dataAssets("value") Possible values are REACHABLE, and NOT_DETECTED.
  • Network exposure assessment: assessment.exposure("value") Possible values are PUBLIC_NETWORK, and NOT_DETECTED.
  • Vulnerable function usage assessment: assessment.vulnerableFunctionUsage("value") Possible values are IN_USE, and NOT_IN_USE.
  • Vulnerable function restart required: assessment.vulnerableFunctionRestartRequired("value") Possible values are TRUE or FALSE.
  • Vulnerable function in use contains: assessment.vulnerableFunctionInUseContains("value"). Possible values are class::function, class:: and function. The CONTAINS operator is used. Only vulnerable functions in use are considered.
  • Assessment accuracy: assessment.accuracy("value") Possible values are FULL and REDUCED.
  • Entity name contains: entityNameContains("value-1"). The CONTAINS operator is used.
  • Tracking link display name: trackingLink.displayNameContains("value"). The CONTAINS 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 "

Returns

Success. The response contains the list of remediation items of a problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getRemediationItems({
id: "...",
});

getRemediationProgressEntities

securityProblemsClient.getRemediationProgressEntities(config): Promise<RemediationProgressEntityList>

Lists remediation progress entities

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.id*requiredstringThe ID of the requested third-party security problem.
config.remediationItemId*requiredstringThe ID of the remediation item.
config.remediationProgressEntitySelectorstring

Defines the scope of the query. Only remediation progress entities 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"). Possible values the state field are AFFECTED and UNAFFECTED. If not set, all entities are returned.
  • Vulnerable function usage assessment: assessment.vulnerableFunctionUsage("value") Possible values are IN_USE, and NOT_IN_USE.
  • Vulnerable function restart required: assessment.vulnerableFunctionRestartRequired("value") Possible values are TRUE or FALSE.
  • Vulnerable function in use contains: assessment.vulnerableFunctionInUseContains("value"). Possible values are class::function, class:: and function. The CONTAINS operator is used. Only vulnerable functions in use are considered.
  • Entity name contains: entityNameContains("value-1"). The CONTAINS 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 "

Returns

Success. The response contains a list of remediation progress entities of a remediation item of a security problem. The number of entities returned is limited.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getRemediationProgressEntities(
{ id: "...", remediationItemId: "..." },
);

getSecurityProblem

securityProblemsClient.getSecurityProblem(config): Promise<SecurityProblemDetails>

Gets parameters of a security problem

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.fieldsstring

A list of additional security problem 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):

  • riskAssessment: A risk assessment of the security problem.
  • managementZones: The management zone where the security problem occurred.
  • codeLevelVulnerabilityDetails: Details of the code-level vulnerability.
  • globalCounts: Globally calculated statistics about the security problem. No management zone information is taken into account.
  • filteredCounts: Statistics about the security problem, filtered by the management zone and timeframe start ('from') query parameters.
  • description: The description of the vulnerability.
  • events: The security problem's last 10 events within the last 365 days, sorted from newest to oldest.
  • vulnerableComponents: A list of vulnerable components of the security problem within the provided filter range.
  • affectedEntities: A list of affected entities of the security problem within the provided filter range.
  • exposedEntities: A list of exposed entities of the security problem within the provided filter range.
  • reachableDataAssets: A list of data assets reachable by affected entities of the security problem within the provided filter range.
  • relatedEntities: A list of related entities of the security problem within the provided filter range.
  • relatedContainerImages: A list of related container images of the security problem within the provided filter range.
  • relatedAttacks: A list of attacks detected on the exposed security problem.
  • entryPoints: A list of entry points and a flag which indicates whether this list was truncated or not.

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

config.fromstring

Based on the timeframe start the affected-, related- and vulnerable entities are being calculated. 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 default timeframe start of 24 hours in the past is used (now-24h).

The timeframe start must not be older than 365 days.

config.id*requiredstringThe ID of the requested security problem.

Returns

Success. The response contains parameters of the security problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getSecurityProblem({
id: "...",
});

getSecurityProblems

securityProblemsClient.getSecurityProblems(config): Promise<SecurityProblemList>

Lists all 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

Parameters

NameTypeDescription
config.fieldsstring

A list of additional security problem 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):

  • riskAssessment: A risk assessment of the security problem.
  • managementZones: The management zone where the security problem occurred.
  • codeLevelVulnerabilityDetails: Details of the code-level vulnerability.
  • globalCounts: Globally calculated statistics about the security problem. No management zone information is taken into account.

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

config.fromstring

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

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

The amount of security problems in a single response payload.

The maximal allowed page size is 500.

If not set, 100 is used.

config.securityProblemSelectorstring

Defines the scope of the query. Only security problems 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.

  • Status: status("value"). Find the possible values in the description of the status field of the response. If not set, all security problems are returned.
  • Muted: muted("value"). Possible values are TRUE or FALSE.
  • Risk level: riskLevel("value"). The Davis risk level. Find the possible values in the description of the riskLevel field of the response.
  • Minimum risk score: minRiskScore("5.5"). The Davis minimum risk score. The GREATER THAN OR EQUAL TO operator is used. Specify a number between 1.0 and 10.0.
  • Maximum risk score: maxRiskScore("5.5"). The Davis maximum risk score. The LESS THAN operator is used. Specify a number between 1.0 and 10.0.
  • Base risk level: baseRiskLevel("value"). The Base risk level from the CVSS. Find the possible values in the description of the riskLevel field of the response.
  • Minimum base risk score: minBaseRiskScore("5.5"). The minimum base risk score from the CVSS. The GREATER THAN OR EQUAL TO operator is used. Specify a number between 1.0 and 10.0.
  • Maximum base risk score: maxBaseRiskScore("5.5"). The maximum base risk score from the CVSS. The LESS THAN operator is used. Specify a number between 1.0 and 10.0.
  • External vulnerability ID contains: externalVulnerabilityIdContains("id-1"). The CONTAINS operator is used. Maximum value length is 48 characters.
  • External vulnerability ID: externalVulnerabilityId("id-1", "id-2").
  • CVE ID: cveId("id").
  • Risk assessment riskAssessment("value-1", "value-2") Possible values are EXPOSED, SENSITIVE, EXPLOIT, VULNERABLE_FUNCTION_IN_USE and ACCURACY_REDUCED.
  • Related host ID: relatedHostIds("value-1", "value-2"). Specify Dynatrace entity IDs here.
  • Related host name: relatedHostNames("value-1", "value-2"). Values are case-sensitive.
  • Related host name contains: relatedHostNameContains("value-1"). The CONTAINS operator is used.
  • Related Kubernetes cluster ID: relatedKubernetesClusterIds("value-1", "value-2"). Specify Dynatrace entity IDs here.
  • Related Kubernetes cluster name: relatedKubernetesClusterNames("value-1", "value-2"). Values are case-sensitive.
  • Related Kubernetes cluster name contains: relatedKubernetesClusterNameContains("value-1"). The CONTAINS operator is used.
  • Related Kubernetes workload ID: relatedKubernetesWorkloadIds("value-1", "value-2"). Specify Dynatrace entity IDs here.
  • Related Kubernetes workload name: relatedKubernetesWorkloadNames("value-1", "value-2"). Values are case-sensitive.
  • Related Kubernetes workload name contains: relatedKubernetesWorkloadNameContains("value-1"). The CONTAINS operator is used.
  • Management zone ID: managementZoneIds("mzId-1", "mzId-2").
  • Management zone name: managementZones("name-1", "name-2"). Values are case-sensitive.
  • Affected process group instance ID: affectedPgiIds("pgiId-1", "pgiId-2"). Specify Dynatrace entity IDs here.
  • Affected process group ID: affectedPgIds("pgId-1", "pgId-2"). Specify Dynatrace entity IDs here.
  • Affected process group name: affectedPgNames("name-1", "name-2"). Values are case-sensitive.
  • Affected process group name contains: affectedPgNameContains("name-1"). The CONTAINS operator is used.
  • Vulnerable component ID: vulnerableComponentIds("componentId-1", "componentId-2"). Specify component IDs here.
  • Vulnerable component name: vulnerableComponentNames("name-1", "name-2"). Values are case-sensitive.
  • Vulnerable component name contains: vulnerableComponentNameContains("name-1"). The CONTAINS operator is used.
  • Host tags: hostTags("hostTag-1"). The CONTAINS operator is used. Maximum value length is 48 characters.
  • Process group tags: pgTags("pgTag-1"). The CONTAINS operator is used. Maximum value length is 48 characters.
  • Process group instance tags: pgiTags("pgiTag-1"). The CONTAINS operator is used. Maximum value length is 48 characters.
  • Tags: tags("tag-1"). The CONTAINS operator is used. This selector picks hosts, process groups, and process group instances at the same time. Maximum value length is 48 characters.
  • Display ID: displayIds("S-1234", "S-5678"). The EQUALS operator is used.
  • Security problem ID: securityProblemIds("12544152654387159360", "5904857564184044850"). The EQUALS operator is used.
  • 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.
  • Vulnerability type: vulnerabilityType("type-1", "type-2"). Possible values are THIRD_PARTY, CODE_LEVEL, RUNTIME.

Risk score and risk category are mutually exclusive (cannot be used at the same time).

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

Specifies one or more fields for sorting the security problem list. Multiple fields can be concatenated using a comma (,) as a separator (e.g. +status,-timestamp).

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

  • status: The security problem status (+ open first or - resolved first)
  • muted: The security problem mute state (+ unmuted first or - muted first)
  • technology: The security problem technology
  • firstSeenTimestamp: The timestamp of the first occurrence of the security problem (+ new problems first or - old problems first)
  • lastUpdatedTimestamp: The timestamp of the last update of the security problem (+ recently updated problems first or - earlier updated problems first)
  • securityProblemId: The auto-generated ID of the security problem (+ lower number first or - higher number first)
  • externalVulnerabilityId: The ID of the external vulnerability (+ lower number first or - higher number first)
  • displayId: The display ID (+ lower number first or - higher number first)
  • riskAssessment.riskScore: Davis Security Score (+ lower score first or - higher score first)
  • riskAssessment.riskLevel: Davis Security Score level (+ lower level first or - higher level first)
  • riskAssessment.exposure: Whether the problem is exposed to the internet
  • riskAssessment.baseRiskScore: The CVSS score (+ lower score first or - higher score first)
  • riskAssessment.baseRiskLevel: The CVSS level (+ lower level first or - higher level first)
  • riskAssessment.dataAssets: Whether data assets are affected
  • riskAssessment.vulnerableFunctionUsage: Whether vulnerable functions are used
  • riskAssessment.assessmentAccuracy: The assessments accuracy (+ less accuracy first or - more accuracy first)
  • globalCounts.affectedNodes: Number of affected nodes (+ lower number first or - higher number first)
  • globalCounts.affectedProcessGroupInstances: Number of affected process group instances (+ lower number first or - higher number first)
  • globalCounts.affectedProcessGroups: Number of affected process groups (+ lower number first or - higher number first)
  • globalCounts.exposedProcessGroups: Number of exposed process groups (+ lower number first or - higher number first)
  • globalCounts.reachableDataAssets: Number of reachable data assets (+ lower number first or - higher number first)
  • globalCounts.relatedApplications: Number of related applications (+ lower number first or - higher number first)
  • globalCounts.relatedAttacks: Number of attacks on the security problem (+ lower number first or - higher number first)
  • globalCounts.relatedHosts: Number of related hosts (+ lower number first or - higher number first)
  • globalCounts.relatedKubernetesClusters: Number of related Kubernetes cluster (+ lower number first or - higher number first)
  • globalCounts.relatedKubernetesWorkloads: Number of related Kubernetes workloads (+ lower number first or - higher number first)
  • globalCounts.relatedServices: Number of related services (+ lower number first or - higher number first)
  • globalCounts.vulnerableComponents: Number of vulnerable components (+ lower number first or - higher number first)

If no prefix is set, + is used.

config.tostring

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.

The end of the timeframe must not be older than 365 days.

Returns

Success. The response contains the list of security problems.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getSecurityProblems();

getVulnerableFunctions

securityProblemsClient.getVulnerableFunctions(config): Promise<VulnerableFunctionsContainer>

Lists all vulnerable functions and their usage for a third-party security problem

Required scope: environment-api:security-problems:read One of the following permissions is required:

  • environment:roles:manage-security-problems
  • environment:roles:view-security-problems

Parameters

NameTypeDescription
config.groupBystring

Defines additional grouping types in which vulnerable functions should be displayed.

You can add one of the following grouping types.

  • Process group: PROCESS_GROUP
config.id*requiredstringThe ID of the requested third-party security problem.
config.vulnerableFunctionsSelectorstring

Defines the scope of the query. Only vulnerable functions matching the specified criteria are included in the response.

You can add the following criteria. Values are not case sensitive and the EQUALS operator is used unless otherwise specified.

  • Management zone ID: managementZoneIds("mzId-1", "mzId-2").
  • Management zone name: managementZones("name-1", "name-2"). Values are case sensitive.
  • Process group ID: processGroupIds("pgId-1", "pgId-2"). Specify Dynatrace entity IDs here.
  • Process group name: processGroupNames("name-1", "name-2"). Values are case sensitive.
  • Process group name contains: processGroupNameContains("name-1"). The CONTAINS operator is used.

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

  • Tilde ~
  • Quote "

Returns

Success. The response contains the list of vulnerable functions.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.getVulnerableFunctions({
id: "...",
});

muteSecurityProblem

securityProblemsClient.muteSecurityProblem(config): Promise<void>

Mutes a security problem

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredSecurityProblemMute
config.id*requiredstringThe ID of the requested security problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.muteSecurityProblem({
id: "...",
body: {},
});

setRemediationItemMuteState

securityProblemsClient.setRemediationItemMuteState(config): Promise<void>

Sets the mute state of a remediation item

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredRemediationItemMuteStateChange
config.id*requiredstringThe ID of the requested third-party security problem.
config.remediationItemId*requiredstringThe ID of the remediation item.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.setRemediationItemMuteState({
id: "...",
remediationItemId: "...",
body: { comment: "...", muted: false },
});

trackingLinkBulkUpdateAndDelete

securityProblemsClient.trackingLinkBulkUpdateAndDelete(config): Promise<void>

Updates the external tracking links of the remediation items. | maturity=EARLY_ADOPTER

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredRemediationItemsBulkUpdateDeleteDto
config.id*requiredstringThe ID of the requested third-party security problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.trackingLinkBulkUpdateAndDelete(
{ id: "...", body: {} },
);

unmuteSecurityProblem

securityProblemsClient.unmuteSecurityProblem(config): Promise<void>

Un-mutes a security problem

Required scope: environment-api:security-problems:write Required permission: environment:roles:manage-security-problems

Parameters

NameTypeDescription
config.body*requiredSecurityProblemUnmute
config.id*requiredstringThe ID of the requested security problem.

Code example

import { securityProblemsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await securityProblemsClient.unmuteSecurityProblem({
id: "...",
body: {},
});

serviceLevelObjectivesClient

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

createAlert

serviceLevelObjectivesClient.createAlert(config): Promise<EntityShortRepresentation>

Creates an alert of the provided alert type for an SLO

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

  • environment:roles:manage-settings
  • settings:objects:write

Parameters

NameTypeDescription
config.body*requiredAbstractSloAlertDto
config.fromstring

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.id*requiredstringThe ID of the required SLO.
config.timeFrameCreateAlertQueryTimeFrame

The timeframe to calculate the SLO values:

  • CURRENT: SLO's own timeframe.
  • GTF: timeframe specified by from and to parameters.

If not set, the CURRENT value is used.

default: "CURRENT"
config.tostring

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

Success. The new alert has been created. The response contains the parameters of the new alert. The location response header contains the ID of the new alert.

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await serviceLevelObjectivesClient.createAlert(
{
id: "...",
body: { alertName: "...", alertThreshold: 10 },
},
);

createSlo

serviceLevelObjectivesClient.createSlo(config): Promise<void>

Creates a new SLO

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

  • environment:roles:manage-settings
  • settings:objects:write

Parameters

NameType
config.body*requiredSloConfigItemDtoImpl

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await serviceLevelObjectivesClient.createSlo({
body: {
name: "Payment service availability",
target: 95,
timeframe: "-1d",
warning: 97.5,
},
});

deleteSlo

serviceLevelObjectivesClient.deleteSlo(config): Promise<void>

Deletes an SLO

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

  • environment:roles:manage-settings
  • settings:objects:write

Parameters

NameType
config.id*requiredstring

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await serviceLevelObjectivesClient.deleteSlo({
id: "...",
});

getSlo

serviceLevelObjectivesClient.getSlo(config): Promise<SLOs>

Lists all available SLOs along with calculated values

Required scope: environment-api:slo:read One of the following permissions is required:

  • environment:roles:viewer
  • settings:objects:read

By default the values are calculated for the SLO's own timeframe. You can use a custom timeframe:

  1. Set the timeFrame parameter to GTF.
  2. Provide the timeframe in from and to parameters.

Parameters

NameTypeDescription
config.demobooleanGet your SLOs (false) or a set of demo SLOs (true). default: false
config.enabledSlosGetSloQueryEnabledSlosGet your enabled SLOs (true), disabled ones (false) or both enabled and disabled ones (all). default: "true"
config.evaluateGetSloQueryEvaluateGet your SLOs without them being evaluated (false) or with evaluations (true) with maximum pageSize of 25. default: "false"
config.fromstring

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

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

The amount of SLOs in a single response payload.

The maximal allowed page size is 10000.

If not set, 10 is used.

config.showGlobalSlosbooleanGet your global SLOs (true) regardless of the selected filter or filter them out (false). default: true
config.sloSelectorstring

The scope of the query. Only SLOs matching the provided criteria are included in the response.

You can add one or several of the criteria listed below.

  • SLO ID: id("id-1","id-2").
  • Name: name("name"). Filters for an SLO with the given name. The filter is case-sensitive.
  • Health state: healthState("HEALTHY") or healthState("UNHEALTHY"). Filters for SLOs that have no related open problems (HEALTHY) or SLOs that have related open problems (UNHEALTHY). You can specify only one health state.
  • Text: text("value"). Filters for all SLOs that contain the given value in their name or description. The filter is case-insensitive.
  • Problem: problemDisplayName("value"). Filters for all SLOs that are related to a given problem display name (e.g. P-12345).
  • Management zone name: managementZone("MZ-A"). Filters for all SLOs that are related to the given management zone name. Returned SLOs are evaluated against the given management zone.
  • Management zone ID: managementZoneID("123"). Filters for all SLOs that are related to the given management zone ID. Returned SLOs are evaluated against the given management zone.

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

  • .../api/v2/slo?sloSelector=name("Service Availability")
  • .../api/v2/slo?sloSelector=id("id")
  • .../api/v2/slo?sloSelector=text("Description"),healthState("HEALTHY").

The special characters ~ and " need to be escaped using a ~ (e.g. double quote search text("~"")).

default: ""
config.sortstring

The sorting of SLO entries:

  • name: Names in ascending order.
  • -name: Names in descending order.

If not set, the ascending order is used.

default: "name"
config.timeFrameGetSloQueryTimeFrame

The timeframe to calculate the SLO values:

  • CURRENT: SLO's own timeframe.
  • GTF: timeframe specified by from and to parameters.

If not set, the CURRENT value is used.

default: "CURRENT"
config.tostring

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

Success. The response contains the parameters and calculated values of the requested SLO.

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await serviceLevelObjectivesClient.getSlo();

getSloById

serviceLevelObjectivesClient.getSloById(config): Promise<SLO>

Gets parameters and calculated values of a specific SLO

Required scope: environment-api:slo:read One of the following permissions is required:

  • environment:roles:viewer
  • settings:objects:read

If from and to parameters are provided, the SLO is calculated for that timeframe; otherwise the SLO's own timeframe is used.

Parameters

NameTypeDescription
config.fromstring

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.id*requiredstringThe ID of the required SLO.
config.timeFrameGetSloByIdQueryTimeFrame

The timeframe to calculate the SLO values:

  • CURRENT: SLO's own timeframe.
  • GTF: timeframe specified by from and to parameters.

If not set, the CURRENT value is used.

default: "CURRENT"
config.tostring

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

Success. The response contains the parameters and calculated values of the requested SLO.

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await serviceLevelObjectivesClient.getSloById({
id: "...",
});

updateSloById

serviceLevelObjectivesClient.updateSloById(config): Promise<void>

Updates an existing SLO

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

  • environment:roles:manage-settings
  • settings:objects:write

Parameters

NameTypeDescription
config.body*requiredSloConfigItemDtoImpl
config.id*requiredstringThe ID of the required SLO.

Code example

import { serviceLevelObjectivesClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await serviceLevelObjectivesClient.updateSloById({
id: "...",
body: {
name: "Payment service availability",
target: 95,
timeframe: "-1d",
warning: 97.5,
},
});

settingsObjectsClient

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

deleteSettingsObjectByObjectId

settingsObjectsClient.deleteSettingsObjectByObjectId(config): Promise<void>

Deletes the specified settings object

Required scope: settings:objects:write One of the following permissions is required:

  • environment:roles:manage-settings
  • settings:objects:write

Parameters

NameTypeDescription
config.objectId*requiredstringThe ID of the required settings object.
config.updateTokenstring

The update token of the object. You can use it to detect simultaneous modifications by different users.

It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update.

If omitted on update/deletion, the operation overrides the current value or deletes it without any checks.

Code example

import { settingsObjectsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
await settingsObjectsClient.deleteSettingsObjectByObjectId(
{ objectId: "..." },
);

getEffectiveSettingsValues

settingsObjectsClient.getEffectiveSettingsValues(config): Promise<EffectiveSettingsValuesList>

Lists effective settings values

Required scope: settings:objects:read One of the following permissions is required:

  • envir