Look up Eligible Gateways for Failover
curl --request POST \
--url https://v1.api.altostrat.io/failover/{site_id}/gateways \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interface": "ether1-wan"
}
'import requests
url = "https://v1.api.altostrat.io/failover/{site_id}/gateways"
payload = { "interface": "ether1-wan" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({interface: 'ether1-wan'})
};
fetch('https://v1.api.altostrat.io/failover/{site_id}/gateways', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/failover/{site_id}/gateways",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'interface' => 'ether1-wan'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/failover/{site_id}/gateways"
payload := strings.NewReader("{\n \"interface\": \"ether1-wan\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/failover/{site_id}/gateways")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interface\": \"ether1-wan\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/failover/{site_id}/gateways")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interface\": \"ether1-wan\"\n}"
response = http.request(request)
puts response.read_body[
{
"gateway": "198.51.100.1",
"is_dhcp": false
}
]{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Helper Endpoints
Look up Eligible Gateways for Failover
Detects eligible upstream gateway IP addresses for a router interface used in WAN failover configuration.
POST
/
failover
/
{site_id}
/
gateways
Look up Eligible Gateways for Failover
curl --request POST \
--url https://v1.api.altostrat.io/failover/{site_id}/gateways \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"interface": "ether1-wan"
}
'import requests
url = "https://v1.api.altostrat.io/failover/{site_id}/gateways"
payload = { "interface": "ether1-wan" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({interface: 'ether1-wan'})
};
fetch('https://v1.api.altostrat.io/failover/{site_id}/gateways', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://v1.api.altostrat.io/failover/{site_id}/gateways",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'interface' => 'ether1-wan'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://v1.api.altostrat.io/failover/{site_id}/gateways"
payload := strings.NewReader("{\n \"interface\": \"ether1-wan\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://v1.api.altostrat.io/failover/{site_id}/gateways")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"interface\": \"ether1-wan\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/failover/{site_id}/gateways")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"interface\": \"ether1-wan\"\n}"
response = http.request(request)
puts response.read_body[
{
"gateway": "198.51.100.1",
"is_dhcp": false
}
]{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The value for 'type' must be one of the supported connection types.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Authorizations
Enter your JWT in the format: Bearer
Path Parameters
The unique identifier for the site.
Example:
"9c69345c-8d39-4786-9f17-8153c988c89a"
Body
application/json
The name of the interface on the router to query.
Example:
"ether1-wan"
Was this page helpful?
⌘I