Python
from gcore import Gcore
client = Gcore()
public_network_list = client.cdn.ip_ranges.list()
print(public_network_list.addresses)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
publicNetworkList, err := client.CDN.IPRanges.List(context.TODO(), cdn.IPRangeListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicNetworkList.Addresses)
}
curl --request GET \
--url https://api.gcore.com/cdn/public-net-listconst options = {method: 'GET'};
fetch('https://api.gcore.com/cdn/public-net-list', 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/cdn/public-net-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/public-net-list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/public-net-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
"185.239.155.0/24"
],
"addresses_v6": [
"2a03:90c0:391:2801::/112"
]
}IP addresses list
Get CDN servers networks
Get all CDN networks that can be used to pull content from your origin.
This list is updated periodically. If you want to use network from this list to configure IP ACL on your origin, you need to independently monitor its relevance. We recommend using a script for automatically update IP ACL.
This request does not require authorization.
GET
/
cdn
/
public-net-list
Python
from gcore import Gcore
client = Gcore()
public_network_list = client.cdn.ip_ranges.list()
print(public_network_list.addresses)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cdn"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
publicNetworkList, err := client.CDN.IPRanges.List(context.TODO(), cdn.IPRangeListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", publicNetworkList.Addresses)
}
curl --request GET \
--url https://api.gcore.com/cdn/public-net-listconst options = {method: 'GET'};
fetch('https://api.gcore.com/cdn/public-net-list', 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/cdn/public-net-list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cdn/public-net-list")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cdn/public-net-list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"addresses": [
"185.239.155.0/24"
],
"addresses_v6": [
"2a03:90c0:391:2801::/112"
]
}Headers
Content negotiation header.
Defaults to application/json if not provided.
Available options:
application/json, text/plain Query Parameters
Optional format override.
When set, this takes precedence over the Accept header.
Available options:
json, plain Was this page helpful?