Synthetic locations API - PUT a location
We have a new version of this API—Synthetic API v2. Check it out!
Updates an existing private synthetic location.
The request consumes an application/json
payload.
This request is an Early Adopter release and may be changed in non-compatible way.
PUT |
|
Authentication
To execute this request, you need the Create and read synthetic monitors, locations, and nodes (ExternalSyntheticIntegration
) permission assigned to your API token. To learn how to obtain and use it, see Tokens and authentication.
Parameters
To find all model variations that depend on the type of the model, see JSON models.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
locationId | string |
The Dynatrace entity ID of the synthetic location to be updated. |
path | required |
body | SyntheticLocationUpdate |
The JSON body of the request. Contains updated parameters of the private synthetic location or the status of the location. |
body | optional |
Body format
The SyntheticLocationUpdate object
The update of a synthetic location. The actual object depends on the type of the location.
Element | Type | Description | Required |
---|---|---|---|
type | string |
Defines the actual set of fields depending on the value. See one of the following objects:
|
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.
{
"type": "PRIVATE",
"name": "Linz Location",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281"
],
"status": "ENABLED"
}
Response
Parameter | Type | Description | In | Required |
---|---|---|---|---|
locationId | string |
The Dynatrace entity ID of the synthetic location to be updated. |
path | required |
body | SyntheticLocationUpdate |
The JSON body of the request. Contains updated parameters of the private synthetic location or the status of the location. |
body | optional |
Body format
The SyntheticLocationUpdate object
The update of a synthetic location. The actual object depends on the type of the location.
Element | Type | Description | Required |
---|---|---|---|
type | string |
Defines the actual set of fields depending on the value. See one of the following objects:
|
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.
{
"type": "PRIVATE",
"name": "Linz Location",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281"
],
"status": "ENABLED"
}
Example
In this example, the request updates the private synthetic location from the POST request example. It changes the name of the location to Linz and adds the synthetic node with the ID of 353074222.
The API token is passed in the Authorization header.
The response code of 204 indicates that the update was successful.
You can download or copy the example request body to try it out on your own. Be sure to replace the list of nodes with nodes available in your environment.
Curl
curl -X PUT \
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations/SYNTHETIC_LOCATION-8F419D1B53639A45 \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"type": "PRIVATE",
"name": "Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281",
"353074222"
]
}
'
Request URL
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations/SYNTHETIC_LOCATION-8F419D1B53639A45
Request body
{
"type": "PRIVATE",
"name": "Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281",
"353074222"
]
}
Response code
204