@dynatrace-sdk/client-platform-management-service

中文文档
1.9.0发布于 2026/09/30Apache-2.0TypeScriptESM + CJS近 30 天下载 1.5万
原始使用文档
文档目录30 节
  1. Installation
  2. Getting help
  3. License
  4. effectivePermissionsClient
  5. resolveEffectivePermissions
  6. environmentInformationClient
  7. getEnvironmentInformation
  8. environmentSettingsClient
  9. getEnvironmentSettings
  10. licenseInformationClient
  11. getLicense
  12. getLicenseSettings
  13. Types
  14. EffectivePermission
  15. EffectivePermissions
  16. EnvironmentInfo
  17. Error
  18. ErrorDetails
  19. ErrorEnvelope
  20. License
  21. LicenseSetting
  22. LicenseSettingsResponse
  23. PermissionContext
  24. ResolutionRequest
  25. SettingsResponse
  26. SinglePermissionRequest
  27. Enums
  28. EffectivePermissionGranted
  29. EnvironmentInfoType
  30. EnvironmentState

@dynatrace-sdk/client-platform-management-service

npm License

Overview

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

Installation

npm install @dynatrace-sdk/client-platform-management-service

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.

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

NameTypeDescription
config.keysArray<string>optional array of key(s) for filtering

Example: []

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.

Example: true
permission*requiredstringExample: state:app-states:write

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

NameTypeDescription
code*requirednumberExample: 500
detailsErrorDetails
message*requiredstringExample: Internal server error

ErrorDetails

NameType
missingPermissionsArray<string>
missingScopesArray<string>

ErrorEnvelope

NameTypeDescription
error*requiredErrorStandard error response

License

NameType
platformSubscription*requiredboolean
trial*requiredboolean

LicenseSetting

NameType
key*requiredstring
value*requiredstring

LicenseSettingsResponse

NameType
settings*requiredArray<LicenseSetting>

PermissionContext

NameTypeDescription
key*requiredstringExample: shared:app-id
value*requiredstringExample: dynatrace.notebooks

ResolutionRequest

NameType
permissions*requiredArray<SinglePermissionRequest>

SettingsResponse

NameTypeDescription
activeTrialSubscriptionEndDateDateDate when the trial period ends.

Example: 2025-04-25T10:08:09.193592Z
chatEnabled*requiredboolean
countryCodestringISO3166-1 alpha-2 two letter country code. See: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2

Example: ES

SinglePermissionRequest

Optional generic set of context data

NameTypeDescription
contextnull | Array<PermissionContext>
permission*requiredstringExample: state:app-states:write

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

版本与发布记录

@dynatrace-sdk/client-platform-management-service 共发布 17 个版本,首次发布于 2024/07/01;过去 12 个月发布了 3 个版本。

版本发布日期距今
1.9.0latest2026/09/301 个月前
1.8.12026/08/033 个月前
1.8.02026/06/184 个月前
1.7.02025/07/151.3 年前
1.6.82025/07/011.4 年前
1.6.72025/06/171.4 年前

关于 @dynatrace-sdk/client-platform-management-service 的常见问题

@dynatrace-sdk/client-platform-management-service 是什么?

[](https://opensource.org/licenses/Apache-2

如何安装 @dynatrace-sdk/client-platform-management-service?

在项目目录运行 npm install @dynatrace-sdk/client-platform-management-service,或使用 pnpm add / yarn add / bun add。

@dynatrace-sdk/client-platform-management-service 支持 TypeScript 吗?

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

@dynatrace-sdk/client-platform-management-service 支持 ESM 还是 CommonJS?

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

@dynatrace-sdk/client-platform-management-service 可以商用吗?

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

@dynatrace-sdk/client-platform-management-service 的下载量有多少?

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

@dynatrace-sdk/client-platform-management-service 还在维护吗?

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