Update specific environment

This API call updates an existing environment or creates a new one.

Authentication

To execute this request, you need the Service Provider API (ServiceProviderAPI) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/cluster/v2/environments

Parameter

ParameterTypeDescriptionInRequired
idstring

The ID of the environment to update.

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

pathrequired
createTokenboolean

If true, a token management token with the scopes 'apiTokens.read' and 'apiTokens.write' (for usage with token API v2) and 'TenantTokenManagement' (for usage with token API v1) is created when creating a new environment. This token is then returned in the response body. It can be used within the newly created environment to create other tokens for configuring this environment.

queryoptional
bodyEnvironment

JSON body of the request, containing updated parameters of the environment.

bodyoptional

Request body objects

The Environment object

Basic configuration for an environment.

ElementTypeDescriptionRequired
namestring

The display name of the environment.

required
idstring

The ID of the environment. Has to match [a-zA-Z0-9_-]{1,70}

optional
trialboolean

Specifies whether the environment is a trial environment or a non-trial environment. Creating a trial environment is only possible if your license allows that. The default value is false (non-trial).

optional
statestring

Indicates whether the environment is enabled or disabled. The default value is ENABLED.

  • DISABLED
  • ENABLED
optional
tagsstring[]

A set of tags that are assigned to this environment. Every tag can have a maximum length of 100 characters.

optional
creationDatestring

The creation date of the environment in ISO 8601 format (yyyy-MM-dd'T'HH:mm:ss.SSS'Z')

optional
quotasEnvironmentQuotas

Environment level consumption and quotas information. Only returned if includeConsumptionInfo or includeUncachedConsumptionInfo param is true. If skipped when editing via PUT method then already set quotas will remain.

optional
storageEnvironmentStorage

Environment level storage usage and limit information. Not returned if includeStorageInfo param is not true. If skipped when editing via PUT method then already set limits will remain.

optional

The EnvironmentQuotas object

Environment level consumption and quotas information. Only returned if includeConsumptionInfo or includeUncachedConsumptionInfo param is true. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
hostUnitsHostUnitQuota

Host units consumption and quota information on environment level. If skipped when editing via PUT method then already set quota will remain.

optional
demUnitsDemUnitsQuota

DEM units consumption and quota information on environment level. Not set (and not editable) if DEM units is not enabled. If skipped when editing via PUT method then already set quotas will remain.

optional
userSessionsUserSessionsQuota

User sessions consumption and quota information on environment level. If skipped when editing via PUT method then already set quotas will remain.

optional
sessionPropertiesSessionPropertiesQuota

User session properties consumption information on environment level.

optional
syntheticMonitorsSyntheticQuota

Synthetic monitors consumption and quota information on environment level. Not set (and not editable) if neither Synthetic nor DEM units is enabled. If skipped when editing via PUT method then already set quotas will remain.

optional
customMetricsCustomMetricsQuota

Custom metrics consumption and quota information on environment level. Not set (and not editable) if Custom metrics is not enabled. Not set (and not editable) if Davis data units is enabled. If skipped when editing via PUT method then already set quota will remain.

optional
davisDataUnitsDavisDataUnitsQuota

Davis data units consumption and quota information on environment level. Not set (and not editable) if Davis data units is not enabled. If skipped when editing via PUT method then already set quotas will remain.

optional
logMonitoringLogMonitoringQuota

Log monitoring consumption and quota information on environment level. Not set (and not editable) if Log monitoring is not enabled. Not set (and not editable) if Log monitoring is migrated to Davis data on license level. If skipped when editing via PUT method then already set quotas will remain.

optional

The HostUnitQuota object

Host units consumption and quota information on environment level. If skipped when editing via PUT method then already set quota will remain.

ElementTypeDescriptionRequired
currentUsagenumber

Current environment usage.

optional
maxLimitinteger

Concurrent environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The DemUnitsQuota object

DEM units consumption and quota information on environment level. Not set (and not editable) if DEM units is not enabled. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
consumedThisMonthnumber

Monthly environment consumption. Resets each calendar month.

optional
consumedThisYearnumber

Yearly environment consumption. Resets each year on license creation date anniversary.

optional
monthlyLimitinteger

Monthly environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
annualLimitinteger

Annual environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The UserSessionsQuota object

User sessions consumption and quota information on environment level. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
consumedUserSessionsWithMobileSessionReplayThisYearnumber

Yearly Mobile user sessions with replay environment consumption. Resets each year on license creation date anniversary.

optional
consumedUserSessionsWithWebSessionReplayThisMonthnumber

Monthly Web user sessions with replay environment consumption. Resets each calendar month.

optional
consumedUserSessionsWithMobileSessionReplayThisMonthnumber

Monthly Mobile user sessions with replay environment consumption. Resets each calendar month.

optional
totalAnnualLimitinteger

Annual total User sessions environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
totalConsumedThisMonthnumber

Monthly total User sessions environment consumption. Resets each calendar month.

optional
totalConsumedThisYearnumber

Yearly total User sessions environment consumption. Resets each year on license creation date anniversary.

optional
totalMonthlyLimitinteger

Monthly total User sessions environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
consumedUserSessionsWithWebSessionReplayThisYearnumber

Yearly Web user sessions with replay environment consumption. Resets each year on license creation date anniversary.

optional
consumedMobileSessionsThisMonthnumber

Monthly Mobile user sessions environment consumption. Resets each calendar month.

optional
consumedMobileSessionsThisYearnumber

Yearly Mobile user sessions environment consumption. Resets each year on license creation date anniversary.

optional

The SessionPropertiesQuota object

User session properties consumption information on environment level.

ElementTypeDescriptionRequired
consumedThisMonthnumber

Monthly environment consumption. Resets each calendar month.

optional
consumedThisYearnumber

Yearly environment consumption. Resets each year on license creation date anniversary.

optional

The SyntheticQuota object

Synthetic monitors consumption and quota information on environment level. Not set (and not editable) if neither Synthetic nor DEM units is enabled. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
consumedThisMonthnumber

Monthly environment consumption. Resets each calendar month.

optional
consumedThisYearnumber

Yearly environment consumption. Resets each year on license creation date anniversary.

optional
monthlyLimitinteger

Monthly environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
annualLimitinteger

Annual environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The CustomMetricsQuota object

Custom metrics consumption and quota information on environment level. Not set (and not editable) if Custom metrics is not enabled. Not set (and not editable) if Davis data units is enabled. If skipped when editing via PUT method then already set quota will remain.

ElementTypeDescriptionRequired
currentUsagenumber

Current environment usage.

optional
maxLimitinteger

Concurrent environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The DavisDataUnitsQuota object

Davis data units consumption and quota information on environment level. Not set (and not editable) if Davis data units is not enabled. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
consumedThisMonthnumber

Monthly environment consumption. Resets each calendar month.

optional
consumedThisYearnumber

Yearly environment consumption. Resets each year on license creation date anniversary.

optional
monthlyLimitinteger

Monthly environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
annualLimitinteger

Annual environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The LogMonitoringQuota object

Log monitoring consumption and quota information on environment level. Not set (and not editable) if Log monitoring is not enabled. Not set (and not editable) if Log monitoring is migrated to Davis data on license level. If skipped when editing via PUT method then already set quotas will remain.

ElementTypeDescriptionRequired
consumedThisMonthnumber

Monthly environment consumption. Resets each calendar month.

optional
consumedThisYearnumber

Yearly environment consumption. Resets each year on license creation date anniversary.

optional
monthlyLimitinteger

Monthly environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional
annualLimitinteger

Annual environment quota. Not set if unlimited. When updating via PUT method, skipping this field will set quota unlimited.

optional

The EnvironmentStorage object

Environment level storage usage and limit information. Not returned if includeStorageInfo param is not true. If skipped when editing via PUT method then already set limits will remain.

ElementTypeDescriptionRequired
transactionStorageTransactionStorage

Transaction storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

optional
sessionReplayStorageSessionReplayStorage

Session replay storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

optional
symbolFilesFromMobileAppsSymbolFilesFromMobileApps

Symbol files from mobile apps storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

optional
logMonitoringStorageLogMonitoringStorage

Log monitoring storage usage and limit information on environment level. Not editable when Log monitoring is not allowed by license or not configured on cluster level. If skipped when editing via PUT method then already set limit will remain.

optional
serviceRequestLevelRetentionServiceRequestLevelRetention

Service request level retention settings on environment level. Service code level retention time can't be greater than service request level retention time and both can't exceed one year.If skipped when editing via PUT method then already set limit will remain.

optional
serviceCodeLevelRetentionServiceCodeLevelRetention

Service code level retention settings on environment level. Service code level retention time can't be greater than service request level retention time and both can't exceed one year.If skipped when editing via PUT method then already set limit will remain.

optional
realUserMonitoringRetentionRealUserMonitoringRetention

Real user monitoring retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

optional
syntheticMonitoringRetentionSyntheticMonitoringRetention

Synthetic monitoring retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

optional
sessionReplayRetentionSessionReplayRetention

Session replay retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

optional
logMonitoringRetentionLogMonitoringRetention

Log monitoring retention settings on environment level. Not editable when Log monitoring is not allowed by license or not configured on cluster level. Can be set to any value from 5 to 90 days. If skipped when editing via PUT method then already set limit will remain.

optional
userActionsPerMinuteUserActionsPerMinute

Maximum number of user actions generated per minute on environment level. Can be set to any value from 1 to 2147483646 or left unlimited. If skipped when editing via PUT method then already set limit will remain.

optional
transactionTrafficQuotaTransactionTrafficQuota

Maximum number of newly monitored entry point PurePaths captured per process/minute on environment level. Can be set to any value from 100 to 100000. If skipped when editing via PUT method then already set limit will remain.

optional

The TransactionStorage object

Transaction storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
retentionReductionPercentagestring

Percentage of truncation for new data.

optional
retentionReductionReasonstring

Reason of truncation.

optional
maxLimitinteger

Maximum storage limit [bytes]

optional
currentlyUsedinteger

Currently used storage [bytes]

optional

The SessionReplayStorage object

Session replay storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
retentionReductionPercentagestring

Percentage of truncation for new data.

optional
retentionReductionReasonstring

Reason of truncation.

optional
maxLimitinteger

Maximum storage limit [bytes]

optional
currentlyUsedinteger

Currently used storage [bytes]

optional

The SymbolFilesFromMobileApps object

Symbol files from mobile apps storage usage and limit information on environment level. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitinteger

Maximum storage limit [bytes]

optional
currentlyUsedinteger

Currently used storage [bytes]

optional

The LogMonitoringStorage object

Log monitoring storage usage and limit information on environment level. Not editable when Log monitoring is not allowed by license or not configured on cluster level. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitinteger

Maximum storage limit [bytes]

optional
currentlyUsedinteger

Currently used storage [bytes]

optional

The ServiceRequestLevelRetention object

Service request level retention settings on environment level. Service code level retention time can't be greater than service request level retention time and both can't exceed one year.If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The ServiceCodeLevelRetention object

Service code level retention settings on environment level. Service code level retention time can't be greater than service request level retention time and both can't exceed one year.If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The RealUserMonitoringRetention object

Real user monitoring retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The SyntheticMonitoringRetention object

Synthetic monitoring retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The SessionReplayRetention object

Session replay retention settings on environment level. Can be set to any value from 1 to 35 days. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The LogMonitoringRetention object

Log monitoring retention settings on environment level. Not editable when Log monitoring is not allowed by license or not configured on cluster level. Can be set to any value from 5 to 90 days. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitInDaysinteger

Maximum retention limit [days]

optional
currentlyUsedInMillisinteger

Current data age [milliseconds]

optional
currentlyUsedInDaysinteger

Current data age [days]

optional

The UserActionsPerMinute object

Maximum number of user actions generated per minute on environment level. Can be set to any value from 1 to 2147483646 or left unlimited. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitinteger

Maximum traffic [units per minute]

optional

The TransactionTrafficQuota object

Maximum number of newly monitored entry point PurePaths captured per process/minute on environment level. Can be set to any value from 100 to 100000. If skipped when editing via PUT method then already set limit will remain.

ElementTypeDescriptionRequired
maxLimitinteger

Maximum traffic [units per minute]

optional

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"name": "example environment",
"state": "ENABLED",
"tags": [
"tag1",
"tag2"
],
"trial": false
}

Response

Response codes

CodeTypeDescription
201EnvironmentShortRepresentation

Success. The new environment has been created. The response body contains the ID, the name and also a token management token if 'createToken' is 'true'.

204-

Success. The environment has been updated. Response doesn't have a body.

400-

Failed. The input is invalid.

Response body objects

The EnvironmentShortRepresentation object

The short representation of an environment.

ElementTypeDescription
idstring

The ID of the Dynatrace entity.

namestring

The name of the Dynatrace entity.

descriptionstring

A short description of the Dynatrace entity.

tokenManagementTokenstring

A token with the 'Token management' permission. Can be used to within the newly created environment to create other tokens for configuring this environment. This value is only set if an environment was created with the query parameter 'createToken=true'.

Response body JSON model

{
"id": "string",
"name": "string",
"description": "string",
"tokenManagementToken": "string"
}

Example

Disables the environment with identifier 19a963a7-b19f-4382-964a-4df674c8eb8e.

Curl

curl -X PUT "https://myManaged.cluster.com/api/cluster/v2/environments/19a963a7-b19f-4382-964a-4df674c8eb8e?createToken=false" -H "accept: application/json; charset=utf-8" -H "Authorization: Api-Token fSRCdB7PQDSdFVANvNfSF" -H "Content-Type: application/json; charset=utf-8" -d "
{\"name\":\"MyNewTeam\",\"id\":\"19a963a7-b19f-4382-964a-4df674c8eb8e\",\"trial\":false,\"state\":\"DISABLED\",\"tags\":[\"owner:john.wicked@dynatrace.com\",\"department:finance\"]}

Request URL

https://myManaged.cluster.com/api/cluster/v2/environments/19a963a7-b19f-4382-964a-4df674c8eb8e?createToken=false

Request body

{
"name": "MyNewTeam",
"state": "DISABLED"
}

Response body

Response doesn't have a body.

Response code

204