Plages d'IP
Rapport de recherche Datadog : Bilan sur l'adoption de l'informatique sans serveur Rapport : Bilan sur l'adoption de l'informatique sans serveur

Plages d'IP

Obtenez la liste des préfixes d’adresse IP appartenant à Datadog.

List IP Ranges

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

Présentation

Get information about Datadog IP ranges.

Réponse

OK

IP ranges.

Expand All

Champ

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_ipv6

[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_ipv6": []
  },
  "version": 11,
  "webhooks": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  }
}

Exemple de code


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

import (
    "context"
    "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(context.Background()).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
    fmt.Fprintf(os.Stdout, "Response from `IPRangesApi.GetIPRanges`: %v\n", resp)
}
// Import classes:
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 = api.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();
        }
    }
}