Synthetic locations API - POST a location

Creates a new 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
  • Managed https://{your-domain}/e/{your-environment-id}/api/v1/synthetic/locations
  • SaaS https://{your-environment-id}.live.dynatrace.com/api/v1/synthetic/locations

Parameter

Parameter Type Description In Required
body PrivateSyntheticLocation

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

body optional

The PrivateSyntheticLocation object

Configuration of a private synthetic location.

Some fields are inherited from the base SyntheticLocation object.

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:

PUBLIC -> PublicSyntheticLocation PRIVATE -> PrivateSyntheticLocation CLUSTER -> PrivateSyntheticLocation

The type element can hold these values.
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, AT for Austria or PL for Poland).

optional
regionCode string

The region code of the location.

For the USA or Canada use ISO 3166-2 state codes (without US- or CA- prefix), for example, VA for Virginia or OR for Oregon.

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 DDD.dddd format.

required
longitude number

The longitude of the location in DDD.dddd format.

required
nodes string[]

A list of synthetic nodes belonging to a location.

required

Possible values

Possible values for the type element in the PrivateSyntheticLocation object:

  • PUBLIC
  • PRIVATE
  • CLUSTER

Response format

The EntityIdDto object

A DTO for entity ID.

Element Type Description
entityId string

Entity ID to be transferred

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

api-examples/synthetic/locations/post-location.json
Download
{
  "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