IP Allowlist

The IP allowlist API is used to manage the IP addresses that can access the Datadog API and web UI. It does not block access to intake APIs or public dashboards.

This is an enterprise-only feature. Request access by contacting Datadog support, or see the IP Allowlist page for more information.

GET https://api.ap1.datadoghq.com/api/v2/ip_allowlisthttps://api.datadoghq.eu/api/v2/ip_allowlisthttps://api.ddog-gov.com/api/v2/ip_allowlisthttps://api.datadoghq.com/api/v2/ip_allowlisthttps://api.us3.datadoghq.com/api/v2/ip_allowlisthttps://api.us5.datadoghq.com/api/v2/ip_allowlist

Présentation

Returns the IP allowlist and its enabled or disabled state. This endpoint requires the org_management permission.

OAuth apps require the org_management authorization scope to access this endpoint.

Réponse

OK

Response containing information about the IP allowlist.

Expand All

Champ

Type

Description

data

object

IP allowlist data.

attributes

object

Attributes of the IP allowlist.

enabled

boolean

Whether the IP allowlist logic is enabled or not.

entries

[object]

Array of entries in the IP allowlist.

data [required]

object

Data of the IP allowlist entry object.

attributes

object

Attributes of the IP allowlist entry.

cidr_block

string

The CIDR block describing the IP range of the entry.

created_at

date-time

Creation time of the entry.

modified_at

date-time

Time of last entry modification.

note

string

A note describing the IP allowlist entry.

id

string

The unique identifier of the IP allowlist entry.

type [required]

enum

IP allowlist Entry type. Allowed enum values: ip_allowlist_entry

default: ip_allowlist_entry

id

string

The unique identifier of the org.

type [required]

enum

IP allowlist type. Allowed enum values: ip_allowlist

default: ip_allowlist

{
  "data": {
    "attributes": {
      "enabled": false,
      "entries": [
        {
          "data": {
            "attributes": {
              "cidr_block": "string",
              "created_at": "2019-09-19T10:00:00.000Z",
              "modified_at": "2019-09-19T10:00:00.000Z",
              "note": "string"
            },
            "id": "string",
            "type": "ip_allowlist_entry"
          }
        }
      ]
    },
    "id": "string",
    "type": "ip_allowlist"
  }
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Get IP Allowlist returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_ip_allowlist::IPAllowlistAPI;

#[tokio::main]
async fn main() {
    let configuration = datadog::Configuration::new();
    let api = IPAllowlistAPI::with_config(configuration);
    let resp = api.get_ip_allowlist().await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run

PATCH https://api.ap1.datadoghq.com/api/v2/ip_allowlisthttps://api.datadoghq.eu/api/v2/ip_allowlisthttps://api.ddog-gov.com/api/v2/ip_allowlisthttps://api.datadoghq.com/api/v2/ip_allowlisthttps://api.us3.datadoghq.com/api/v2/ip_allowlisthttps://api.us5.datadoghq.com/api/v2/ip_allowlist

Présentation

Edit the entries in the IP allowlist, and enable or disable it. This endpoint requires the org_management permission.

OAuth apps require the org_management authorization scope to access this endpoint.

Requête

Body Data (required)

Expand All

Champ

Type

Description

data [required]

object

IP allowlist data.

attributes

object

Attributes of the IP allowlist.

enabled

boolean

Whether the IP allowlist logic is enabled or not.

entries

[object]

Array of entries in the IP allowlist.

data [required]

object

Data of the IP allowlist entry object.

attributes

object

Attributes of the IP allowlist entry.

cidr_block

string

The CIDR block describing the IP range of the entry.

created_at

date-time

Creation time of the entry.

modified_at

date-time

Time of last entry modification.

note

string

A note describing the IP allowlist entry.

id

string

The unique identifier of the IP allowlist entry.

type [required]

enum

IP allowlist Entry type. Allowed enum values: ip_allowlist_entry

default: ip_allowlist_entry

id

string

The unique identifier of the org.

type [required]

enum

IP allowlist type. Allowed enum values: ip_allowlist

default: ip_allowlist

{
  "data": {
    "attributes": {
      "entries": [
        {
          "data": {
            "attributes": {
              "note": "Example-IP-Allowlist",
              "cidr_block": "127.0.0.1"
            },
            "type": "ip_allowlist_entry"
          }
        }
      ],
      "enabled": false
    },
    "type": "ip_allowlist"
  }
}

Réponse

OK

Response containing information about the IP allowlist.

Expand All

Champ

Type

Description

data

object

IP allowlist data.

attributes

object

Attributes of the IP allowlist.

enabled

boolean

Whether the IP allowlist logic is enabled or not.

entries

[object]

Array of entries in the IP allowlist.

data [required]

object

Data of the IP allowlist entry object.

attributes

object

Attributes of the IP allowlist entry.

cidr_block

string

The CIDR block describing the IP range of the entry.

created_at

date-time

Creation time of the entry.

modified_at

date-time

Time of last entry modification.

note

string

A note describing the IP allowlist entry.

id

string

The unique identifier of the IP allowlist entry.

type [required]

enum

IP allowlist Entry type. Allowed enum values: ip_allowlist_entry

default: ip_allowlist_entry

id

string

The unique identifier of the org.

type [required]

enum

IP allowlist type. Allowed enum values: ip_allowlist

default: ip_allowlist

{
  "data": {
    "attributes": {
      "enabled": false,
      "entries": [
        {
          "data": {
            "attributes": {
              "cidr_block": "string",
              "created_at": "2019-09-19T10:00:00.000Z",
              "modified_at": "2019-09-19T10:00:00.000Z",
              "note": "string"
            },
            "id": "string",
            "type": "ip_allowlist_entry"
          }
        }
      ]
    },
    "id": "string",
    "type": "ip_allowlist"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Update IP Allowlist returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_ip_allowlist::IPAllowlistAPI;
use datadog_api_client::datadogV2::model::IPAllowlistAttributes;
use datadog_api_client::datadogV2::model::IPAllowlistData;
use datadog_api_client::datadogV2::model::IPAllowlistEntry;
use datadog_api_client::datadogV2::model::IPAllowlistEntryAttributes;
use datadog_api_client::datadogV2::model::IPAllowlistEntryData;
use datadog_api_client::datadogV2::model::IPAllowlistEntryType;
use datadog_api_client::datadogV2::model::IPAllowlistType;
use datadog_api_client::datadogV2::model::IPAllowlistUpdateRequest;

#[tokio::main]
async fn main() {
    let body = IPAllowlistUpdateRequest::new(
        IPAllowlistData::new(IPAllowlistType::IP_ALLOWLIST).attributes(
            IPAllowlistAttributes::new()
                .enabled(false)
                .entries(vec![IPAllowlistEntry::new(
                    IPAllowlistEntryData::new(IPAllowlistEntryType::IP_ALLOWLIST_ENTRY).attributes(
                        IPAllowlistEntryAttributes::new()
                            .cidr_block("127.0.0.1".to_string())
                            .note("Example-IP-Allowlist".to_string()),
                    ),
                )]),
        ),
    );
    let configuration = datadog::Configuration::new();
    let api = IPAllowlistAPI::with_config(configuration);
    let resp = api.update_ip_allowlist(body).await;
    if let Ok(value) = resp {
        println!("{:#?}", value);
    } else {
        println!("{:#?}", resp.unwrap_err());
    }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run