Remote environments API - POST a remote environment configuration

Creates a new remote environment configuration.

Before creation, Dynatrace verifies the provided URI and token by trying to reach the environment using the token for authentication. If the attempt fails, no remote environment configuration is created.

The request consumes and produces an application/json payload.

This request is an early adopter release and may be changed in non compatible way.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/remoteEnvironments
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/remoteEnvironments

Parameters

The body must not provide an ID. An ID is assigned automatically by the Dynatrace server.

Parameter Type Description In Required
body RemoteEnvironmentConfig body optional

The RemoteEnvironmentConfig object

Element Type Description Required
id string

The ID of the entity.

optional
displayName string

The display name of the entity

required
uri string

URI that already contains tenant information

required
token string

API-Token to use for forwarding REST requests to remote environment

required
networkScope string

Scope of the target environment, if not set external is used. EXTERNAL: Target lives within other network (Only possible value for SAAS cluster) INTERNAL: Target lives within same network CLUSTER: Target lives within the same cluster

The networkScope element can hold these values.
optional

Possible values

Possible values for the networkScope element in the RemoteEnvironmentConfig object:

  • CLUSTER
  • EXTERNAL
  • INTERNAL

Response format

The RemoteEnvironmentConfigStub object

Element Type Description
id string

The ID of the Dynatrace entity.

name string

The name of the Dynatrace entity.

description string

A short description of the Dynatrace entity.

uri string

URI that already contains tenant information

networkScope string

Scope of the target environment.

Validate payload

We recommend that you validate the payload before submitting it with an actual request. A response code of 204 indicates a valid payload.

This request is an early adopter release and may be changed in non compatible way.

POST
  • Managed https://{your-domain}/e/{your-environment-id}/api/config/v1/remoteEnvironments/validator
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/config/v1/remoteEnvironments/validator

Response codes

Code Description
204 Validated. The submitted configuration is valid. Response does not have a body
400 Failed. The input is invalid!

Example

In this example, the request creates a new remote environment configuration, referring to the Pre-Production environment.

The API token is passed in the Authorization header.

Curl

curl -X POST \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/remoteEnvironments/ \
  -H 'Accept: application/json' \  
  -H 'Authorization: Api-token abcdefjhij1234567890' \
  -H 'Content-Type: application/json' \
  -d '{
  "displayName": "Pre-Production",
  "uri": "https://preProd.live.dynatrace.com",
  "token": "1234567890abcdefjhij",
  "networkScope": "EXTERNAL"
}
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/remoteEnvironments/

Request body

api-examples/config/remote-env/post.json
Download
{
  "displayName": "Pre-Production",
  "uri": "https://PreProd.live.dynatrace.com",
  "token": "1234567890abcdefjhij",
  "networkScope": "INTERNAL"
}

Response body

{
  "id": "c89b9d9f-8c59-4c5b-b7ef-1a082d11e9ba",
  "name": "Pre-Production",
  "uri": "https://preProd.live.dynatrace.com",
  "networkScope": "EXTERNAL"
}

Response code

201