Header background

Automate your monitoring orchestration with the new Environment API (Early Adopter)

With the newly released Environment API, you can easily tie Dynatrace into your self-service pipeline and automate your monitoring orchestration.

In today’s dynamic environments, you can’t afford to manually bootstrap new monitoring environments. Automatic monitoring orchestration—the ability to automatically create, set up, and deprovision monitoring environments—can make or break your business.

We’re happy to announce that the new Environment API is now available in the Cluster API in an Early Adopter release. You can now tie Dynatrace into your self-service pipeline and programmatically create, update, or delete monitoring environments as necessary.

Easily onboard new users, get an overview of your existing environments, and more

The /environments endpoint makes it possible to automate the provisioning of monitoring environments on your cluster.

  • Easily onboard new users by automatically providing them with a trial environment

Now you have the option of automatically creating new trial environments, which helps you when onboarding new users.

  • Get an overview of your existing environments

The API allows you to get an overview of your existing environments, with a variety of sort and filter options.

  • Easily manage environments by tagging, sorting, and filtering

To make discoverability and referencing environments more flexible, the new API supports tagging. You can use tags to enrich the details of your environments, so you can attach custom properties to your environment that can be used to filter search results. You can also sort environments by name or creation date.

  • Deprovision environments as required

Depending on your workflow, you can decide to keep environments running, set them to inactive, or completely delete them.

How to get started

To utilize this new endpoint, you need to create a Service Provider API token in the Cluster Management Console.

Service Provider API token creation in CMC

The endpoint is designed in a RESTful way, so the typical resource layout with all CRUD functionality is available. When creating a new environment, you can use either the POST or PUT operations.

  • With POST, the system automatically creates an environment ID for you.
  • With PUT, the environment ID can be supplied to the system, which can be handy if the environment is linked to other resources in your operations.

Note: Be aware that environment IDs are unique and can’t be reused. For more flexibility, use tags instead.

New /environments endpoint

The JSON response provides all the important properties of a Dynatrace monitoring environment. To get more information on the capabilities of all endpoints, please check out the Dynatrace API explorer.

{
  "totalCount": 0,
  "pageSize": 0,
  "nextPageKey": "string",
  "environments": [
    {
      "name": "example environment",
      "state": "ENABLED",
      "tags": [
        "tag1",
        "tag2"
      ],
      "trial": false
    }
  ]
}

Token creation

POST /environments?createToken=true

To automate beyond the creation of the environment itself, you can also automatically create a management token for the respective environment. This token can then be used to further set up the environment using the Dynatrace Environment and Configuration APIs.

Early Adopter release

This is the current state of the Environment API, and we will make more functionality available soon. Please stay tuned for more, and, as always, we want to hear from you about what’s working and what’s not working for you. Share your feedback with us at Dynatrace answers.