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.
This request is an early adopter release and may be changed in non compatible way.
PUT |
|
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
id | string | path | 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 |
optional |
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request. See the Example expandable section for working sample request.
{
"id": "string",
"displayName": "string",
"uri": "string",
"token": "string",
"networkScope": "EXTERNAL"
}
Possible values
Possible values for the networkScope element in the RemoteEnvironmentConfig object:
- CLUSTER
- EXTERNAL
- INTERNAL
Response format
The RemoteEnvironmentConfig object
Element | Type | Description |
---|---|---|
id | string | The ID of the entity. |
displayName | string | The display name of the entity |
uri | string | URI that already contains tenant information |
token | string | API-Token to use for forwarding REST requests to remote environment |
networkScope | string | Scope of the target environment, if not set |
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. |
{
"id": "string",
"name": "string",
"description": "string",
"uri": "string",
"networkScope": "CLUSTER"
}
Response codes
Code | Description |
---|---|
200 | successful operation |
201 | Configuration was created successfully |
204 | Configuration was updated |
400 | Invalid update input. Configuration was not created |
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 |
|
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 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
{
"id": "c89b9d9f-8c59-4c5b-b7ef-1a082d11e9ba",
"displayName": "Pre-Production",
"uri": "https://PreProd.live.dynatrace.com",
"token": "0987654321jihgfedcba",
"networkScope": "INTERNAL"
}
Response code
204