Skip to main content

Platform management

  • Reference

Basic read-only information about the currently logged-in environment

Latest (V1)
npm install @dynatrace-sdk/client-platform-management-service

effectivePermissionsClient

import { effectivePermissionsClient } from '@dynatrace-sdk/client-platform-management-service';

resolveEffectivePermissions

effectivePermissionsClient.resolveEffectivePermissions(config): Promise<EffectivePermissions>

Get the effective permissions of the calling user in the environment

One of the following scopes is required:

  • app-engine:apps:run
  • app-engine:functions:run
  • platform-management:effective-permissions:resolve

This endpoint resolves whether the caller (based on the provided OAuth token when calling this endpoint) has the requested permissions (see IAM policy reference for a list of permissions and their conditions). It resolves the permission via IAM and uses the optional context to evaluate conditional results. The provided context consists of key-value pairs where the key must correspond to the name of a supported condition of the requested permission and the value is the value that it this condition is evaluated against given a user's policies.

For each requested permission the response indicates whether the user has the requested permission ("granted": "true"), does not have it ("granted": "false") or only has it conditionally ("granted": "condition"), meaning that the provided values for conditions in the context are not sufficient to decide whether the caller has the permission.

For environment API v2 scopes (i.e. scopes starting with environment-api:) roles on the environment and management zone level will also be considered.

> ℹ️ Settings permission requests for scopes settings:schemas:read, settings:objects:read, and settings:objects:write will always result in a result with "granted": "condition". You can use the dedicated effective permissions endpoint for settings instead.

> ℹ️ Apps must list all permissions they check in the list of scopes in their app configuration.

You can learn more about querying user permissions on Dynatrace Developer.

Parameters

NameType
config.body*requiredResolutionRequest

Throws

Error TypeError Message
DefaultErrorResponseUnexpected error

Code example

import { effectivePermissionsClient } from "@dynatrace-sdk/client-platform-management-service";

const data =
await effectivePermissionsClient.resolveEffectivePermissions(
{
body: {
permissions: [
{ permission: "state:app-states:write" },
],
},
},
);

environmentInformationClient

import { environmentInformationClient } from '@dynatrace-sdk/client-platform-management-service';

getEnvironmentInformation

environmentInformationClient.getEnvironmentInformation(config): Promise<EnvironmentInfo>

Get basic environment information

One of the following scopes is required:

  • app-engine:apps:run
  • app-engine:functions:run
  • platform-management:environments:read

Get basic information about the current environment.

Returns

Return typeStatus codeDescription
EnvironmentInfo200Info about the requested environment.

Throws

Error TypeError Message
BadRequestBad request
UnauthorizedAuthentication failed
NotFoundResource not found
ServiceUnavailableThere is a temporary problem in the backend.
DefaultErrorResponseUnexpected error

Code example

import { environmentInformationClient } from "@dynatrace-sdk/client-platform-management-service";

const data =
await environmentInformationClient.getEnvironmentInformation();

environmentSettingsClient

import { environmentSettingsClient } from '@dynatrace-sdk/client-platform-management-service';

getEnvironmentSettings

environmentSettingsClient.getEnvironmentSettings(config): Promise<SettingsResponse>

Get settings for the environment

One of the following scopes is required:

  • app-engine:apps:run
  • app-engine:functions:run
  • platform-management:environments:read

Gets settings for environment.

Returns

Return typeStatus codeDescription
SettingsResponse200The settings for the requested environment

Throws

Error TypeError Message
BadRequestBad request
UnauthorizedAuthentication failed
NotFoundResource not found
ServiceUnavailableThere is a temporary problem in the backend.
DefaultErrorResponseUnexpected error

Code example

import { environmentSettingsClient } from "@dynatrace-sdk/client-platform-management-service";

const data =
await environmentSettingsClient.getEnvironmentSettings();

licenseInformationClient

import { licenseInformationClient } from '@dynatrace-sdk/client-platform-management-service';

getLicense

licenseInformationClient.getLicense(config): Promise<License>

Get basic license information

One of the following scopes is required:

  • app-engine:apps:run
  • app-engine:functions:run
  • platform-management:environments:read

Get basic license information about the current environment.

Returns

Return typeStatus codeDescription
License200The license info of the requested environment.

Throws

Error TypeError Message
BadRequestBad request
UnauthorizedAuthentication failed
NotFoundResource not found
ServiceUnavailableThere is a temporary problem in the backend.
DefaultErrorResponseUnexpected error

Code example

import { licenseInformationClient } from "@dynatrace-sdk/client-platform-management-service";

const data = await licenseInformationClient.getLicense();

getLicenseSettings

licenseInformationClient.getLicenseSettings(config): Promise<LicenseSettingsResponse>

Get basic license settings information

One of the following scopes is required:

  • app-engine:apps:run
  • app-engine:functions:run
  • platform-management:environments:read

Get basic license settings information about the current environment

Parameters

NameType
config.keysArray<string>

Returns

Return typeStatus codeDescription
LicenseSettingsResponse200The license settings info of the requested environment.

Throws

Error TypeError Message
BadRequestBad request
UnauthorizedAuthentication failed
NotFoundResource not found
ServiceUnavailableThere is a temporary problem in the backend.
DefaultErrorResponseUnexpected error

Code example

import { licenseInformationClient } from "@dynatrace-sdk/client-platform-management-service";

const data =
await licenseInformationClient.getLicenseSettings();

Types

EffectivePermission

NameTypeDescription
contextArray<PermissionContext>
granted*required"true" | "false" | "condition"true: The caller has the permission false: The caller does not have the permission condition: The caller conditionally has the permission or in case of scopes starting with 'environment-api:' the caller only has the permission for specific management zones.
permission*requiredstring

EffectivePermissions

type: Array<EffectivePermission>

EnvironmentInfo

NameType
blockTimeDate
createTime*requiredDate
environmentId*requiredstring
state*required"BEING_CREATED" | "CREATED_NOT_INITIALIZED" | "ACTIVE" | "DEACTIVATED" | "BEING_DELETED" | "BLOCKED" | "DELETION_FAILED" | "PRE_ALLOCATED"
type*required"INTERNAL" | "CUSTOMER" | "SELF_MONITORING"

Error

Standard error response

NameType
code*requirednumber
message*requiredstring

ErrorEnvelope

NameTypeDescription
error*requiredErrorStandard error response

License

NameType
platformSubscription*requiredboolean
trial*requiredboolean

LicenseSetting

NameType
key*requiredstring
value*requiredstring

LicenseSettingsResponse

NameType
settings*requiredArray<LicenseSetting>

PermissionContext

NameType
key*requiredstring
value*requiredstring

ResolutionRequest

NameType
permissions*requiredArray<SinglePermissionRequest>

SettingsResponse

NameTypeDescription
activeTrialSubscriptionEndDateDateDate when the trial period ends.
chatEnabled*requiredboolean
countryCodestringISO3166-1 alpha-2 two letter country code. See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

SinglePermissionRequest

Optional generic set of context data

NameType
contextnull | Array<PermissionContext>
permission*requiredstring

Enums

EffectivePermissionGranted

⚠️ Deprecated Use literal values.

true: The caller has the permission false: The caller does not have the permission condition: The caller conditionally has the permission or in case of scopes starting with 'environment-api:' the caller only has the permission for specific management zones.

Enum keys

Condition | False | True

EnvironmentInfoType

⚠️ Deprecated Use literal values.

Enum keys

Customer | Internal | SelfMonitoring

EnvironmentState

⚠️ Deprecated Use literal values.

Enum keys

Active | BeingCreated | BeingDeleted | Blocked | CreatedNotInitialized | Deactivated | DeletionFailed | PreAllocated

Still have questions?
Find answers in the Dynatrace Community