Skip to main content
Version: Spectra Analyze 9.12.0

Timezone API — Spectra Analyze

This API allows users to set the timezone for the appliance and list available timezones.

Set the timezone for the appliance​

This API allows users to set the timezone for the appliance.

POST api/v1/config/configure-timezone/

Request Format​

Request Parameters

NAMEREQUIREDDESCRIPTIONTYPE
timezoneRequiredTimezone to set for the appliance.application/json

Request Examples

cURL

# Add --insecure before the URL if you are using a self-signed SSL certificate
curl -X 'POST' \
'http://api.example.com/api/v1/config/configure-timezone/' \
-H 'Authorization: Token <token-here>' \
--json '{"timezone": "Europe/Zagreb"}'

Python

import requests

# Change the values of the URL, headers, and data
url = "http://api.example.com/api/v1/config/configure-timezone/"
headers = {
"Authorization": f"Token <token-here>",
"Accept": "application/json",
"Content-Type": "application/json"
}
data = {
"timezone": "Europe/Zagreb"
}

# Add verify=False in the request if you are using a self-signed SSL certificate
response = requests.post(url, headers=headers, json=data, verify=False)

print(response.status_code)
print(response.text)

Response Format​

The response does not return any data or response body.

List available timezones​

This API allows users to list available timezones for the appliance.

GET api/v1/config/list-available-timezones/

Request example

cURL

curl 'http://api.example.com/api/v1/config/list-available-timezones/' \
-H 'Authorization: Token <token-here>'

Response Format​

The response format returns a list of available timezones.

{
"timezones": [
"Africa/Abidjan",
"Africa/Accra",
"Africa/Addis_Ababa",
"Africa/Algiers",
"Africa/Asmara",
"Africa/Bamako",
"Africa/Bangui",
"Africa/Banjul",
"Africa/Bissau",
"Africa/Blantyre",
"Africa/Brazzaville",
"Africa/Bujumbura",
"Africa/Cairo",
"Africa/Casablanca",
"Africa/Ceuta",
"Pacific/Wallis",
"UTC"
]
}

Response Status Codes

CODEDESCRIPTION
200OK