Python
from gcore import Gcore
client = Gcore()
ip_ranges = client.cloud.ip_ranges.list()
print(ip_ranges.ranges)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
ipRanges, err := client.Cloud.IPRanges.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", ipRanges.Ranges)
}
curl --request GET \
--url https://api.gcore.com/cloud/public/v1/ipranges/egressconst options = {method: 'GET'};
fetch('https://api.gcore.com/cloud/public/v1/ipranges/egress', 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/cloud/public/v1/ipranges/egress",
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/cloud/public/v1/ipranges/egress")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/public/v1/ipranges/egress")
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{
"ranges": [
"203.0.113.0/24"
]
}IP Ranges
List cloud egress public IPs
Returns the complete list of IPv4 and IPv6 address ranges that Cloud uses for outbound (egress) traffic.
Typical reasons to call this endpoint:
- Host-file delivery workflows - You upload images or other assets to the Cloud and share a download link that points to your own infrastructure. Add these egress prefixes to your firewall or object-storage allow-list so our clients can fetch the files without being blocked.
- Push integrations / webhooks - You subscribe to the user-actions event log and Cloud pushes events to your listener endpoint. Whitelisting the egress IP ranges lets you accept only traffic that originates from us.
- General security controls, audit tooling, or SIEM rules that need to verify that traffic truly comes from the Cloud.
The list is global (covers all regions) and refreshed automatically whenever the provider allocates new egress IP space. The response is an array of CIDR blocks; duplicate prefixes are not returned.
GET
/
cloud
/
public
/
v1
/
ipranges
/
egress
Python
from gcore import Gcore
client = Gcore()
ip_ranges = client.cloud.ip_ranges.list()
print(ip_ranges.ranges)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
ipRanges, err := client.Cloud.IPRanges.List(context.TODO())
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", ipRanges.Ranges)
}
curl --request GET \
--url https://api.gcore.com/cloud/public/v1/ipranges/egressconst options = {method: 'GET'};
fetch('https://api.gcore.com/cloud/public/v1/ipranges/egress', 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/cloud/public/v1/ipranges/egress",
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/cloud/public/v1/ipranges/egress")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/public/v1/ipranges/egress")
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{
"ranges": [
"203.0.113.0/24"
]
}Response
200 - application/json
OK
IP ranges list
Example:
["203.0.113.0/24"]
Was this page helpful?