@dynatrace-sdk/client-classic-environment-v2
v3.5.0
Published
Client for the Dynatrace Environment API v2
Downloads
518
Keywords
Readme
@dynatrace-sdk/client-classic-environment-v2
Documentation of the Dynatrace Environment API v2. Resources here generally supersede those in v1. Migration of resources from v1 is in progress.
If you miss a resource, consider using the Dynatrace Environment API v1.
To read about use cases and examples, see Dynatrace Documentation.
To authorize, use a valid access token or personal access token. For usage in a Dynatrace app, refer to the Dynatrace Developer documentation.
Notes about compatibility:
- Operations marked as early adopter or preview may be changed in non-compatible ways, although we try to avoid this.
- We may add new enum constants without incrementing the API version; thus, clients need to handle unknown enum constants gracefully.
Installation
npm install @dynatrace-sdk/client-classic-environment-v2
Getting help
- Visit SDK for Typescript guide in the Dynatrace Developer
- Ask a question in the Dynatrace Community
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
Required permission: environment:roles:manage-settings
The newly created token will be owned by the same user who owns the token used for authentication of the call.
Parameters
| Name | Type | | --- | --- | |config.body*required|ActiveGateTokenCreate|
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateTokenCreated|201|Success. The token has been created. The body of the response contains the token secret.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.createToken({
body: {
activeGateType:
ActiveGateTokenCreateActiveGateType.Environment,
name: "myToken",
},
});
getToken
Gets metadata of an ActiveGate token
Required scope: environment-api:activegate-tokens:read Required permission: environment:roles:manage-settings
The token secret is not exposed.
Parameters
| Name | Type | Description | | --- | --- | --- | |config.activeGateTokenIdentifier*required|string|The ActiveGate token identifier, consisting of prefix and public part of the token. |
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateToken|200|Success. The response contains the metadata of the tokens.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|
import { accessTokensActiveGateTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensActiveGateTokensClient.getToken({
activeGateTokenIdentifier: "...",
});
listTokens
Lists all available ActiveGate tokens
Required scope: environment-api:activegate-tokens:read Required permission: environment:roles:manage-settings
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
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
Required scope: environment-api:activegate-tokens:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.activeGateTokenIdentifier*required|string|The ActiveGate token identifier, consisting of prefix and public part of the token to be deleted. |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|
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
Required scope: environment-api:agent-connection-tokens:read Required permission: environment:roles:agent-install
Returns the agent connection token.
Returns
| Return type | Status code | Description | |---|---|---| |AgentConnectionToken|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Failed. The requested resource doesn't exist. | Client side error. | Server side error.|
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
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
The newly created token will be owned by the same user who owns the token used for authentication of the call.
Creating personal access tokens requires the environment:roles:viewer
permission. Creating access tokens requires the environment:roles:manage-settings
permission.
Parameters
| Name | Type | | --- | --- | |config.body*required|ApiTokenCreate|
Returns
| Return type | Status code | Description | |---|---|---| |ApiTokenCreated|201|Success. The token has been created. The body of the response contains the token secret.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
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
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
Parameters
| Name | Type | Description | | --- | --- | --- | |config.id*required|string|The ID of the token to be deleted. You can specify either the ID or the secret of the token. You can't delete the token you're using for authentication of the request. |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. You can't delete the token you're using for authentication of the request. | Client side error. | Server side error.|
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.deleteApiToken({
id: "...",
});
getApiToken
Gets API token metadata by token ID
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
The token secret is not exposed.
Parameters
| Name | Type | | --- | --- | |config.id*required|string|
Returns
| Return type | Status code | Description | |---|---|---| |ApiToken|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await accessTokensApiTokensClient.getApiToken({
id: "...",
});
listApiTokens
Lists all available API tokens
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
You can limit the output by using pagination:
- Specify the number of results per page in the pageSize query parameter.
- Use the cursor from the nextPageKey field of the previous response in the nextPageKey query parameter to obtain subsequent pages.
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
Required scope: environment-api:api-tokens:read Required permission: environment:roles:viewer
Parameters
| Name | Type | | --- | --- | |config.body*required|ApiTokenSecret|
Returns
| Return type | Status code | Description | |---|---|---| |ApiToken|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|
import { accessTokensApiTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensApiTokensClient.lookupApiToken({
body: {
token:
"dt0c01.ST2EY72KQINMH574WMNVI7YN.G3DFPBEJYMODIDAEX454M7YWBUVEFOWKPRVMWFASS64NFH52PX6BNDVFFM572RZM",
},
});
updateApiToken
Updates an API token
Required scope: environment-api:api-tokens:write Required permission: environment:roles:viewer
Parameters
| Name | Type | Description | | --- | --- | --- | |config.body*required|ApiTokenUpdate| | |config.id*required|string|The ID of the token to be updated. You can't disable the token you're using for authentication of the request. |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
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
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Returns
| Return type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. Rotation process has been cancelled. The current tenant token remains valid.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. There is no ongoing rotation process. | Client side error. | Server side error.|
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensTenantTokensClient.cancelRotation();
finishRotation
Finishes tenant token rotation
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Returns
| Return type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. The rotation process is completed. The active field of the response contains the new tenant token.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|No ongoing rotation process. | Client side error. | Server side error.|
import { accessTokensTenantTokensClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await accessTokensTenantTokensClient.finishRotation();
startRotation
Starts tenant token rotation
Required scope: environment-api:tenant-token-rotation:write Required permission: environment:roles:manage-settings
To learn how to rotate tokens, see Token rotation in Dynatrace Documentation.
Returns
| Return type | Status code | Description | |---|---|---| |TenantTokenConfig|200|Success. The new tenant token is created and will replace the old one. The active field of the response contains the new tenant token.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. Another rotation process is already in progress. | Client side error. | Server side error.|
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
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateGroups|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|
import { activeGatesActiveGateGroupsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesActiveGateGroupsClient.getActiveGateGroups();
activeGatesAutoUpdateConfigurationClient
import { activeGatesAutoUpdateConfigurationClient } from '@dynatrace-sdk/client-classic-environment-v2';
getAutoUpdateConfigById
Gets the configuration of auto-update for the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. |
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateAutoUpdateConfig|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.getAutoUpdateConfigById(
{ agId: "..." },
);
getGlobalAutoUpdateConfigForTenant
Gets the global auto-update configuration of environment ActiveGates.
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateGlobalAutoUpdateConfig|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.getGlobalAutoUpdateConfigForTenant();
putAutoUpdateConfigById
Updates the configuration of auto-update for the specified ActiveGate
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.body*required|ActiveGateAutoUpdateConfig| |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. The auto-update configuration have been updated. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.putAutoUpdateConfigById(
{
agId: "...",
body: {
setting:
ActiveGateAutoUpdateConfigSetting.Inherited,
},
},
);
putGlobalAutoUpdateConfigForTenant
Puts the global auto-update configuration of environment ActiveGates.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | | --- | --- | |config.body*required|ActiveGateGlobalAutoUpdateConfig|
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. The global auto-update configuration have been updated. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.putGlobalAutoUpdateConfigForTenant(
{
body: {
globalSetting:
ActiveGateGlobalAutoUpdateConfigGlobalSetting.Enabled,
},
},
);
validateAutoUpdateConfigById
Validates the payload for the POST /activeGates/{agId}/autoUpdate
request.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.body*required|ActiveGateAutoUpdateConfig| |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Validated. The submitted auto-update configuration is valid. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.validateAutoUpdateConfigById(
{
agId: "...",
body: {
setting:
ActiveGateAutoUpdateConfigSetting.Inherited,
},
},
);
validateGlobalAutoUpdateConfigForTenant
Validates the payload for the POST /activeGates/autoUpdate
request.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | | --- | --- | |config.body*required|ActiveGateGlobalAutoUpdateConfig|
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Validated. The submitted configuration is valid. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesAutoUpdateConfigurationClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateConfigurationClient.validateGlobalAutoUpdateConfigForTenant(
{
body: {
globalSetting:
ActiveGateGlobalAutoUpdateConfigGlobalSetting.Enabled,
},
},
);
activeGatesAutoUpdateJobsClient
import { activeGatesAutoUpdateJobsClient } from '@dynatrace-sdk/client-classic-environment-v2';
createUpdateJobForAg
Creates a new update job for the specified ActiveGate
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.body*required|UpdateJob| |
Returns
| Return type | Status code | Description | |---|---|---| |UpdateJob|201|Success. The update-job have been created.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
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
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.jobId*required|string|A unique identifier for a update-job of ActiveGate. |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Success. The update-job have been deleted. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Not found. See response body for details. | Client side error. | Server side error.|
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.deleteUpdateJobByJobIdForAg(
{ agId: "...", jobId: "..." },
);
getAllUpdateJobList
List ActiveGates with update jobs
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The response includes ActiveGates that have both completed (successful and failed) jobs and jobs in progress.
Parameters
| Name | Type | Description | | --- | --- | --- | |config.from|string|The start of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the relative timeframe of one day is used (now-1d). Maximum timeframe is 31 days. | |config.lastUpdates|boolean|If true, filters the resulting set of update jobs to the most recent update of each type. | |config.startVersion|string|Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>). | |config.startVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. | |config.targetVersion|string|Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>). | |config.targetVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. | |config.to|string|The end of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the current timestamp is used. | |config.updateType|"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"|Filters the resulting set of update-jobs by the update type. |
Returns
| Return type | Status code | Description | |---|---|---| |UpdateJobsAll|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.getAllUpdateJobList();
getUpdateJobByJobIdForAg
Gets the parameters of the specified update job
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.jobId*required|string|A unique identifier for a update-job of ActiveGate. |
Returns
| Return type | Status code | Description | |---|---|---| |UpdateJob|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|
import { activeGatesAutoUpdateJobsClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data =
await activeGatesAutoUpdateJobsClient.getUpdateJobByJobIdForAg(
{ agId: "...", jobId: "..." },
);
getUpdateJobListByAgId
Lists update jobs for the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The job can update the ActiveGate to the specified version or the latest available one.
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.from|string|The start of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the relative timeframe of one week is used (now-1w). Maximum timeframe is 31 days. | |config.lastUpdates|boolean|If true, filters the resulting set of update jobs to the most recent update of each type. | |config.startVersion|string|Filters the resulting set of update-jobs by the initial version (required format <major>.<minor>.<revision>). | |config.startVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified initial version. Specify the comparison operator here. | |config.targetVersion|string|Filters the resulting set of update-jobs by the target version (required format <major>.<minor>.<revision>). | |config.targetVersionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of update jobs by the specified target version. Specify the comparison operator here. | |config.to|string|The end of the requested timeframe for update jobs. You can use one of the following formats: Timestamp in UTC milliseconds. Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional. Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are: m: minutes h: hours d: days w: weeks M: months y: years If not set, the current timestamp is used. | |config.updateType|"SYNTHETIC" | "ACTIVE_GATE" | "REMOTE_PLUGIN_AGENT" | "Z_REMOTE"|Filters the resulting set of update-jobs by the update type. |
Returns
| Return type | Status code | Description | |---|---|---| |UpdateJobList|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|
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.
Required scope: environment-api:activegates:write Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. | |config.body*required|UpdateJob| |
Returns
| Return type | Status code | Description | |---|---|---| |void|204|Validated. The submitted update-job is valid. Response doesn't have a body.|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
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
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
The response includes all ActiveGates that are currently connected to the environment or have been connected during last 2 hours.
Parameters
| Name | Type | Description | | --- | --- | --- | |config.autoUpdate|"ENABLED" | "DISABLED"|Filters the resulting set of ActiveGates by the actual state of auto-update. | |config.containerized|boolean|Filters the resulting set of ActiveGates to those which are running in container (true) or not (false). | |config.disabledModule|"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "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|"SYNTHETIC" | "AWS" | "AZURE" | "BEACON_FORWARDER" | "CLOUD_FOUNDRY" | "DB_INSIGHT" | "EXTENSIONS_V1" | "EXTENSIONS_V2" | "KUBERNETES" | "LOGS" | "MEMORY_DUMPS" | "METRIC_API" | "ONE_AGENT_ROUTING" | "OTLP_INGEST" | "REST_API" | "VMWARE" | "Z_OS"|Filters the resulting set of ActiveGates by the enabled modules. | |config.group|string|Filters the resulting set of ActiveGates by the group. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.hostname|string|Filters the resulting set of ActiveGates by the name of the host it's running on. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.loadBalancerAddress|string|Filters the resulting set of ActiveGates by the Load Balancer address. You can specify a partial address. In that case, the CONTAINS operator is used. | |config.networkAddress|string|Filters the resulting set of ActiveGates by the network address. You can specify a partial address. In that case, the CONTAINS operator is used. | |config.networkZone|string|Filters the resulting set of ActiveGates by the network zone. You can specify a partial name. In that case, the CONTAINS operator is used. | |config.online|boolean|Filters the resulting set of ActiveGates by the communication status. | |config.osArchitecture|"S390" | "X86" | "ARM"|Filters the resulting set of ActiveGates by the OS architecture of the host it's running on. | |config.osType|"LINUX" | "WINDOWS"|Filters the resulting set of ActiveGates by the OS type of the host it's running on. | |config.tokenExpirationSet|boolean|Filters the resulting set of ActiveGates to those with set expiration date for authorization token. | |config.tokenState|"UNKNOWN" | "ABSENT" | "EXPIRING" | "INVALID" | "UNSUPPORTED" | "VALID"|Filters the resulting set of ActiveGates to those with authorization token in specified state. | |config.type|"ENVIRONMENT" | "ENVIRONMENT_MULTI"|Filters the resulting set of ActiveGates by the ActiveGate type. | |config.updateStatus|"UNKNOWN" | "INCOMPATIBLE" | "OUTDATED" | "SCHEDULED" | "SUPPRESSED" | "UP2DATE" | "UPDATE_IN_PROGRESS" | "UPDATE_PENDING" | "UPDATE_PROBLEM"|Filters the resulting set of ActiveGates by the auto-update status. | |config.version|string|Filters the resulting set of ActiveGates by the specified version. Specify the version in <major>.<minor>.<revision> format (for example, 1.195.0) here. | |config.versionCompareType|"EQUAL" | "GREATER" | "GREATER_EQUAL" | "LOWER" | "LOWER_EQUAL"|Filters the resulting set of ActiveGates by the specified version. Specify the comparison operator here. |
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGateList|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Failed. The input is invalid. | Client side error. | Server side error.|
import { activeGatesClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await activeGatesClient.getAllActiveGates();
getOneActiveGateById
Gets the details of the specified ActiveGate
Required scope: environment-api:activegates:read Required permission: environment:roles:manage-settings
Parameters
| Name | Type | Description | | --- | --- | --- | |config.agId*required|string|The ID of the required ActiveGate. |
Returns
| Return type | Status code | Description | |---|---|---| |ActiveGate|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Not found. See response body for details. | Client side error. | Server side error.|
import { activeGatesClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await activeGatesClient.getOneActiveGateById({
agId: "...",
});
attacksClient
import { attacksClient } from '@dynatrace-sdk/client-classic-environment-v2';
getAttack
Gets the specified attack
Required scope: environment-api:attacks:read One of the following permissions is required:
- environment:roles:manage-security-problems
- environment:roles:view-security-problems
Parameters
| Name | Type | Description | | --- | --- | --- | |config.fields|string|A list of additional attack properties you can add to the response. The following properties are available (all other properties are always included and you can't remove them from the response): attackTarget: The targeted host/database of an attack. request: The request that was sent from the attacker. entrypoint: The entry point used by an attacker to start a specific attack. vulnerability: The vulnerability utilized by the attack. securityProblem: The related security problem. attacker: The attacker of an attack. managementZones: The related management zones. To add properties, specify them in a comma-separated list and prefix each property with a plus (for example, +attackTarget,+securityProblem). | |config.id*required|string|The ID of the attack. |
Returns
| Return type | Status code | Description | |---|---|---| |Attack|200|Success|
Throws
| Error Type | Error Message | |---|---| |ErrorEnvelopeError|Client side error. | Server side error.|
import { attacksClient } from "@dynatrace-sdk/client-classic-environment-v2";
const data = await attacksClient.getAttack({ id: "..." });
getAttacks
Lists all attacks
Required scope: environment-api:attacks:read One of the following permissions is required:
- environment:roles:manage-security-problems
- environment:roles:view-security-problems
Parameters
| Name | Type | Description | | --- | --- | --- | |config.attackSelector|string|Defines the scope of the query. Only attacks matching the specified criteria are included in the response. You can add one or more of the following criteria. Values are not case-sensitive and the EQUALS operator is used unless otherwise specified. State: state("value"). The state of the attack. Possible values are EXPLOITED, BLOCKED, and ALLOWLISTED. Attack Type: attackType("value"). The type of the attack. Find the possible values in the description of the attackType field of the response. Country Code: countryCode("value"). The country code of the attacker. Supported values include all ISO-3166-1 alpha-2 country codes (2-letter). Supplying empty filter value countryCode() will return attacks, where location is not available. Request path contains: requestPathContains("value"). Filters for a substring in the request path. The CONTAINS operator is used. A maximum of 48 characters are allowed. Process group name contains: processGroupNameContains("value"). Filters for a substring in the targeted process group's name. The CONTAINS operator is used. Vulnerability ID: vulnerabilityId("123456789"). The exact ID of the vulnerability. Source IPs: sourceIps("93.184.216.34", "63.124.6.12"). The exact IPv4/IPv6 addresses of the attacker. Management zone ID: managementZoneIds("mzId-1", "mzId-2"). Management zone name: managementZones("name-1", "name-2"). Values are case sensitive. Technology: technology("technology-1", "technology-2"). Find the possible values in the description of the technology field of the response. The EQUALS operator is used. To set several criteria, separate them with a comma (,). Only results matching (all criteria are included in the response. Specify the value of a criterion as a quoted string. The following special characters must be escaped with a tilde (~) inside quotes: Tilde ~ Quote " | |config.fields|string|A list of additional attack properties you can add to the response. The following properties are available (all other properties are always included and you can't remove them from the response): attackTarget: The targeted host/database of an attack. request: The request that was sent from the attacker. entrypoint: The entry point used by an attacker to start a specific attack. v