Attach BGP Policy to a Site
curl --request POST \
--url https://v1.api.altostrat.io/content/bgp/{siteId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dnr_policy_id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"ip_address": "100.64.10.5"
}
'import requests
url = "https://v1.api.altostrat.io/content/bgp/{siteId}"
payload = {
"dnr_policy_id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"ip_address": "100.64.10.5"
}
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({
dnr_policy_id: '9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b',
ip_address: '100.64.10.5'
})
};
fetch('https://v1.api.altostrat.io/content/bgp/{siteId}', 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/content/bgp/{siteId}",
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([
'dnr_policy_id' => '9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b',
'ip_address' => '100.64.10.5'
]),
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/content/bgp/{siteId}"
payload := strings.NewReader("{\n \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\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/content/bgp/{siteId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/content/bgp/{siteId}")
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 \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9a9d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8d",
"ip_address": "100.64.10.5",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_name": "<string>",
"dnr_policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dnr_policy_name": "<string>",
"dns_online": true,
"dnr_online": true
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Site Security Configuration
Attach BGP Policy to a Site
Attaches a BGP Threat Intelligence policy to a specific site, activating IP reputation blocking for that site.
POST
/
content
/
bgp
/
{siteId}
Attach BGP Policy to a Site
curl --request POST \
--url https://v1.api.altostrat.io/content/bgp/{siteId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dnr_policy_id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"ip_address": "100.64.10.5"
}
'import requests
url = "https://v1.api.altostrat.io/content/bgp/{siteId}"
payload = {
"dnr_policy_id": "9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b",
"ip_address": "100.64.10.5"
}
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({
dnr_policy_id: '9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b',
ip_address: '100.64.10.5'
})
};
fetch('https://v1.api.altostrat.io/content/bgp/{siteId}', 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/content/bgp/{siteId}",
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([
'dnr_policy_id' => '9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b',
'ip_address' => '100.64.10.5'
]),
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/content/bgp/{siteId}"
payload := strings.NewReader("{\n \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\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/content/bgp/{siteId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://v1.api.altostrat.io/content/bgp/{siteId}")
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 \"dnr_policy_id\": \"9b1d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8b\",\n \"ip_address\": \"100.64.10.5\"\n}"
response = http.request(request)
puts response.read_body{
"id": "9a9d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8d",
"ip_address": "100.64.10.5",
"policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"policy_name": "<string>",
"dnr_policy_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dnr_policy_name": "<string>",
"dns_online": true,
"dnr_online": true
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'name' parameter cannot be empty.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The unique identifier of the site.
Body
application/json
Response
BGP policy attached successfully.
The unique identifier of the site.
Example:
"9a9d3e6a-5c3a-4f1e-9a0a-2b2a1e1d8e8d"
The management IP address of the site's tunnel.
Example:
"100.64.10.5"
The ID of the DNS policy attached to this site, if any.
The name of the attached DNS policy.
The ID of the BGP policy attached to this site, if any.
The name of the attached BGP policy.
The operational status of the DNS filtering service for this site.
The operational status of the BGP filtering service for this site.
Was this page helpful?
⌘I