Synthetic locations API v2 - POST a location (Dynatrace Managed)

This API call 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.

Authentication

To execute this request, you need the Service Provider API (ServiceProviderAPI) permission assigned to your API token. Generate your API token via Cluster Management Console (CMC). To learn how to obtain and use it, see Cluster API - Authentication.

Endpoint

/api/cluster/v2/synthetic/locations

Parameter

To find all model variations that depend on the type of the model, see JSON models.

Parameter
Type
Description
In
Required
body

The JSON body of the request. Contains parameters of the new private synthetic location.

body
required

Request body objects

The PrivateSyntheticLocation object

Configuration of a private synthetic location.

Some fields are inherited from the base SyntheticLocation object.

Element
Type
Description
Required
autoUpdateChromium
boolean

Auto upgrade of Chromium is enabled (true) or disabled (false).

optional
availabilityLocationOutage
boolean

Alerting for location outage is enabled (true) or disabled (false). Supported only for private Synthetic locations.

optional
availabilityNodeOutage
boolean

Alerting for node outage is enabled (true) or disabled (false). \n\n If enabled, the outage of any node in the location triggers an alert. Supported only for private Synthetic locations.

optional
availabilityNotificationsEnabled
boolean

Notifications for location and node outage are enabled (true) or disabled (false). Supported only for private Synthetic locations.

optional
city
string

The city of the location.

optional
countryCode
string

The country code of the location.

To fetch the list of available country codes, use the GET all countries request.

optional

Request body JSON model

This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.

{
"autoUpdateChromium": true,
"availabilityLocationNodeOutageDelayInMinutes": 5,
"availabilityLocationOutage": false,
"availabilityNodeOutage": false,
"availabilityNotificationsEnabled": true,
"city": "Linz",
"countryCode": "AT",
"deploymentType": "STANDARD",
"latitude": 48.306351,
"longitude": 14.287399,
"maxActiveGateCount": 5,
"minActiveGateCount": 2,
"namExecutionSupported": false,
"name": "Linz Location",
"nodeNames": {
"93302281": "ActiveGate 1"
},
"nodeSize": "S",
"nodes": [
"93302281"
],
"regionCode": "04",
"status": "ENABLED",
"type": "PRIVATE",
"useNewKubernetesVersion": true
}

Response

Response codes

Code
Type
Description
201

Success. The private location has been created. The response contains the ID of the new location.

4XX

Client side error.

5XX

Server side error.

Response body objects

The SyntheticLocationIdsDto object

A DTO for synthetic Location IDs.

Element
Type
Description
entityId
string

Entity ID to be transferred

geoLocationId
string

GeoLocation ID to be transferred

Response body JSON model

{
"entityId": "string",
"geoLocationId": "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 290433380.

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. You can fetch the list of available nodes with the GET all nodes request.

Curl

curl -L -X POST 'https://mySampleEnv.live.dynatrace.com/api/v2/synthetic/locations' \
-H 'Authorization: Api-Token dt0c01.abc123.abcdefjhij1234567890' \
-H 'Content-Type: application/json' \
--data-raw '{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"city": "Linz",
"status": "ENABLED",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"290433380"
],
"availabilityLocationOutage": false,
"availabilityNodeOutage": false,
"locationNodeOutageDelayInMillis": 5000
}
'

Request URL

https://mySampleEnv.live.dynatrace.com/api/v2/synthetic/locations

Request body

{
"type": "PRIVATE",
"name": "REST example - Linz",
"countryCode": "AT",
"city": "Linz",
"status": "ENABLED",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": ["290433380"],
"availabilityLocationOutage": false,
"availabilityNodeOutage": false,
"locationNodeOutageDelayInMillis": 5000
}

Response body

{
"entityId": "SYNTHETIC_LOCATION-493122BFA29674DC",
"geoLocationId": "GEOLOCATION-96B57899C9B5A3C7"
}

Response code

200