Header background

Automate your Dynatrace deployment with our ‘Swaggerized’ Cluster Management API

Automating the deployment and provisioning of Dynatrace Managed clusters is one of the hottest topics for large-scale enterprises. In addition to Dynatrace Managed cluster installation being a straightforward process, it’s now also possible to change your cluster configuration during or after an automated setup process and to read the actual cluster configuration using a simple REST API.

Dynatrace embraces the idea of self-driving IT and full automation through APIs. As a matter of fact, Dynatrace recently joined the OpenAPI initiative (part of the Linux Foundation) to provide a machine-readable REST API specification. This OpenAPI specification (OAS)—formerly known as the Swagger specification—allows API consumers to automatically verify the interface and to automatically generate language bindings for many supported languages.

Another positive side-effect of providing a ‘Swaggerized’ REST API is the fully automated generation of API documentation, which even provides direct interaction with the API itself.

The Cluster Management API documentation lists all available REST endpoints with their methods along with possible input and output data type definitions. API descriptions can be downloaded as machine-readable JSON and YAML files that adhere to the OpenAPI 2.0 specification. At the bottom of each API page, you’ll find a link to the formal OpenAPI specification that can be used in any OAS compatible tool, such as within the Swagger editor.

To access the Cluster Management API specification

  1. Expand the user menu in the upper-right corner of the Cluster Management Console (CMC).
  2. Click the Cluster Management API link to open the Cluster Management API documentation, which is automatically generated from our Swagger specification (i.e., class and method-level annotations).

API authentication

If when you access the Cluster Management API documentation for the first time, you see a warning (a red exclamation point icon) in the upper-right corner of any operation detail pane (see example below), your access to the documentation hasn’t yet been authenticated.

To enable authentication, you must create an API authentication token or use an existing token, as explained below. If you don’t see such a warning, you can proceed with executing API functions on your cluster.

To create an API token for authentication

  1. Select Settings from the navigation menu and click API tokens.
  2. Type a value for the secure access API token into the text field.
  3. Click the Generate token button to activate the new token.
  4. Copy the new token to your clipboard and return to the Cluster Management API documentation.
  5. Click the red exclamation-point warning button displayed within any operation detail pane.
  6. Paste the copied API token into the Value field and enclose the token in the form:
    Api-Token <your-api-token>
  7. Click the Authorize button.

Execute API functions

Once you’ve accessed the Cluster Management API documentation with proper authentication, you can populate each REST endpoint with parameters and execute any listed API operation by clicking the respective Execute button. In future releases, we plan to allow HTTP Basic authentication via your CMC username and password, in addition to the token-based approach to authentication explained above.

To execute API operations against your actual Dynatrace Cluster

  1. Expand the user menu in the upper-right corner of the Cluster Management Console (CMC).
  2. Click the Cluster Management API link to open the Cluster Management API documentation.
  3. Scroll through the available operations and click the Execute button of any operation you want to immediately execute within your cluster.

Note: All changes you push through the API are real and will have an immediate effect on your Dynatrace Managed cluster.

The Dynatrace Cluster Management API, along with its OpenAPI specification (OAS), is just the first step towards fully automated configuration of new Dynatrace release rollouts. So stay tuned. We’ll soon release a new environment configuration API that enables full configuration of each monitoring environment, across both Dynatrace SaaS and Managed deployments.