Platform Management
Overview
Basic read-only information (e.g. basic license settings) about the currently logged-in environmentnpm install @dynatrace-sdk/client-platform-management-service
effectivePermissionsClient
import { effectivePermissionsClient } from '@dynatrace-sdk/client-platform-management-service';
resolveEffectivePermissions
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
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.
Parameters
Name | Type |
---|---|
config.body*required | ResolutionRequest |
Throws
Error Type | Error Message |
---|---|
DefaultErrorResponse | Unexpected 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
Get basic environment information
One of the following scopes is required:
- app-engine:apps:run
- app-engine:functions:run
Get basic information about the current environment.
Returns
Return type | Status code | Description |
---|---|---|
EnvironmentInfo | 200 | Info about the requested environment. |
Throws
Error Type | Error Message |
---|---|
BadRequest | Bad request |
Unauthorized | Authentication failed |
NotFound | Resource not found |
ServiceUnavailable | There is a temporary problem in the backend. |
DefaultErrorResponse | Unexpected 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
Get settings for the environment
One of the following scopes is required:
- app-engine:apps:run
- app-engine:functions:run
Gets settings for environment.
Returns
Return type | Status code | Description |
---|---|---|
SettingsResponse | 200 | The settings for the requested environment |
Throws
Error Type | Error Message |
---|---|
BadRequest | Bad request |
Unauthorized | Authentication failed |
NotFound | Resource not found |
ServiceUnavailable | There is a temporary problem in the backend. |
DefaultErrorResponse | Unexpected 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
Get basic license information
One of the following scopes is required:
- app-engine:apps:run
- app-engine:functions:run
Get basic license information about the current environment.
Returns
Return type | Status code | Description |
---|---|---|
License | 200 | The license info of the requested environment. |
Throws
Error Type | Error Message |
---|---|
BadRequest | Bad request |
Unauthorized | Authentication failed |
NotFound | Resource not found |
ServiceUnavailable | There is a temporary problem in the backend. |
DefaultErrorResponse | Unexpected error |
Code example
import { licenseInformationClient } from "@dynatrace-sdk/client-platform-management-service";
const data = await licenseInformationClient.getLicense();
getLicenseSettings
Get basic license settings information
One of the following scopes is required:
- app-engine:apps:run
- app-engine:functions:run
Get basic license settings information about the current environment
Parameters
Name | Type |
---|---|
config.keys | Array<string> |
Returns
Return type | Status code | Description |
---|---|---|
LicenseSettingsResponse | 200 | The license settings info of the requested environment. |
Throws
Error Type | Error Message |
---|---|
BadRequest | Bad request |
Unauthorized | Authentication failed |
NotFound | Resource not found |
ServiceUnavailable | There is a temporary problem in the backend. |
DefaultErrorResponse | Unexpected error |
Code example
import { licenseInformationClient } from "@dynatrace-sdk/client-platform-management-service";
const data =
await licenseInformationClient.getLicenseSettings();
Types
EffectivePermission
Name | Type | Description |
---|---|---|
granted*required | EffectivePermissionGranted | 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*required | string |
EffectivePermissions
type: Array<EffectivePermission>
EnvironmentInfo
Name | Type |
---|---|
blockTime | Date |
createTime*required | Date |
environmentId*required | string |
state*required | EnvironmentState |
type*required | EnvironmentInfoType |
Error
Standard error response
Name | Type |
---|---|
code*required | number |
message*required | string |
License
Name | Type |
---|---|
platformSubscription*required | boolean |
trial*required | boolean |
LicenseSetting
Name | Type |
---|---|
key*required | string |
value*required | string |
LicenseSettingsResponse
Name | Type |
---|---|
settings*required | Array<LicenseSetting> |
PermissionContext
Name | Type |
---|---|
key*required | string |
value*required | string |
ResolutionRequest
Name | Type |
---|---|
permissions*required | Array<SinglePermissionRequest> |
SettingsResponse
Name | Type | Description |
---|---|---|
chatEnabled*required | boolean | |
countryCode | string | ISO3166-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
Name | Type |
---|---|
context | Array<PermissionContext> |
permission*required | string |
Enums
EffectivePermissionGranted
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
Enum keys
Customer
| Internal
| SelfMonitoring
EnvironmentState
Enum keys
Active
| BeingCreated
| BeingDeleted
| Blocked
| Deactivated
| DeletionFailed
| PreAllocated