Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
response = client.security.bgp_announces.toggle(
announce="192.9.9.1/32",
enabled=True,
)
print(response)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/security"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Security.BgpAnnounces.Toggle(context.TODO(), security.BgpAnnounceToggleParams{
Announce: "192.9.9.1/32",
Enabled: true,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.gcore.com/security/sifter/v2/protected_addresses/announces \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"announce": "192.9.9.1/32",
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({announce: '192.9.9.1/32', enabled: true})
};
fetch('https://api.gcore.com/security/sifter/v2/protected_addresses/announces', 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://api.gcore.com/security/sifter/v2/protected_addresses/announces",
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([
'announce' => '192.9.9.1/32',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/security/sifter/v2/protected_addresses/announces")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"announce\": \"192.9.9.1/32\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/security/sifter/v2/protected_addresses/announces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"announce\": \"192.9.9.1/32\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}BGP announces
Change BGP announces
Enable or disable BGP announces for a client.
POST
/
security
/
sifter
/
v2
/
protected_addresses
/
announces
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
response = client.security.bgp_announces.toggle(
announce="192.9.9.1/32",
enabled=True,
)
print(response)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
"github.com/G-Core/gcore-go/security"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Security.BgpAnnounces.Toggle(context.TODO(), security.BgpAnnounceToggleParams{
Announce: "192.9.9.1/32",
Enabled: true,
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response)
}curl --request POST \
--url https://api.gcore.com/security/sifter/v2/protected_addresses/announces \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"announce": "192.9.9.1/32",
"enabled": true
}
'const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({announce: '192.9.9.1/32', enabled: true})
};
fetch('https://api.gcore.com/security/sifter/v2/protected_addresses/announces', 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://api.gcore.com/security/sifter/v2/protected_addresses/announces",
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([
'announce' => '192.9.9.1/32',
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.gcore.com/security/sifter/v2/protected_addresses/announces")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"announce\": \"192.9.9.1/32\",\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/security/sifter/v2/protected_addresses/announces")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"announce\": \"192.9.9.1/32\",\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{}{}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234_abcdef
Query Parameters
A positive integer ID
Required range:
1 <= x <= 1000000000Body
application/json
Response
Successful Response
Was this page helpful?
⌘I