npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

v6.1.0

Published

Client for the Dynatrace Environment API v2

Readme

@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

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

| Name | Type | | --- | --- | |config.body*required|ActiveGateTokenCreate|

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

getToken

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|

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

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

listTokens

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

| Name | Type | Description | | --- | --- | --- | |config.nextPageKey|string|The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. | |config.pageSize|number|The amount of ActiveGate tokens in a single response payload. The maximal allowed page size is 3000 and the minimal size is 100. If not set, 100 is used. |

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|

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

const data =
  await accessTokensActiveGateTokensClient.listTokens();

revokeToken

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|

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

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 type | Status code | Description | |---|---|---| |AgentConnectionToken|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|

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

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

| Name | Type | | --- | --- | |config.body*required|ApiTokenCreate|

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

deleteApiToken

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

| Name | Type | Description | | --- | --- | --- | |config.id*required|string|The ID of the token to be deleted. You can specify either the ID or the secret of the token. You can't delete the token you're using for authentication of the request. |

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. You can't delete the token you're using for authentication of the request. | Client side error. | Server side error.|

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

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

getApiToken

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

| Name | Type | | --- | --- | |config.id*required|string|

Returns

| Return type | Status code | Description | |---|---|---| |ApiToken|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

listApiTokens

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

| Name | Type | Description | | --- | --- | --- | |config.apiTokenSelector|string|Filters the resulting sets of tokens. Only tokens matching the specified criteria are included into response. You can set one or more of the following criteria: Owner: owner("value"). The user that owns the token. Case-sensitive. Personal access token: personalAccessToken(false). Set to true to include only personal access tokens or to false to include only API tokens. Token scope: scope("scope1","scope2"). If several values are specified, the OR logic applies. To set multiple criteria, separate them with commas (,). Only results matching all criteria are included into response. | |config.fields|string|Specifies the fields to be included in the response. The following fields are included by default: id name enabled owner creationDate To remove fields from the response, specify them with the minus (-) operator as a comma-separated list (for example, -creationDate,-owner). You can include additional fields: personalAccessToken expirationDate lastUsedDate lastUsedIpAddress modifiedDate scopes additionalMetadata To add fields to the response, specify them with the plus (+) operator as a comma-separated list (for example, +expirationDate,+scopes). You can combine adding and removing of fields (for example, +scopes,-creationDate). Alternatively, you can define the desired set of fields in the response. Specify the required fields as a comma-separated list, without operators (for example, creationDate,expirationDate,owner). The ID is always included in the response. The fields string must be URL-encoded. | |config.from|string|Filters tokens based on the last usage time. The start of the requested timeframe. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years | |config.nextPageKey|string|The cursor for the next page of results. You can find it in the nextPageKey field of the previous response. The first page is always returned if you don't specify the nextPageKey query parameter. When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters. | |config.pageSize|number|The amount of API tokens in a single response payload. The maximal allowed page size is 10000 and the minimal allowed page size is 100. If not set, 200 is used. | |config.sort|string|The sort order of the token list. You can sort by the following properties with a sign prefix for the sort order: name: token name (+ a...z or - z...a) lastUsedDate last used (+ never used tokens first - most recently used tokens first) creationDate (+ oldest tokens first - newest tokens first) expirationDate (+ tokens that expire soon first - unlimited tokens first) modifiedDate last modified (+ never modified tokens first - most recently modified tokens first) If no prefix is set, + is used. If not set, tokens are sorted by creation date with newest first. | |config.to|string|Filters tokens based on the last usage time. The end of the requested timeframe. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the current timestamp is used. |

Returns

| Return type | Status code | Description | |---|---|---| |ApiTokenList|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

const data =
  await accessTokensApiTokensClient.listApiTokens();

lookupApiToken

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

| Name | Type | | --- | --- | |config.body*required|ApiTokenSecret|

Returns

| Return type | Status code | Description | |---|---|---| |ApiToken|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|

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

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

updateApiToken

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

| Name | Type | Description | | --- | --- | --- | |config.body*required|ApiTokenUpdate| | |config.id*required|string|The ID of the token to be updated. You can't disable the token you're using for authentication of the request. |

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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 type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. Rotation process has been cancelled. The current tenant token remains valid.|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. There is no ongoing rotation process. | Client side error. | Server side error.|

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

const data =
  await accessTokensTenantTokensClient.cancelRotation();

finishRotation

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 type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. The rotation process is completed. The active field of the response contains the new tenant token.|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|No ongoing rotation process. | Client side error. | Server side error.|

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

const data =
  await accessTokensTenantTokensClient.finishRotation();

startRotation

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 type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. The new tenant token is created and will replace the old one. The active field of the response contains the new tenant token.|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. Another rotation process is already in progress. | Client side error. | Server side error.|

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

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

Returns

| Return type | Status code | Description | |---|---|---| |ActiveGateGroups|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|

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

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 type | Status code | Description | |---|---|---| |ActiveGateTokenEnforcement|200|Success. The response contains the status of ActiveGate tokens enforcement|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|

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

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

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

Returns

| Return type | Status code | Description | |---|---|---| |ActiveGateAutoUpdateConfig|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|

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

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

~~getGlobalAutoUpdateConfigForTenant~~

⚠️ Deprecated

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 type | Status code | Description | |---|---|---| |ActiveGateGlobalAutoUpdateConfig|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|

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

const data =
  await activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant();

~~putAutoUpdateConfigById~~

⚠️ Deprecated

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

~~putGlobalAutoUpdateConfigForTenant~~

⚠️ Deprecated

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

| Name | Type | | --- | --- | |config.body*required|ActiveGateGlobalAutoUpdateConfig|

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

~~validateAutoUpdateConfigById~~

⚠️ Deprecated

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

~~validateGlobalAutoUpdateConfigForTenant~~

⚠️ Deprecated

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

| Name | Type | | --- | --- | |config.body*required|ActiveGateGlobalAutoUpdateConfig|

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

activeGatesAutoUpdateJobsClient

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

createUpdateJobForAg

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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

deleteUpdateJobByJobIdForAg

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

| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.jobId*required|string|A unique identifier for a update-job of ActiveGate. |

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Not found. See response body for details. | Client side error. | Server side error.|

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

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

getAllUpdateJobList

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

| Name | Type | Description | | --- | --- | --- | |config.from|string|The start of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the relative timeframe of one day is used (now-1d). Maximum timeframe is 31 days. | |config.lastUpdates|boolean|If true, filters the resulting set of update jobs to the most recent update of each type. | |config.startVersion|string|Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>). | |config.startVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. | |config.targetVersion|string|Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>). | |config.targetVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. | |config.to|string|The end of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the current timestamp is used. | |config.updateType|"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"|Filters the resulting set of update-jobs by the update type. |

Returns

| Return type | Status code | Description | |---|---|---| |UpdateJobsAll|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

const data =
  await activeGatesAutoUpdateJobsClient.getAllUpdateJobList();

getUpdateJobByJobIdForAg

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

| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.jobId*required|string|A unique identifier for a update-job of ActiveGate. |

Returns

| Return type | Status code | Description | |---|---|---| |UpdateJob|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|

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

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

getUpdateJobListByAgId

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

| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.from|string|The start of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the relative timeframe of one week is used (now-1w). Maximum timeframe is 31 days. | |config.lastUpdates|boolean|If true, filters the resulting set of update jobs to the most recent update of each type. | |config.startVersion|string|Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>). | |config.startVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. | |config.targetVersion|string|Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>). | |config.targetVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. | |config.to|string|The end of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the current timestamp is used. | |config.updateType|"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"|Filters the resulting set of update-jobs by the update type. |

Returns

| Return type | Status code | Description | |---|---|---| |UpdateJobList|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|

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

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

validateUpdateJobForAg

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

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

Returns

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

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

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

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.

Parameters

| Name | Type | Description | | --- | --- | --- | |config.autoUpdate|"ENABLED" | "DISABLED"|Filters the resulting set of ActiveGates by the actual state of auto-update. | |config.containerized|boolean|Filters the resulting set of ActiveGates to those which are running in container (true) or not (false). | |config.disabledModule|Array<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS">|Filters the resulting set of ActiveGates by the disabled modules. | |config.enabledModule|Array<"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "DEBUGGING" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS">|Filters the resulting set of ActiveGates by the enabled modules. | |config.fipsMode|boolean|Filters the resulting set of ActiveGates to those which are running in FIPS mode (true) or not (false). | |config.group|string|Filters the resulting set of ActiveGates by the group. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.hostname|string|Filters the resulting set of ActiveGates by the name of the host it's running on. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.loadBalancerAddress|string|Filters the resulting set of ActiveGates by the Load Balancer address. You can specify a partial address. In that case, the CONTAINS operator is used. | |config.networkAddress|string|Filters the resulting set of ActiveGates by the network address. You can specify a partial address. In that case, the CONTAINS operator is used. | |config.networkZone|string|Filters the resulting set of ActiveGates by the network zone. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.online|boolean|Filters the resulting set of ActiveGates by the communication status. | |config.osArchitecture|"S390" | "X86" | "ARM" | "PPCLE"|Filters the resulting set of ActiveGates by the OS architecture of the host it's running on. | |config.osType|"LINUX" | "WINDOWS"|Filters the resulting set of ActiveGates by the OS type of the host it's running on. | |config.tokenExpirationSet|boolean|Filters the resulting set of ActiveGates to those with set expiration date for authorization token. | |config.tokenState|"UNKNOWN" | "ABSENT" | "EXPIRING" | "INVALID" | "UNSUPPORTED" | "VALID"|Filters the resulting set of ActiveGates to those with authorization token in specified state. | |config.type|"ENVIRONMENT" | "ENVIRONMENT_MULTI"|Filters the resulting set of ActiveGates by the ActiveGate type. | |config.updateStatus|"UNKNOWN" | "INCOMPATIBLE" | "OUTDATED" | "SCHEDULED" | "SUPPRESSED" | "UP2DATE" | "UPDATE_IN_PROGRESS" | "UPDATE_PENDING" | "UPDATE_PROBLEM"|Filters the resulting set of ActiveGates by the auto-update status. | |config.version|string|Filters the resulting set of ActiveGates by the specified version. Specify the version in <major>.<minor>.<revision> format (for example, 1.195.0) here. | |config.versionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of ActiveGates by the specified version. Specify the comparison operator here. |

Returns

| Return type | Status code | Description | |---|---|---| |ActiveGateList|200|Success|

Throws

| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|

impo