Remote environments API - PUT a remote environment configuration

Updates the specified remote environment configuration. If a configuration with the specified ID doesn't exist, a new one is created.

The request consumes and produces an application/json payload.

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

Parameters

Parameter Type Description In Required
id string

The ID of the configuration to be updated.

If you set the ID in the body as well, it must match this ID.

path required
body RemoteEnvironmentConfig

The JSON body of the request. Contains updated parameters of the remote environment configuration.

body optional

The RemoteEnvironmentConfig object

Configuration of a remote environment.

Element Type Description Required
id string

The ID of the configuration.

optional
displayName string

The name of the configuration, displayed in the UI.

required
uri string

The URI of the remote environment.

required
token string

The API token granting access to the remote environment.

The token must have the Fetch data from a remote environment (RestRequestForwarding) scope. You can create such a token only via Tokens API.

For security reasons, GET requests return this field as null.

required
networkScope string

The network scope of the remote environment:

  • EXTERNAL: The remote environment is located in an another network.
  • INTERNAL: The remote environment is located in the same network.
  • CLUSTER: The remote environment is located in the same cluster.

Dynatrace SaaS can only use EXTERNAL.

If not set, EXTERNAL is used.

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

The short representation of a remote environment.

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

The URI of the remote environment.

networkScope string

The network scope of the remote environment:

  • EXTERNAL: The remote environment is located in an another network.
  • INTERNAL: The remote environment is located in the same network.
  • CLUSTER: The remote environment is located in the same cluster.

Dynatrace SaaS can only use EXTERNAL.

If not set, EXTERNAL is used.

Response codes

Code Description
201

Success. A new remote environment configuration has been created. The response contains the ID of the new configuration.

204

Success. The configuration has been updated. The response doesn't have a body.

400

Failed. The input is invalid.

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.

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

Response codes

Code Description
204 Validated. The submitted configuration is valid. Response doesn't have a body
400 Failed. The input is invalid.

Example

In this example, the request updated the API token of the Pre-Production remote environment created in the POST request example.

The API token is passed in the Authorization header.

Curl

curl -X PUT \
  https://mySampleEnv.live.dynatrace.com/api/config/v1/remoteEnvironments/c89b9d9f-8c59-4c5b-b7ef-1a082d11e9ba \
  -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": "0987654321jihgfedcba",
  "networkScope": "EXTERNAL"
}
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/config/v1/remoteEnvironments/c89b9d9f-8c59-4c5b-b7ef-1a082d11e9ba

Request body

api-examples/config/remote-env/put.json
Download
{
  "id": "c89b9d9f-8c59-4c5b-b7ef-1a082d11e9ba",
  "displayName": "Pre-Production",
  "uri": "https://PreProd.live.dynatrace.com",
  "token": "0987654321jihgfedcba",
  "networkScope": "INTERNAL"
}

Response code

204