Dynatrace Server SDK

Provides an easy to use integration with Dynatrace Server

License

License

Categories

Categories

Dynatrace Application Testing & Monitoring Application Performance Monitoring (APM)
GroupId

GroupId

com.dynatrace.sdk
ArtifactId

ArtifactId

server-rest-sdk
Last Version

Last Version

7.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Dynatrace Server SDK
Provides an easy to use integration with Dynatrace Server
Project URL

Project URL

https://github.com/Dynatrace/Dynatrace-Server-REST-Java-SDK
Source Code Management

Source Code Management

https://github.com/Dynatrace/Dynatrace-Server-REST-Java-SDK

Download server-rest-sdk

How to add to project

<!-- https://jarcasting.com/artifacts/com.dynatrace.sdk/server-rest-sdk/ -->
<dependency>
    <groupId>com.dynatrace.sdk</groupId>
    <artifactId>server-rest-sdk</artifactId>
    <version>7.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.dynatrace.sdk/server-rest-sdk/
implementation 'com.dynatrace.sdk:server-rest-sdk:7.0.0'
// https://jarcasting.com/artifacts/com.dynatrace.sdk/server-rest-sdk/
implementation ("com.dynatrace.sdk:server-rest-sdk:7.0.0")
'com.dynatrace.sdk:server-rest-sdk:jar:7.0.0'
<dependency org="com.dynatrace.sdk" name="server-rest-sdk" rev="7.0.0">
  <artifact name="server-rest-sdk" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.dynatrace.sdk', module='server-rest-sdk', version='7.0.0')
)
libraryDependencies += "com.dynatrace.sdk" % "server-rest-sdk" % "7.0.0"
[com.dynatrace.sdk/server-rest-sdk "7.0.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.eclipse.persistence : org.eclipse.persistence.moxy jar 2.5.0
org.apache.httpcomponents : httpclient jar 4.5.2

test (3)

Group / Artifact Type Version
junit : junit jar 4.11
org.hamcrest : hamcrest-library jar 1.3
com.github.tomakehurst : wiremock jar 2.1.7

Project Modules

There are no modules declared in this project.

Dynatrace Server SDK Build Status

This library provides an easy to use Java implementation of Dynatrace Server REST API.

Table of Contents

Installation

Library is available in maven central repository (starting with version 7.0.0; for previous versions see the Releases page).

Maven

  • Add the following code to the <dependencies> section:
<dependency>
    <groupId>com.dynatrace.sdk</groupId>
    <artifactId>server-rest-sdk</artifactId>
    <version>LATEST_VERSION</version>
</dependency>

Gradle

  • Put the following code in your dependencies block:
compile 'com.dynatrace.sdk:server-rest-sdk:LATEST_VERSION'

Services

The SDK is divided into small modules called services. Each service corresponds to the appropriate Rest API endpoint. Documentation of Rest API endpoints can be found on your local Dynatrace Server: https://DTSERVER:8021/api-docs/current/. General documentation for Server Rest interfaces is available here.

The SDK currently supports a small part of the available interfaces, therefore Pull Requests are highly appreciated.

Each service takes a DynatraceClient as the only parameter in the constructor.

Dynatrace Client

The DynatraceClient holds the Apache HTTPClient under the hood and therefore it is recommended to pass thesame DynatraceClient to all services to avoid multiple client creation.

Constructing

The DynatraceClient can be constructed using two constructors:

public DynatraceClient(ServerConfiguration configuration) {
//...
}
public DynatraceClient(ServerConfiguration configuration, CloseableHttpClient httpClient) {
//...
}

You most likely want to use the first one.

ServerConfiguration is an interface which has a basic implementation: BasicServerConfiguration

The most basic use-case would be to create a DynatraceClient the following way:

DynatraceClient client = new DynatraceClient(new BasicServerConfiguration("username","password"));

You may want to take a look at BasicServerConfiguration source-code for a list and documentation of other constructors.

Test Automation

Creation

import com.dynatrace.sdk.server.testautomation.TestAutomation;
//...
TestAutomation automation = new TestAutomation(DynatraceClient);

Sessions

Creation

import com.dynatrace.sdk.server.sessions.Sessions
//...
Sessions sessions = new Sessions(DynatraceClient);

System Profiles

Creation

import com.dynatrace.sdk.server.systemprofiles.SystemProfiles
//...
SystemProfiles systemProfiles = new SystemProfiles(DynatraceClient);

Server Management

Creation

import com.dynatrace.sdk.server.servermanagement.ServerManagement
//...
ServerManagement serverManagement = new ServerManagement(DynatraceClient);

Building

In order to build the library, one must execute mvn clean install or mvn clean package.

Running tests

The SDK comes with some unit tests, to run them, execute the following command:

mvn clean test

com.dynatrace.sdk

Dynatrace

Dynatrace

Versions

Version
7.0.0