Plages d'IP

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

GET https://ip-ranges.ap1.datadoghq.com/https://ip-ranges.datadoghq.eu/https://ip-ranges.ddog-gov.com/https://ip-ranges.datadoghq.com/https://ip-ranges.us3.datadoghq.com/https://ip-ranges.us5.datadoghq.com/

Présentation

Récupérez des informations sur les plages d’IP Datadog.

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.

global

object

Available prefix information for all Datadog 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.

orchestrator

object

Available prefix information for the Orchestrator endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

process

object

Available prefix information for the Process endpoints.

prefixes_ipv4

[string]

List of IPv4 prefixes.

prefixes_ipv6

[string]

List of IPv6 prefixes.

remote-configuration

object

Available prefix information for the Remote Configuration 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.

synthetics-private-locations

object

Available prefix information for the Synthetics Private Locations 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": []
  },
  "global": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "logs": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "modified": "2019-10-31-20-00-00",
  "orchestrator": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "process": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "remote-configuration": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "synthetics": {
    "prefixes_ipv4": [],
    "prefixes_ipv4_by_location": {
      "<any-key>": []
    },
    "prefixes_ipv6": [],
    "prefixes_ipv6_by_location": {
      "<any-key>": []
    }
  },
  "synthetics-private-locations": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  },
  "version": 11,
  "webhooks": {
    "prefixes_ipv4": [],
    "prefixes_ipv6": []
  }
}

Too many requests

Error response object.

Expand All

Champ

Type

Description

errors [required]

[string]

Array of errors returned by the API.

{
  "errors": [
    "Bad Request"
  ]
}

Exemple de code

// List IP Ranges returns "OK" response

package main

import (
	"context"
	"encoding/json"
	"fmt"
	"os"

	"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
	"github.com/DataDog/datadog-api-client-go/v2/api/datadogV1"
)

func main() {
	ctx := datadog.NewDefaultContext(context.Background())
	configuration := datadog.NewConfiguration()
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV1.NewIPRangesApi(apiClient)
	resp, r, err := api.GetIPRanges(ctx)

	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)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `IPRangesApi.GetIPRanges`:\n%s\n", responseContent)
}

Instructions

First install the library and its dependencies and then save the example to main.go and run following commands:

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" go run "main.go"

PREVIEWING: ashley.yip/dynamic-cost-allocation-docs