App Settings
Retrieve, update and manage app settings.
npm install @dynatrace-sdk/client-app-settings
appSettingsObjectsClient
import { appSettingsObjectsClient } from '@dynatrace-sdk/client-app-settings';
deleteAppSettingsObjectByObjectId
Deletes the specified settings object
Required scope: app-settings:objects:write Required permission: app-settings:objects:write
Parameters
Name | Type | Description |
---|---|---|
config.objectId*required | string | The ID of the required settings object. |
config.optimisticLockingVersion*required | string | The version of the object for optimistic locking. You can use it to detect simultaneous modifications by different users. It is generated upon retrieval (GET requests). If set on update (PUT request) or deletion, the update/deletion will be allowed only if there wasn't any change between the retrieval and the update. |
Returns
Return type | Status code | Description |
---|---|---|
void | 204 | Success. Response doesn't have a body. |
Throws
Error Type | Error Message |
---|---|
AppSettingsErrorEnvelopeError | Failed. The input is invalid. | Failed. Forbidden. | Failed. The requested resource doesn't exist. | Failed. Conflicting resource. |
Code example
import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";
const data =
await appSettingsObjectsClient.deleteAppSettingsObjectByObjectId(
{ objectId: "...", optimisticLockingVersion: "..." },
);
getAppSettingsObjectByObjectId
Gets the specified settings object
Required scope: app-settings:objects:read Required permission: app-settings:objects:read
Gets the specified settings object. Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.
Parameters
Name | Type | Description |
---|---|---|
config.objectId*required | string | The ID of the required settings object. |
Returns
Return type | Status code | Description |
---|---|---|
AppSettingsObject | 200 | Success |
Throws
Error Type | Error Message |
---|---|
AppSettingsErrorEnvelopeError | Failed. The input is invalid. | Failed. Forbidden. | No object available for the given objectId |
Code example
import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";
const data =
await appSettingsObjectsClient.getAppSettingsObjectByObjectId(
{ objectId: "..." },
);
getAppSettingsObjects
Lists persisted settings objects
Required scope: app-settings:objects:read Required permission: app-settings:objects:read
Lists persisted settings objects for selected schemas.
If nothing is persisted or if all persisted settings objects are not accessible due to missing permissions, no items will be returned.
To query the effective values (including schema defaults) please see getEffectiveAppSettingsValues.
Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.
Parameters
Name | Type | Description |
---|---|---|
config.addFields | string | A list of fields to be included to the response. The provided set of fields extends the default set. Specify the required top-level fields, separated by commas (for example, summary,value). Supported fields: objectId, version, summary, searchSummary, schemaId, schemaVersion, modificationInfo, resourceContext, value. Default fields: objectId, version. |
config.pageKey | 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 page-key query parameter. When the page-key is set to obtain subsequent pages, you must omit all other query parameters. |
config.pageSize | number | The amount of settings objects in a single response payload. The maximal allowed page size is 500. If not set, 100 is used. |
config.schemaIds | string | A list of comma-separated schema IDs to which the requested objects belong. To load the first page, when the nextPageKey is not set, this parameter is required. |
Returns
Return type | Status code | Description |
---|---|---|
AppSettingsObjectsList | 200 | Success. Accessible objects returned. |
Throws
Error Type | Error Message |
---|---|
AppSettingsErrorEnvelopeError | Failed. The input is invalid. | Failed. Forbidden. | Failed. The specified schema was not found. |
Code example
import { appSettingsObjectsClient } from "@dynatrace-sdk/client-app-settings";
const data =
await appSettingsObjectsClient.getAppSettingsObjects();
getEffectiveAppSettingsValues
Lists effective settings values
Required scope: app-settings:objects:read Required permission: app-settings:objects:read
Lists effective settings values for selected schemas. If no object is persisted for a schema with "multiObject": false, the default value as defined in the schema will be returned.
Properties of type secret will be included in plain text if the call originates from a serverless function of your app; they will have irreversibly masked values otherwise. This protects these secrets from leaking to users of your app or other third parties.