IP Ranges
Incident Management is now generally available! Incident Management is now generally available!

IP Ranges

Get a list of IP prefixes belonging to Datadog.

List IP Ranges

GET https://ip-ranges.datadoghq.eu/https://ip-ranges.datadoghq.com/

Overview

Get information about Datadog IP ranges.

Response

OK

IP ranges.

Expand All

Field

Type

Description

agents

object

Available prefix information for the Agent endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

api

object

Available prefix information for the API endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

apm

object

Available prefix information for the APM endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

logs

object

Available prefix information for the Logs endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

modified

string

Date when last updated, in the form YYYY-MM-DD-hh-mm-ss.

process

object

Available prefix information for the Process endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

synthetics

object

Available prefix information for the Synthetics endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv4_by_location

object

List of IPv4 prefixes by location.

<any-key>

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

prefixes_ipv6_by_location

object

List of IPv6 prefixes by location.

<any-key>

[string]

List of IPv6 prefixes.

version

int64

Version of the IP list.

webhooks

object

Available prefix information for the Webhook endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

{
  "agents": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "api": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "apm": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "logs": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "modified": "2019-10-31-20-00-00",
  "process": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "synthetics": {
    "prefixes_ipv4": [],
    "prefixes_ipv4_by_location": {
      "<any-key>": []
    },
    "prefixes_ipv6": [],
    "prefixes_ipv6_by_location": {
      "<any-key>": []
    }
  },
  "version": 11,
  "webhooks": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  }
}

Code Example


                                        # Curl command
curl -X GET "https://ip-ranges.datadoghq.eu"https://ip-ranges.datadoghq.com/" \
-H "Content-Type: application/json"
package main

import (
    "context"
    "encoding/json"
    "fmt"
    "os"
    datadog "github.com/DataDog/datadog-api-client-go/api/v1/datadog"
)

func main() {
    ctx := context.Background()


    configuration := datadog.NewConfiguration()

    api_client := datadog.NewAPIClient(configuration)
    resp, r, err := api_client.IPRangesApi.GetIPRanges(ctx).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `IPRangesApi.GetIPRanges``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetIPRanges`: IPRanges
    response_content, _ := json.MarshalIndent(resp, "", "  ")
    fmt.Fprintf(os.Stdout, "Response from IPRangesApi.GetIPRanges:\n%s\n", response_content)
}
// Import classes:
import java.util.*;
import com.datadog.api.v1.client.ApiClient;
import com.datadog.api.v1.client.ApiException;
import com.datadog.api.v1.client.Configuration;
import com.datadog.api.v1.client.model.*;
import com.datadog.api.v1.client.api.IpRangesApi;

public class Example {
    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        // Configure the Datadog site to send API calls to
        HashMap<String, String> serverVariables = new HashMap<String, String>();
        String site = System.getenv("DD_SITE");
        if (site != null) {
            serverVariables.put("site", site);
            defaultClient.setServerVariables(serverVariables);
        }
        // Configure API key authorization: 
        HashMap<String, String> secrets = new HashMap<String, String>();
        defaultClient.configureApiKeys(secrets);

        IpRangesApi apiInstance = new IpRangesApi(defaultClient);
        try {
            IPRanges result = apiInstance.getIPRanges()
                .execute();
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling IpRangesApi#getIPRanges");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}
import os
from dateutil.parser import parse as dateutil_parser
import datadog_api_client.v1
from datadog_api_client.v1.api import ip_ranges_api
from datadog_api_client.v1.models import *
from pprint import pprint
# Defining the host is optional and defaults to https://api.datadoghq.com
# See configuration.py for a list of all supported configuration parameters.
configuration = datadog_api_client.v1.Configuration(
    host = "https://api.datadoghq.com"
)


# Enter a context with an instance of the API client
with datadog_api_client.v1.ApiClient() as api_client:
    # Create an instance of the API class
    api_instance = ip_ranges_api.IPRangesApi(api_client)

    # example, this endpoint has no required or optional parameters
    try:
        # List IP Ranges
        api_response = api_instance.get_ip_ranges()
        pprint(api_response)
    except datadog_api_client.v1.ApiException as e:
        print("Exception when calling IPRangesApi->get_ip_ranges: %s\n" % e)
require 'time'
require 'datadog_api_client/v1'

api_instance = DatadogAPIClient::V1::IPRangesApi.new

begin
  # List IP Ranges
  result = api_instance.get_ip_ranges
  p result
rescue DatadogAPIClient::V1::ApiError => e
  puts "Error when calling IPRangesApi->get_ip_ranges: #{e}"
end