@dt-esa/dynatrace-api-client
v2.3.6
Published
A dependency map can be found [here](https://npmgraph.js.org/?q=@dt-esa/dynatrace-api-client).
Downloads
323
Keywords
Readme
Use VS Code and Typescript for typings.
A dependency map can be found here.
Create an API instance
const api = new DynatraceTenantAPI({
url: process.env['TENANT_URL'],
token: process.env['TENANT_TOKEN']
});
This will connect to the specified Dynatrace instance and validate that connectivity has been established. If there is a failure, said failure will be emitted via the global console object.
Make an API call
(async () => {
let hosts = await api.v1.entity.getHosts();
let processes = await api.v1.entity.getProcesses();
let myHost = await api.v1.entity.getSingleHost("HOST-1234567890abcdef");
let data = await api.v1.entity.getApplications();
})();
Environment API (v1, v2, config)
const api = new DynatraceTenantAPI({
url: process.env['TENANT_URL'],
token: process.env['TENANT_TOKEN']
});
Environment API V1
const api = new DynatraceEnvironmentAPIV1({
url: process.env['TENANT_URL'],
token: process.env['TENANT_TOKEN']
});
Environment API V2
const api = new DynatraceEnvironmentAPIV2({
url: process.env['TENANT_URL'],
token: process.env['TENANT_TOKEN']
});
Environment Config API
const api = new DynatraceConfigurationAPI({
url: process.env['TENANT_URL'],
token: process.env['TENANT_TOKEN']
});
Cluster Management API V1
const cmc = new DynatraceClusterManagementAPIV1({
url: process.env['CLUSTER_URL'],
token: process.env['CLUSTER_TOKEN']
});
Cluster Management API V2
const cmc = new DynatraceClusterManagementAPIV2({
url: process.env['CLUSTER_URL'],
token: process.env['CLUSTER_TOKEN']
});
Account Management API
const iam = new DynatraceAccountManagementAPI({
token: process.env['ACCOUNT_TOKEN']
});