Synthetic locations API - POST a location
We have a new version of this API—Synthetic API v2. Check it out!
Creates a new private synthetic location. For more details about synthetic location creation, see Create a private synthetic location.
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 |
|
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.
Parameter
To find all model variations that depend on the type of the model, see JSON models.
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | PrivateSyntheticLocation |
The JSON body of the request. Contains parameters of the new private synthetic location. |
body | optional |
Body format
The PrivateSyntheticLocation object
Configuration of a synthetic location.
countryCode, regionCode, city parameters are optional as they can be retrieved based on latitude and longitude of location.
The actual set of fields depends on the type of the location.
Element | Type | Description | Required |
---|---|---|---|
entityId | string |
The Dynatrace entity ID of the location. |
required |
type | string |
Defines the actual set of fields depending on the value. See one of the following objects:
|
required |
name | string |
The name of the location. |
required |
countryCode | string |
The country code of the location. Use the alpha-2 code of the ISO 3166-2 standard, (for example, |
optional |
regionCode | string |
The region code of the location. For the USA or Canada use ISO 3166-2 state codes (without For the rest of the world use FIPS 10-4 codes. |
optional |
city | string |
The city of the location. |
optional |
latitude | number |
The latitude of the location in |
required |
longitude | number |
The longitude of the location in |
required |
status | string |
The status of the location:
|
optional |
nodes | string[] |
A list of synthetic nodes belonging to the location. You can retrieve the list of available nodes with the GET all nodes call. |
required |
availabilityLocationOutage | boolean |
The alerting of location outage is enabled ( |
optional |
availabilityNodeOutage | boolean |
The alerting of node outage is enabled ( If enabled, the outage of any node in the location triggers an alert. |
optional |
locationNodeOutageDelayInMinutes | integer |
Alert if the location or node outage lasts longer than X minutes. Only applicable when availabilityLocationOutage or availabilityNodeOutage is set to |
optional |
availabilityNotificationsEnabled | boolean |
The notifications of location and node outage is enabled ( |
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",
"availabilityLocationOutage": false,
"availabilityNodeOutage": false,
"availabilityLocationNodeOutageDelayInMinutes": 5,
"availabilityNotificationsEnabled": true
}
Response
Response codes
Code | Description |
---|---|
200 | Success |
Response body
The EntityIdDto object
A DTO for entity ID.
Element | Type | Description |
---|---|---|
entityId | string | Entity ID to be transferred |
{
"entityId": "string"
}
Example
In this example, the request creates a new private synthetic location. This location lies in Linz, Austria. It uses the synthetic node with the ID of 93302281.
The API token is passed in the Authorization header.
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 POST \
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations \
-H 'Authorization: Api-Token abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
-d '{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281"
]
}
'
Request URL
https://mySampleEnv.live.dynatrace.com/api/v1/synthetic/locations
Request body
{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281"
]
}
Response body
{
"entityId": "SYNTHETIC_LOCATION-8F419D1B53639A45"
}
Response code
200