Cloudflare Integration

Manage your Datadog Cloudflare integration directly through the Datadog API. See the Cloudflare integration page for more information.

GET https://api.ap1.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.datadoghq.eu/api/v2/integrations/cloudflare/accountshttps://api.ddog-gov.com/api/v2/integrations/cloudflare/accountshttps://api.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.us3.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts

概要

List Cloudflare accounts. This endpoint requires the integrations_read permission.

応答

OK

The expected response schema when getting Cloudflare accounts.

Expand All

フィールド

種類

説明

data

[object]

The JSON:API data schema.

attributes [required]

object

Attributes object of a Cloudflare account.

email

string

The email associated with the Cloudflare account.

name [required]

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources, such as web, dns, lb (load balancer), worker, that restricts pulling metrics from those resources.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

id [required]

string

The ID of the Cloudflare account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": [
    {
      "attributes": {
        "email": "test-email@example.com",
        "name": "test-name",
        "resources": [
          "web",
          "dns",
          "lb",
          "worker"
        ],
        "zones": [
          "zone_id_1",
          "zone_id_2"
        ]
      },
      "id": "c1a8e059bfd1e911cf10b626340c9a54",
      "type": "cloudflare-accounts"
    }
  ]
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

                  # Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

POST https://api.ap1.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.datadoghq.eu/api/v2/integrations/cloudflare/accountshttps://api.ddog-gov.com/api/v2/integrations/cloudflare/accountshttps://api.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.us3.datadoghq.com/api/v2/integrations/cloudflare/accountshttps://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts

概要

Create a Cloudflare account. This endpoint requires the manage_integrations permission.

リクエスト

Body Data (required)

Expand All

フィールド

種類

説明

data [required]

object

Data object for creating a Cloudflare account.

attributes [required]

object

Attributes object for creating a Cloudflare account.

api_key [required]

string

The API key (or token) for the Cloudflare account.

email

string

The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.

name [required]

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources to restrict pulling metrics for including 'web', 'dns', 'lb' (load balancer), 'worker'.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

type [required]

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": {
    "attributes": {
      "api_key": "fakekey",
      "email": "dev@datadoghq.com",
      "name": "examplecloudflareintegration"
    },
    "type": "cloudflare-accounts"
  }
}

応答

CREATED

The expected response schema when getting a Cloudflare account.

Expand All

フィールド

種類

説明

data

object

Data object of a Cloudflare account.

attributes [required]

object

Attributes object of a Cloudflare account.

email

string

The email associated with the Cloudflare account.

name [required]

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources, such as web, dns, lb (load balancer), worker, that restricts pulling metrics from those resources.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

id [required]

string

The ID of the Cloudflare account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": {
    "attributes": {
      "email": "test-email@example.com",
      "name": "test-name",
      "resources": [
        "web",
        "dns",
        "lb",
        "worker"
      ],
      "zones": [
        "zone_id_1",
        "zone_id_2"
      ]
    },
    "id": "c1a8e059bfd1e911cf10b626340c9a54",
    "type": "cloudflare-accounts"
  }
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

                          # Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "api_key": "fakekey", "email": "dev@datadoghq.com", "name": "examplecloudflareintegration" }, "type": "cloudflare-accounts" } } EOF

GET https://api.ap1.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/cloudflare/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}

概要

Get a Cloudflare account. This endpoint requires the integrations_read permission.

引数

パスパラメーター

名前

種類

説明

account_id [required]

string

None

応答

OK

The expected response schema when getting a Cloudflare account.

Expand All

フィールド

種類

説明

data

object

Data object of a Cloudflare account.

attributes [required]

object

Attributes object of a Cloudflare account.

email

string

The email associated with the Cloudflare account.

name [required]

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources, such as web, dns, lb (load balancer), worker, that restricts pulling metrics from those resources.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

id [required]

string

The ID of the Cloudflare account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": {
    "attributes": {
      "email": "test-email@example.com",
      "name": "test-name",
      "resources": [
        "web",
        "dns",
        "lb",
        "worker"
      ],
      "zones": [
        "zone_id_1",
        "zone_id_2"
      ]
    },
    "id": "c1a8e059bfd1e911cf10b626340c9a54",
    "type": "cloudflare-accounts"
  }
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

                  # Path parameters
export account_id="CHANGE_ME"
# Curl command
curl -X GET "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/${account_id}" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PATCH https://api.ap1.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/cloudflare/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}

概要

Update a Cloudflare account. This endpoint requires the manage_integrations permission.

引数

パスパラメーター

名前

種類

説明

account_id [required]

string

None

リクエスト

Body Data (required)

Expand All

フィールド

種類

説明

data [required]

object

Data object for updating a Cloudflare account.

attributes

object

Attributes object for updating a Cloudflare account.

api_key [required]

string

The API key of the Cloudflare account.

email

string

The email associated with the Cloudflare account. If an API key is provided (and not a token), this field is also required.

name

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources to restrict pulling metrics for including 'web', 'dns', 'lb' (load balancer), 'worker'.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

type

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": {
    "attributes": {
      "api_key": "fakekey",
      "email": "dev@datadoghq.com",
      "zones": [
        "zone-id-3"
      ]
    },
    "type": "cloudflare-accounts"
  }
}

応答

OK

The expected response schema when getting a Cloudflare account.

Expand All

フィールド

種類

説明

data

object

Data object of a Cloudflare account.

attributes [required]

object

Attributes object of a Cloudflare account.

email

string

The email associated with the Cloudflare account.

name [required]

string

The name of the Cloudflare account.

resources

[string]

An allowlist of resources, such as web, dns, lb (load balancer), worker, that restricts pulling metrics from those resources.

zones

[string]

An allowlist of zones to restrict pulling metrics for.

id [required]

string

The ID of the Cloudflare account, a hash of the account name.

type [required]

enum

The JSON:API type for this API. Should always be cloudflare-accounts. Allowed enum values: cloudflare-accounts

default: cloudflare-accounts

{
  "data": {
    "attributes": {
      "email": "test-email@example.com",
      "name": "test-name",
      "resources": [
        "web",
        "dns",
        "lb",
        "worker"
      ],
      "zones": [
        "zone_id_1",
        "zone_id_2"
      ]
    },
    "id": "c1a8e059bfd1e911cf10b626340c9a54",
    "type": "cloudflare-accounts"
  }
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

                          # Path parameters
export account_id="CHANGE_ME"
# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/${account_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \ -d @- << EOF { "data": { "attributes": { "api_key": "fakekey", "email": "dev@datadoghq.com", "zones": [ "zone-id-3" ] }, "type": "cloudflare-accounts" } } EOF

DELETE https://api.ap1.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.eu/api/v2/integrations/cloudflare/accounts/{account_id}https://api.ddog-gov.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/{account_id}

概要

Delete a Cloudflare account. This endpoint requires the manage_integrations permission.

引数

パスパラメーター

名前

種類

説明

account_id [required]

string

None

応答

OK

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

コード例

                  # Path parameters
export account_id="CHANGE_ME"
# Curl command
curl -X DELETE "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integrations/cloudflare/accounts/${account_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"