Synthetic locations API - PUT a location
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 |
|
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
locationId | string |
The DESK entity ID of the private synthetic location to be updated. |
path | required |
body | PrivateSyntheticLocation |
The JSON body of the request. Contains updated parameters of the 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 DESK 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, |
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 |
nodes | string[] |
A list of synthetic nodes belonging to a location. |
required |
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"
]
}
Possible values
Possible values for the type element in the PrivateSyntheticLocation object:
- PUBLIC
- PRIVATE
- CLUSTER
Response format
A successful request doesn't return any content.
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.dexp.ae/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.dexp.ae/api/v1/synthetic/locations/SYNTHETIC_LOCATION-8F419D1B53639A45
Request body
api-examples/synthetic/locations/put-location.json
{
"type": "PRIVATE",
"name": "Linz",
"countryCode": "AT",
"regionCode": "AU04",
"city": "Linz",
"latitude": 48.306351,
"longitude": 14.287399,
"nodes": [
"93302281",
"353074222"
]
}
Response code
204