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

中文文档
11.0.0发布于 2026/10/30Apache-2.0TypeScriptESM + CJS近 30 天下载 1.6万

Client for the Dynatrace Environment API v2

原始使用文档
文档目录42 节
  1. Installation
  2. Getting help
  3. License
  4. accessTokensActiveGateTokensClient
  5. createToken
  6. getToken
  7. listTokens
  8. revokeToken
  9. accessTokensAgentTokensClient
  10. getAgentConnectionToken
  11. accessTokensApiTokensClient
  12. createApiToken
  13. deleteApiToken
  14. getApiToken
  15. listApiTokens
  16. lookupApiToken
  17. updateApiToken
  18. accessTokensTenantTokensClient
  19. cancelRotation
  20. finishRotation
  21. getRotationStatus
  22. startRotation
  23. activeGatesActiveGateGroupsClient
  24. getActiveGateGroups
  25. activeGatesActiveGateTokensEnforcementClient
  26. getTokenEnforcement
  27. activeGatesAutoUpdateConfigurationClient
  28. getAutoUpdateConfigById
  29. getGlobalAutoUpdateConfigForTenant
  30. putAutoUpdateConfigById
  31. putGlobalAutoUpdateConfigForTenant
  32. validateAutoUpdateConfigById
  33. validateGlobalAutoUpdateConfigForTenant
  34. activeGatesAutoUpdateJobsClient
  35. createUpdateJobForAg
  36. deleteUpdateJobByJobIdForAg
  37. getAllUpdateJobList
  38. getUpdateJobByJobIdForAg
  39. getUpdateJobListByAgId
  40. validateUpdateJobForAg
  41. activeGatesClient
  42. getAllActiveGates

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

npm License

Documentation of the Dynatrace Environment API v2. Resources here generally supersede those in v1. Migration of resources from v1 is in progress.

If you miss a resource, consider using the Dynatrace Environment API v1.

To read about use cases and examples, see Dynatrace Documentation.

Notes about compatibility:

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

Installation

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

Getting help

License

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

API reference

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

accessTokensActiveGateTokensClient

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

createToken

accessTokensActiveGateTokensClient.createToken(config): Promise<ActiveGateTokenCreated>

Creates a new ActiveGate token

One of the following scopes is required:

  • environment-api:activegate-tokens:create
  • environment-api:activegate-tokens:write
  • fleet-management:activegate.tokens:create
  • fleet-management:activegate.tokens:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegate.tokens:write

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

Return typeStatus codeDescription
ActiveGateTokenCreated201Success. The token has been created. The body of the response contains the token secret.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensActiveGateTokensClient.createToken({
    body: {
      activeGateType: "ENVIRONMENT",
      name: "myToken",
    },
  });

getToken

accessTokensActiveGateTokensClient.getToken(config): Promise<ActiveGateToken>

Gets metadata of an ActiveGate token

One of the following scopes is required:

  • environment-api:activegate-tokens:read
  • fleet-management:activegate.tokens:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegate.tokens:read

The token secret is not exposed.

Parameters

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

Returns

Return typeStatus codeDescription
ActiveGateToken200Success. The response contains the metadata of the tokens.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

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

listTokens

accessTokensActiveGateTokensClient.listTokens(config): Promise<ActiveGateTokenList>

Lists all available ActiveGate tokens

One of the following scopes is required:

  • environment-api:activegate-tokens:read
  • fleet-management:activegate.tokens:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegate.tokens:read

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

Return typeStatus codeDescription
ActiveGateTokenList200Success. The response contains the list of ActiveGate tokens.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensActiveGateTokensClient.listTokens();

revokeToken

accessTokensActiveGateTokensClient.revokeToken(config): Promise<void>

Deletes an ActiveGate token

One of the following scopes is required:

  • environment-api:activegate-tokens:write
  • fleet-management:activegate.tokens:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegate.tokens:write

Parameters

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

Returns

Return typeStatus codeDescription
void204Success. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.
Code example
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

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

accessTokensAgentTokensClient

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

getAgentConnectionToken

accessTokensAgentTokensClient.getAgentConnectionToken(config): Promise<AgentConnectionToken>

Gets the agent connection token | maturity=EARLY_ADOPTER

One of the following scopes is required:

  • environment-api:agent-connection-tokens:read
  • fleet-management:oneagent.tokens:read

One of the following permissions is required:

  • environment:roles:agent-install
  • fleet-management:oneagent.tokens:read

Returns the agent connection token.

Returns

Return typeStatus codeDescription
AgentConnectionToken200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.
Code example
import { accessTokensAgentTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensAgentTokensClient.getAgentConnectionToken();

accessTokensApiTokensClient

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

createApiToken

⚠️ Deprecated

accessTokensApiTokensClient.createApiToken(config): Promise<ApiTokenCreated>

Creates a new API token

One of the following scopes is required:

  • environment-api:api-tokens:write
  • api-tokens:tokens:write

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:write

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

Return typeStatus codeDescription
ApiTokenCreated201Success. The token has been created. The body of the response contains the token secret.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensApiTokensClient.createApiToken({
    body: { name: "tokenName", scopes: ["metrics.read"] },
  });

deleteApiToken

⚠️ Deprecated

accessTokensApiTokensClient.deleteApiToken(config): Promise<void>

Deletes an API token

One of the following scopes is required:

  • environment-api:api-tokens:write
  • api-tokens:tokens:write

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:write

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.

Returns

Return typeStatus codeDescription
void204Success. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. You can't delete the token you're using for authentication of the request. | Client side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensApiTokensClient.deleteApiToken({
    id: "...",
  });

getApiToken

⚠️ Deprecated

accessTokensApiTokensClient.getApiToken(config): Promise<ApiToken>

Gets API token metadata by token ID

One of the following scopes is required:

  • environment-api:api-tokens:read
  • api-tokens:tokens:read

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:read

The token secret is not exposed.

Parameters

NameType
config.id*requiredstring

Returns

Return typeStatus codeDescription
ApiToken200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data = await accessTokensApiTokensClient.getApiToken({
  id: "...",
});

listApiTokens

⚠️ Deprecated

accessTokensApiTokensClient.listApiTokens(config): Promise<ApiTokenList>

Lists all available API tokens

One of the following scopes is required:

  • environment-api:api-tokens:read
  • api-tokens:tokens:read

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:read

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

Return typeStatus codeDescription
ApiTokenList200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensApiTokensClient.listApiTokens();

lookupApiToken

⚠️ Deprecated

accessTokensApiTokensClient.lookupApiToken(config): Promise<ApiToken>

Gets API token metadata by token secret

One of the following scopes is required:

  • environment-api:api-tokens:read
  • api-tokens:tokens:read

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:read

Parameters

NameType
config.body*requiredApiTokenSecret

Returns

Return typeStatus codeDescription
ApiToken200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorClient side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensApiTokensClient.lookupApiToken({
    body: {
      token:
        "dt0c01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM",
    },
  });

updateApiToken

⚠️ Deprecated

accessTokensApiTokensClient.updateApiToken(config): Promise<void>

Updates an API token

One of the following scopes is required:

  • environment-api:api-tokens:write
  • api-tokens:tokens:write

One of the following permissions is required:

  • environment:roles:viewer
  • api-tokens:tokens:write

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.

Returns

Return typeStatus codeDescription
void204Success. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensApiTokensClient.updateApiToken({
    id: "...",
    body: {},
  });

accessTokensTenantTokensClient

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

cancelRotation

accessTokensTenantTokensClient.cancelRotation(config): Promise<TenantTokenConfig>

Cancels tenant token rotation

One of the following scopes is required:

  • environment-api:tenant-token-rotation:write
  • fleet-management:tenant-token:rotate

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:tenant-token:rotate

To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.

Returns

Return typeStatus codeDescription
TenantTokenConfig200Success. Rotation process has been cancelled. The current tenant token remains valid.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. There is no ongoing rotation process. | Client side error. | Server side error.
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensTenantTokensClient.cancelRotation();

finishRotation

accessTokensTenantTokensClient.finishRotation(config): Promise<TenantTokenConfig>

Finishes tenant token rotation

One of the following scopes is required:

  • environment-api:tenant-token-rotation:write
  • fleet-management:tenant-token:rotate

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:tenant-token:rotate

To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.

Returns

Return typeStatus codeDescription
TenantTokenConfig200Success. The rotation process is completed. The active field of the response contains the new tenant token.

Throws

Error TypeError Message
ErrorEnvelopeErrorNo ongoing rotation process. | Client side error. | Server side error.
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensTenantTokensClient.finishRotation();

getRotationStatus

accessTokensTenantTokensClient.getRotationStatus(config): Promise<TenantTokenRotationStatus>

Gets tenant token rotation status

One of the following scopes is required:

  • environment-api:tenant-token-rotation:write
  • fleet-management:tenant-token:rotate

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:tenant-token:rotate

To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.

Returns

Return typeStatus codeDescription
TenantTokenRotationStatus200Success. Returns rotation status.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. Tenant token configuration is unavailable. | Client side error. | Server side error.
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensTenantTokensClient.getRotationStatus();

startRotation

accessTokensTenantTokensClient.startRotation(config): Promise<TenantTokenConfig>

Starts tenant token rotation

One of the following scopes is required:

  • environment-api:tenant-token-rotation:write
  • fleet-management:tenant-token:rotate

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:tenant-token:rotate

To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.

Returns

Return typeStatus codeDescription
TenantTokenConfig200Success. The new tenant token is created and will replace the old one. The active field of the response contains the new tenant token.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. Another rotation process is already in progress. | Client side error. | Server side error.
Code example
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await accessTokensTenantTokensClient.startRotation();

activeGatesActiveGateGroupsClient

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

getActiveGateGroups

⚠️ Deprecated

activeGatesActiveGateGroupsClient.getActiveGateGroups(config): Promise<ActiveGateGroups>

Lists ActiveGate groups

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

Deprecated since version 1.343. Use DQL Smartscape nodes to query ActiveGate data instead. See https://dt-url.net/mf03894

Returns

Return typeStatus codeDescription
ActiveGateGroups200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorClient side error. | Server side error.
Code example
import { activeGatesActiveGateGroupsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesActiveGateGroupsClient.getActiveGateGroups();

activeGatesActiveGateTokensEnforcementClient

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

getTokenEnforcement

activeGatesActiveGateTokensEnforcementClient.getTokenEnforcement(config): Promise<ActiveGateTokenEnforcement>

Gets the status of ActiveGate tokens enforcement

Required scope: fleet-management:activegates:read One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

Returns

Return typeStatus codeDescription
ActiveGateTokenEnforcement200Success. The response contains the status of ActiveGate tokens enforcement

Throws

Error TypeError Message
ErrorEnvelopeErrorClient side error. | Server side error.
Code example
import { activeGatesActiveGateTokensEnforcementClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesActiveGateTokensEnforcementClient.getTokenEnforcement();

activeGatesAutoUpdateConfigurationClient

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

getAutoUpdateConfigById

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.getAutoUpdateConfigById(config): Promise<ActiveGateAutoUpdateConfig>

Gets the configuration of auto-update for the specified ActiveGate

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

Gets the configuration of auto-update for the specified ActiveGate

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint GET /api/v2/settings/objects with schemaId builtin:deployment.activegate.updates and scopes=ENVIRONMENT_ACTIVE_GATE-{ActiveGate ID} to retrieve the auto-update setting of a specific ActiveGate.

Parameters

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

Returns

Return typeStatus codeDescription
ActiveGateAutoUpdateConfig200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorNot found. See response body for details. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

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

getGlobalAutoUpdateConfigForTenant

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant(config): Promise<ActiveGateGlobalAutoUpdateConfig>

Gets the global auto-update configuration of environment ActiveGates.

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

Gets the global auto-update configuration of environment ActiveGates.

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint GET /api/v2/settings/objects with schemaId builtin:deployment.activegate.updates and scopes=tenant to retrieve the global auto-update setting of environment ActiveGates.

Returns

Return typeStatus codeDescription
ActiveGateGlobalAutoUpdateConfig200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorClient side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant();

putAutoUpdateConfigById

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(config): Promise<void>

Updates the configuration of auto-update for the specified ActiveGate

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

Updates the configuration of auto-update for the specified ActiveGate

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint POST /api/v2/settings/objects with schemaId builtin:deployment.activegate.updates and scope=ENVIRONMENT_ACTIVE_GATE-{ActiveGate ID} to change the auto-update setting of a specific ActiveGate.

Parameters

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

Returns

Return typeStatus codeDescription
void204Success. The auto-update configuration have been updated. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(
    {
      agId: "...",
      body: {
        setting: "INHERITED",
        updateWindows: {
          windows: [
            {
              id: "vu9U3hXa3q0AAAABADdkeW5hdHJhY2Uuc2V0dGluZ3MuZGVwbG95bWVudC5tYW5h",
            },
          ],
        },
      },
    },
  );

putGlobalAutoUpdateConfigForTenant

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(config): Promise<void>

Puts the global auto-update configuration of environment ActiveGates.

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

Puts the global auto-update configuration of environment ActiveGates.

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint POST /api/v2/settings/objects with schemaId builtin:deployment.activegate.updates and scope=tenant to change the global auto-update setting of environment ActiveGates.

Parameters

NameType
config.body*requiredActiveGateGlobalAutoUpdateConfig

Returns

Return typeStatus codeDescription
void204Success. The global auto-update configuration have been updated. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(
    {
      body: {
        globalSetting: "ENABLED",
        updateWindows: {
          windows: [
            {
              id: "vu9U3hXa3q0AAAABADdkeW5hdHJhY2Uuc2V0dGluZ3MuZGVwbG95bWVudC5tYW5h",
            },
          ],
        },
      },
    },
  );

validateAutoUpdateConfigById

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(config): Promise<void>

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

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

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

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint POST /api/v2/settings/objects?validateOnly=true with schemaId builtin:deployment.activegate.updates and scope=ENVIRONMENT_ACTIVE_GATE-{ActiveGate ID} to validate the auto-update setting of a specific ActiveGate.

Parameters

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

Returns

Return typeStatus codeDescription
void204Validated. The submitted auto-update configuration is valid. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(
    {
      agId: "...",
      body: {
        setting: "INHERITED",
        updateWindows: {
          windows: [
            {
              id: "vu9U3hXa3q0AAAABADdkeW5hdHJhY2Uuc2V0dGluZ3MuZGVwbG95bWVudC5tYW5h",
            },
          ],
        },
      },
    },
  );

validateGlobalAutoUpdateConfigForTenant

⚠️ Deprecated

activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(config): Promise<void>

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

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

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

Deprecation notice: This endpoint is deprecated. Use the Settings API endpoint POST /api/v2/settings/objects?validateOnly=true with schemaId builtin:deployment.activegate.updates and scope=tenant to validate the global auto-update setting of environment ActiveGates.

Parameters

NameType
config.body*requiredActiveGateGlobalAutoUpdateConfig

Returns

Return typeStatus codeDescription
void204Validated. The submitted configuration is valid. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(
    {
      body: {
        globalSetting: "ENABLED",
        updateWindows: {
          windows: [
            {
              id: "vu9U3hXa3q0AAAABADdkeW5hdHJhY2Uuc2V0dGluZ3MuZGVwbG95bWVudC5tYW5h",
            },
          ],
        },
      },
    },
  );

activeGatesAutoUpdateJobsClient

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

createUpdateJobForAg

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.createUpdateJobForAg(config): Promise<UpdateJob>

Creates a new update job for the specified ActiveGate

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

Parameters

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

Returns

Return typeStatus codeDescription
UpdateJob201Success. The update-job have been created.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.createUpdateJobForAg(
    {
      agId: "...",
      body: { targetVersion: "1.190.0.20200301-130000" },
    },
  );

deleteUpdateJobByJobIdForAg

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.deleteUpdateJobByJobIdForAg(config): Promise<void>

Deletes the specified update job

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

Parameters

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

Returns

Return typeStatus codeDescription
void204Success. The update-job have been deleted. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Not found. See response body for details. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.deleteUpdateJobByJobIdForAg(
    { agId: "...", jobId: "..." },
  );

getAllUpdateJobList

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.getAllUpdateJobList(config): Promise<UpdateJobsAll>

List ActiveGates with update jobs

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

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.startVersionCompareType"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"

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

Specify the comparison operator here.

config.targetVersionstringFilters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>).
config.targetVersionCompareType"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"

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

Specify the comparison operator here.

config.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.updateType"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"Filters the resulting set of update-jobs by the update type.

Example: ACTIVE_GATE

Returns

Return typeStatus codeDescription
UpdateJobsAll200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.getAllUpdateJobList();

getUpdateJobByJobIdForAg

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.getUpdateJobByJobIdForAg(config): Promise<UpdateJob>

Gets the parameters of the specified update job

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

Parameters

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

Returns

Return typeStatus codeDescription
UpdateJob200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorNot found. See response body for details. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.getUpdateJobByJobIdForAg(
    { agId: "...", jobId: "..." },
  );

getUpdateJobListByAgId

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.getUpdateJobListByAgId(config): Promise<UpdateJobList>

Lists update jobs for the specified ActiveGate

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

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.startVersionCompareType"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"

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

Specify the comparison operator here.

config.targetVersionstringFilters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>).
config.targetVersionCompareType"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"

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

Specify the comparison operator here.

config.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.updateType"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"Filters the resulting set of update-jobs by the update type.

Example: ACTIVE_GATE

Returns

Return typeStatus codeDescription
UpdateJobList200Success

Throws

Error TypeError Message
ErrorEnvelopeErrorNot found. See response body for details. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.getUpdateJobListByAgId(
    { agId: "..." },
  );

validateUpdateJobForAg

⚠️ Deprecated

activeGatesAutoUpdateJobsClient.validateUpdateJobForAg(config): Promise<void>

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

One of the following scopes is required:

  • environment-api:activegates:write
  • fleet-management:activegates:write

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:write

Parameters

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

Returns

Return typeStatus codeDescription
void204Validated. The submitted update-job is valid. Response doesn't have a body.

Throws

Error TypeError Message
ErrorEnvelopeErrorFailed. The input is invalid. | Client side error. | Server side error.
Code example
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";

const data =
  await activeGatesAutoUpdateJobsClient.validateUpdateJobForAg(
    {
      agId: "...",
      body: { targetVersion: "1.190.0.20200301-130000" },
    },
  );

activeGatesClient

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

getAllActiveGates

⚠️ Deprecated

activeGatesClient.getAllActiveGates(config): Promise<ActiveGateList>

Lists all available ActiveGates

One of the following scopes is required:

  • environment-api:activegates:read
  • fleet-management:activegates:read

One of the following permissions is required:

  • environment:roles:manage-settings
  • fleet-management:activegates:read

The response includes all ActiveGates that are currently connected to the environment or have been connected during last 2 hours. Deprecated since version 1.343. Use DQL Smartscape nodes to query ActiveGate data instead. See https://dt-url.net/mf03894

Parameters

NameTypeDescription
config.autoUpdate"ENABLED" | "DISABLED"Filters 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<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS">Filters the resulting set of ActiveGates by the disabled modules.
config.enabledModuleArray<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS">Filters the resulting set of ActiveGates by the enabled modules.
config.fipsModebooleanFilters the resulting set of ActiveGates to those which are running in FIPS mode (true) or not (false).
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 t

版本与发布记录

@dynatrace-sdk/client-classic-environment-v2 共发布 48 个版本,首次发布于 2022/11/25;过去 12 个月发布了 10 个版本。

版本发布日期距今
11.0.0latest2026/10/3014 天前
9.1.02026/10/011 个月前
9.0.12026/09/072 个月前
9.0.02026/09/042 个月前
8.0.02026/08/033 个月前
7.0.02026/08/033 个月前

关于 @dynatrace-sdk/client-classic-environment-v2 的常见问题

@dynatrace-sdk/client-classic-environment-v2 是什么?

Client for the Dynatrace Environment API v2

如何安装 @dynatrace-sdk/client-classic-environment-v2?

在项目目录运行 npm install @dynatrace-sdk/client-classic-environment-v2,或使用 pnpm add / yarn add / bun add。

@dynatrace-sdk/client-classic-environment-v2 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@dynatrace-sdk/client-classic-environment-v2 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@dynatrace-sdk/client-classic-environment-v2 可以商用吗?

@dynatrace-sdk/client-classic-environment-v2 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@dynatrace-sdk/client-classic-environment-v2 的下载量有多少?

根据 npm 官方下载统计,@dynatrace-sdk/client-classic-environment-v2 在 2026/10/13 – 2026/11/11 这 30 天内被下载 15,823 次,日均约 527 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@dynatrace-sdk/client-classic-environment-v2 还在维护吗?

最新版本 11.0.0 发布于 2026/10/30(14 天前);至今共发布 48 个版本,其中过去 12 个月发布了 10 个;首次发布于 2022/11/25。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。