GCP インテグレーション

Datadog-Google Cloud Platform (GCP) インテグレーションの構成は、Datadog API から直接行います。Datadog-Google Cloud Platform インテグレーションについては、こちらを参照してください

GET https://api.ap1.datadoghq.com/api/v1/integration/gcphttps://api.datadoghq.eu/api/v1/integration/gcphttps://api.ddog-gov.com/api/v1/integration/gcphttps://api.datadoghq.com/api/v1/integration/gcphttps://api.us3.datadoghq.com/api/v1/integration/gcphttps://api.us5.datadoghq.com/api/v1/integration/gcp

概要

このエンドポイントは非推奨です。 – 代わりに V2 エンドポイントを使用してください。お使いの Datadog アカウントで構成されたすべての Datadog-GCP インテグレーションをリストします。 This endpoint requires the gcp_configuration_read permission.

応答

OK

Array of GCP account responses.

Expand All

フィールド

種類

説明

auth_provider_x509_cert_url

string

Should be https://www.googleapis.com/oauth2/v1/certs.

auth_uri

string

Should be https://accounts.google.com/o/oauth2/auth.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your email found in your JSON service account key.

client_id

string

Your ID found in your JSON service account key.

client_x509_cert_url

string

Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL where $CLIENT_EMAIL is the email found in your JSON service account key.

cloud_run_revision_filters

[string]

Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

errors

[string]

An array of errors.

host_filters

string

Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

private_key

string

Your private key name found in your JSON service account key.

private_key_id

string

Your private key ID found in your JSON service account key.

project_id

string

Your Google Cloud project ID found in your JSON service account key.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

token_uri

string

Should be https://accounts.google.com/o/oauth2/token.

type

string

The value for service_account found in your JSON service account key.

{
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "automute": false,
  "client_email": "api-dev@datadog-sandbox.iam.gserviceaccount.com",
  "client_id": "123456712345671234567",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
  "cloud_run_revision_filters": [
    "$KEY:$VALUE"
  ],
  "errors": [
    "*"
  ],
  "host_filters": "key:value,filter:example",
  "is_cspm_enabled": true,
  "is_resource_change_collection_enabled": true,
  "is_security_command_center_enabled": true,
  "private_key": "private_key",
  "private_key_id": "123456789abcdefghi123456789abcdefghijklm",
  "project_id": "datadog-apitest",
  "resource_collection_enabled": true,
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "type": "service_account"
}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

コード例

require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

dog.gcp_integration_list

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

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

概要

List all GCP STS-enabled service accounts configured in your Datadog account. This endpoint requires the gcp_configuration_read permission.

応答

OK

Object containing all your STS enabled accounts.

Expand All

フィールド

種類

説明

data

[object]

Array of GCP STS enabled service accounts.

attributes

object

Attributes associated with your service account.

account_tags

[string]

Tags to be associated with GCP metrics and service checks from your account.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your service account email address.

cloud_run_revision_filters

[string]

List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

host_filters

[string]

Your Host Filters.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

metric_namespace_configs

[object]

Configurations for GCP metric namespaces.

disabled

boolean

When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.

id

string

The id of the GCP metric namespace.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

id

string

Your service account's unique ID.

meta

object

Additional information related to your service account.

accessible_projects

[string]

The current list of projects accessible from your service account.

type

enum

The type of account. Allowed enum values: gcp_service_account

default: gcp_service_account

{
  "data": [
    {
      "attributes": {
        "account_tags": [],
        "automute": false,
        "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com",
        "cloud_run_revision_filters": [
          "$KEY:$VALUE"
        ],
        "host_filters": [],
        "is_cspm_enabled": false,
        "is_resource_change_collection_enabled": true,
        "is_security_command_center_enabled": true,
        "metric_namespace_configs": [
          {
            "disabled": true,
            "id": "aiplatform"
          }
        ],
        "resource_collection_enabled": false
      },
      "id": "d291291f-12c2-22g4-j290-123456678897",
      "meta": {
        "accessible_projects": []
      },
      "type": "gcp_service_account"
    }
  ]
}

Not Authorized

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/integration/gcp/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/v1/integration/gcphttps://api.datadoghq.eu/api/v1/integration/gcphttps://api.ddog-gov.com/api/v1/integration/gcphttps://api.datadoghq.com/api/v1/integration/gcphttps://api.us3.datadoghq.com/api/v1/integration/gcphttps://api.us5.datadoghq.com/api/v1/integration/gcp

概要

このエンドポイントは非推奨です。 – 代わりに V2 エンドポイントを使用してください。Datadog-GCP インテグレーションを作成します。 This endpoint requires the gcp_configurations_manage permission.

リクエスト

Body Data (required)

Datadog-GCP インテグレーションを作成します。

Expand All

フィールド

種類

説明

auth_provider_x509_cert_url

string

Should be https://www.googleapis.com/oauth2/v1/certs.

auth_uri

string

Should be https://accounts.google.com/o/oauth2/auth.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your email found in your JSON service account key.

client_id

string

Your ID found in your JSON service account key.

client_x509_cert_url

string

Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL where $CLIENT_EMAIL is the email found in your JSON service account key.

cloud_run_revision_filters

[string]

Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

errors

[string]

An array of errors.

host_filters

string

Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

private_key

string

Your private key name found in your JSON service account key.

private_key_id

string

Your private key ID found in your JSON service account key.

project_id

string

Your Google Cloud project ID found in your JSON service account key.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

token_uri

string

Should be https://accounts.google.com/o/oauth2/token.

type

string

The value for service_account found in your JSON service account key.

{
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "client_email": "252bf553ef04b351@example.com",
  "client_id": "163662907116366290710",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
  "host_filters": "key:value,filter:example",
  "cloud_run_revision_filters": [
    "dr:dre"
  ],
  "is_cspm_enabled": true,
  "is_security_command_center_enabled": true,
  "is_resource_change_collection_enabled": true,
  "private_key": "private_key",
  "private_key_id": "123456789abcdefghi123456789abcdefghijklm",
  "project_id": "datadog-apitest",
  "resource_collection_enabled": true,
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "type": "service_account"
}

応答

OK

Expand All

フィールド

種類

説明

No response body

{}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

コード例

require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

config= {
    "type": "service_account",
    "project_id": "<GCP_PROJECT_ID>",
    "private_key_id": "<PRIVATE_KEY_ID>",
    "private_key": "<PRIVATE_KEY>",
    "client_email": "<CLIENT_EMAIL>",
    "client_id": "<CLIENT_ID>",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://accounts.google.com/o/oauth2/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/<CLIENT_EMAIL>",
    "host_filters": "<KEY_1>:<VALUE_1>,<KEY_2>:<VALUE_2>"
  }

dog = Dogapi::Client.new(api_key, app_key)

dog.gcp_integration_create(config)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

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

概要

Create a new entry within Datadog for your STS enabled service account. This endpoint requires the gcp_configurations_manage permission.

リクエスト

Body Data (required)

Expand All

フィールド

種類

説明

data

object

Additional metadata on your generated service account.

attributes

object

Attributes associated with your service account.

account_tags

[string]

Tags to be associated with GCP metrics and service checks from your account.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your service account email address.

cloud_run_revision_filters

[string]

List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

host_filters

[string]

Your Host Filters.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

metric_namespace_configs

[object]

Configurations for GCP metric namespaces.

disabled

boolean

When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.

id

string

The id of the GCP metric namespace.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

type

enum

The type of account. Allowed enum values: gcp_service_account

default: gcp_service_account

{
  "data": {
    "attributes": {
      "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
      "host_filters": []
    },
    "type": "gcp_service_account"
  }
}
{
  "data": {
    "attributes": {
      "account_tags": [
        "lorem",
        "ipsum"
      ],
      "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
      "host_filters": []
    },
    "type": "gcp_service_account"
  }
}
{
  "data": {
    "attributes": {
      "cloud_run_revision_filters": [
        "meh:bleh"
      ],
      "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com",
      "host_filters": []
    },
    "type": "gcp_service_account"
  }
}

応答

OK

The account creation response.

Expand All

フィールド

種類

説明

data

object

Info on your service account.

attributes

object

Attributes associated with your service account.

account_tags

[string]

Tags to be associated with GCP metrics and service checks from your account.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your service account email address.

cloud_run_revision_filters

[string]

List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

host_filters

[string]

Your Host Filters.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

metric_namespace_configs

[object]

Configurations for GCP metric namespaces.

disabled

boolean

When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.

id

string

The id of the GCP metric namespace.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

id

string

Your service account's unique ID.

meta

object

Additional information related to your service account.

accessible_projects

[string]

The current list of projects accessible from your service account.

type

enum

The type of account. Allowed enum values: gcp_service_account

default: gcp_service_account

{
  "data": {
    "attributes": {
      "account_tags": [],
      "automute": false,
      "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com",
      "cloud_run_revision_filters": [
        "$KEY:$VALUE"
      ],
      "host_filters": [],
      "is_cspm_enabled": false,
      "is_resource_change_collection_enabled": true,
      "is_security_command_center_enabled": true,
      "metric_namespace_configs": [
        {
          "disabled": true,
          "id": "aiplatform"
        }
      ],
      "resource_collection_enabled": false
    },
    "id": "d291291f-12c2-22g4-j290-123456678897",
    "meta": {
      "accessible_projects": []
    },
    "type": "gcp_service_account"
  }
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Unauthorized

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Authorized

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Conflict

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/integration/gcp/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": { "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com", "host_filters": [] }, "type": "gcp_service_account" } } EOF
                          # 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/integration/gcp/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": { "account_tags": [ "lorem", "ipsum" ], "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com", "host_filters": [] }, "type": "gcp_service_account" } } EOF
                          # 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/integration/gcp/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": { "cloud_run_revision_filters": [ "meh:bleh" ], "client_email": "Test-252bf553ef04b351@test-project.iam.gserviceaccount.com", "host_filters": [] }, "type": "gcp_service_account" } } EOF

DELETE https://api.ap1.datadoghq.com/api/v1/integration/gcphttps://api.datadoghq.eu/api/v1/integration/gcphttps://api.ddog-gov.com/api/v1/integration/gcphttps://api.datadoghq.com/api/v1/integration/gcphttps://api.us3.datadoghq.com/api/v1/integration/gcphttps://api.us5.datadoghq.com/api/v1/integration/gcp

概要

このエンドポイントは非推奨です。 – 代わりに V2 エンドポイントを使用してください。特定の Datadog-GCP インテグレーションを削除します。 This endpoint requires the gcp_configurations_manage permission.

リクエスト

Body Data (required)

特定の Datadog-GCP インテグレーションを削除します。

Expand All

フィールド

種類

説明

auth_provider_x509_cert_url

string

Should be https://www.googleapis.com/oauth2/v1/certs.

auth_uri

string

Should be https://accounts.google.com/o/oauth2/auth.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your email found in your JSON service account key.

client_id

string

Your ID found in your JSON service account key.

client_x509_cert_url

string

Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL where $CLIENT_EMAIL is the email found in your JSON service account key.

cloud_run_revision_filters

[string]

Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

errors

[string]

An array of errors.

host_filters

string

Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

private_key

string

Your private key name found in your JSON service account key.

private_key_id

string

Your private key ID found in your JSON service account key.

project_id

string

Your Google Cloud project ID found in your JSON service account key.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

token_uri

string

Should be https://accounts.google.com/o/oauth2/token.

type

string

The value for service_account found in your JSON service account key.

{
  "client_email": "252bf553ef04b351@example.com",
  "client_id": "163662907116366290710",
  "project_id": "datadog-apitest"
}

応答

OK

Expand All

フィールド

種類

説明

No response body

{}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

コード例

require 'rubygems'
require 'dogapi'

api_key = '<DATADOG_API_KEY>'
app_key = '<DATADOG_APPLICATION_KEY>'

dog = Dogapi::Client.new(api_key, app_key)

config = {
    "project_id": "<GCP_PROJECT_ID>",
    "client_email": "<GCP_CLIENT_EMAIL>"
  }

dog.gcp_integration_delete(config)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" rb "example.rb"

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

概要

Delete an STS enabled GCP account from within Datadog. This endpoint requires the gcp_configurations_manage permission.

引数

パスパラメーター

名前

種類

説明

account_id [required]

string

Your GCP STS enabled service account’s unique ID.

応答

No Content

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Authorized

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/integration/gcp/accounts/${account_id}" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"

PUT https://api.ap1.datadoghq.com/api/v1/integration/gcphttps://api.datadoghq.eu/api/v1/integration/gcphttps://api.ddog-gov.com/api/v1/integration/gcphttps://api.datadoghq.com/api/v1/integration/gcphttps://api.us3.datadoghq.com/api/v1/integration/gcphttps://api.us5.datadoghq.com/api/v1/integration/gcp

概要

このエンドポイントは非推奨です – 代わりに V2 エンドポイントを使用してください。Datadog-GCP インテグレーションの host_filters および/または automute を更新します。 処理には project_idclient_email が必要ですが、これらのフィールドは更新できません。 これらのフィールドの更新が必要な場合は、削除してエンドポイント作成 (POST) を使用してください。 指定のないフィールドには元の値がそのまま保持されます。 This endpoint requires the gcp_configuration_edit permission.

リクエスト

Body Data (required)

Datadog-GCP インテグレーションを更新します。

Expand All

フィールド

種類

説明

auth_provider_x509_cert_url

string

Should be https://www.googleapis.com/oauth2/v1/certs.

auth_uri

string

Should be https://accounts.google.com/o/oauth2/auth.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your email found in your JSON service account key.

client_id

string

Your ID found in your JSON service account key.

client_x509_cert_url

string

Should be https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL where $CLIENT_EMAIL is the email found in your JSON service account key.

cloud_run_revision_filters

[string]

Limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

errors

[string]

An array of errors.

host_filters

string

Limit the GCE instances that are pulled into Datadog by using tags. Only hosts that match one of the defined tags are imported into Datadog.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

private_key

string

Your private key name found in your JSON service account key.

private_key_id

string

Your private key ID found in your JSON service account key.

project_id

string

Your Google Cloud project ID found in your JSON service account key.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

token_uri

string

Should be https://accounts.google.com/o/oauth2/token.

type

string

The value for service_account found in your JSON service account key.

{
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "client_email": "252bf553ef04b351@example.com",
  "client_id": "163662907116366290710",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
  "host_filters": "key:value,filter:example",
  "cloud_run_revision_filters": [
    "merp:derp"
  ],
  "is_cspm_enabled": true,
  "is_security_command_center_enabled": true,
  "is_resource_change_collection_enabled": true,
  "private_key": "private_key",
  "private_key_id": "123456789abcdefghi123456789abcdefghijklm",
  "project_id": "datadog-apitest",
  "resource_collection_enabled": true,
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "type": "service_account"
}
{
  "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
  "auth_uri": "https://accounts.google.com/o/oauth2/auth",
  "client_email": "252bf553ef04b351@example.com",
  "client_id": "163662907116366290710",
  "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL",
  "host_filters": "key:value,filter:example",
  "is_cspm_enabled": true,
  "is_security_command_center_enabled": true,
  "is_resource_change_collection_enabled": true,
  "private_key": "private_key",
  "private_key_id": "123456789abcdefghi123456789abcdefghijklm",
  "project_id": "datadog-apitest",
  "resource_collection_enabled": true,
  "token_uri": "https://accounts.google.com/o/oauth2/token",
  "type": "service_account"
}

応答

OK

Expand All

フィールド

種類

説明

No response body

{}

Bad Request

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Authentication error

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

Too many requests

Error response object.

Expand All

フィールド

種類

説明

errors [required]

[string]

Array of errors returned by the API.

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

コード例

                          # Curl command
curl -X PUT "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/v1/integration/gcp" \ -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 { "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "252bf553ef04b351@example.com", "client_id": "163662907116366290710", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "cloud_run_revision_filters": [ "merp:derp" ], "is_cspm_enabled": true, "is_security_command_center_enabled": true, "is_resource_change_collection_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account" } EOF
                          # Curl command
curl -X PUT "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/v1/integration/gcp" \ -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 { "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs", "auth_uri": "https://accounts.google.com/o/oauth2/auth", "client_email": "252bf553ef04b351@example.com", "client_id": "163662907116366290710", "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/$CLIENT_EMAIL", "host_filters": "key:value,filter:example", "is_cspm_enabled": true, "is_security_command_center_enabled": true, "is_resource_change_collection_enabled": true, "private_key": "private_key", "private_key_id": "123456789abcdefghi123456789abcdefghijklm", "project_id": "datadog-apitest", "resource_collection_enabled": true, "token_uri": "https://accounts.google.com/o/oauth2/token", "type": "service_account" } EOF

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

概要

Update an STS enabled service account. This endpoint requires the gcp_configuration_edit permission.

引数

パスパラメーター

名前

種類

説明

account_id [required]

string

Your GCP STS enabled service account’s unique ID.

リクエスト

Body Data (required)

Expand All

フィールド

種類

説明

data

object

Data on your service account.

attributes

object

Attributes associated with your service account.

account_tags

[string]

Tags to be associated with GCP metrics and service checks from your account.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your service account email address.

cloud_run_revision_filters

[string]

List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

host_filters

[string]

Your Host Filters.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

metric_namespace_configs

[object]

Configurations for GCP metric namespaces.

disabled

boolean

When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.

id

string

The id of the GCP metric namespace.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

id

string

Your service account's unique ID.

type

enum

The type of account. Allowed enum values: gcp_service_account

default: gcp_service_account

{
  "data": {
    "attributes": {
      "client_email": "Test-252bf553ef04b351@example.com",
      "host_filters": [
        "foo:bar"
      ]
    },
    "id": "d291291f-12c2-22g4-j290-123456678897",
    "type": "gcp_service_account"
  }
}
{
  "data": {
    "attributes": {
      "client_email": "Test-252bf553ef04b351@example.com",
      "cloud_run_revision_filters": [
        "merp:derp"
      ]
    },
    "id": "d291291f-12c2-22g4-j290-123456678897",
    "type": "gcp_service_account"
  }
}
{
  "data": {
    "attributes": {
      "client_email": "Test-252bf553ef04b351@example.com",
      "resource_collection_enabled": true
    },
    "id": "d291291f-12c2-22g4-j290-123456678897",
    "type": "gcp_service_account"
  }
}

応答

OK

The account creation response.

Expand All

フィールド

種類

説明

data

object

Info on your service account.

attributes

object

Attributes associated with your service account.

account_tags

[string]

Tags to be associated with GCP metrics and service checks from your account.

automute

boolean

Silence monitors for expected GCE instance shutdowns.

client_email

string

Your service account email address.

cloud_run_revision_filters

[string]

List of filters to limit the Cloud Run revisions that are pulled into Datadog by using tags. Only Cloud Run revision resources that apply to specified filters are imported into Datadog.

host_filters

[string]

Your Host Filters.

is_cspm_enabled

boolean

When enabled, Datadog will activate the Cloud Security Monitoring product for this service account. Note: This requires resource_collection_enabled to be set to true.

is_resource_change_collection_enabled

boolean

When enabled, Datadog scans for all resource change data in your Google Cloud environment.

is_security_command_center_enabled

boolean

When enabled, Datadog will attempt to collect Security Command Center Findings. Note: This requires additional permissions on the service account.

metric_namespace_configs

[object]

Configurations for GCP metric namespaces.

disabled

boolean

When disabled, Datadog does not collect metrics that are related to this GCP metric namespace.

id

string

The id of the GCP metric namespace.

resource_collection_enabled

boolean

When enabled, Datadog scans for all resources in your GCP environment.

id

string

Your service account's unique ID.

meta

object

Additional information related to your service account.

accessible_projects

[string]

The current list of projects accessible from your service account.

type

enum

The type of account. Allowed enum values: gcp_service_account

default: gcp_service_account

{
  "data": {
    "attributes": {
      "account_tags": [],
      "automute": false,
      "client_email": "datadog-service-account@test-project.iam.gserviceaccount.com",
      "cloud_run_revision_filters": [
        "$KEY:$VALUE"
      ],
      "host_filters": [],
      "is_cspm_enabled": false,
      "is_resource_change_collection_enabled": true,
      "is_security_command_center_enabled": true,
      "metric_namespace_configs": [
        {
          "disabled": true,
          "id": "aiplatform"
        }
      ],
      "resource_collection_enabled": false
    },
    "id": "d291291f-12c2-22g4-j290-123456678897",
    "meta": {
      "accessible_projects": []
    },
    "type": "gcp_service_account"
  }
}

Bad Request

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Not Authorized

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/integration/gcp/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": { "client_email": "Test-252bf553ef04b351@example.com", "host_filters": [ "foo:bar" ] }, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account" } } EOF
                          # 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/integration/gcp/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": { "client_email": "Test-252bf553ef04b351@example.com", "cloud_run_revision_filters": [ "merp:derp" ] }, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account" } } EOF
                          # 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/integration/gcp/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": { "client_email": "Test-252bf553ef04b351@example.com", "resource_collection_enabled": true }, "id": "d291291f-12c2-22g4-j290-123456678897", "type": "gcp_service_account" } } EOF

POST https://api.ap1.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.datadoghq.eu/api/v2/integration/gcp/sts_delegatehttps://api.ddog-gov.com/api/v2/integration/gcp/sts_delegatehttps://api.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.us3.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.us5.datadoghq.com/api/v2/integration/gcp/sts_delegate

概要

Create a Datadog GCP principal. This endpoint requires the gcp_configuration_edit permission.

リクエスト

Body Data

Create a delegate service account within Datadog.

Expand All

フィールド

種類

説明

No request body

{}

応答

OK

Your delegate service account response data.

Expand All

フィールド

種類

説明

data

object

Datadog principal service account info.

attributes

object

Your delegate account attributes.

delegate_account_email

string

Your organization's Datadog principal email address.

id

string

The ID of the delegate service account.

type

enum

The type of account. Allowed enum values: gcp_sts_delegate

default: gcp_sts_delegate

{
  "data": {
    "attributes": {
      "delegate_account_email": "ddgci-1a19n28hb1a812221893@datadog-gci-sts-us5-prod.iam.gserviceaccount.com"
    },
    "id": "ddgci-1a19n28hb1a812221893@datadog-gci-sts-us5-prod.iam.gserviceaccount.com",
    "type": "gcp_sts_delegate"
  }
}

Not Authorized

API error response.

Expand All

フィールド

種類

説明

errors [required]

[string]

A list of errors.

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

Conflict

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/integration/gcp/sts_delegate" \ -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 {} EOF

GET https://api.ap1.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.datadoghq.eu/api/v2/integration/gcp/sts_delegatehttps://api.ddog-gov.com/api/v2/integration/gcp/sts_delegatehttps://api.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.us3.datadoghq.com/api/v2/integration/gcp/sts_delegatehttps://api.us5.datadoghq.com/api/v2/integration/gcp/sts_delegate

概要

List your Datadog-GCP STS delegate account configured in your Datadog account. This endpoint requires the gcp_configuration_read permission.

応答

OK

Your delegate service account response data.

Expand All

フィールド

種類

説明

data

object

Datadog principal service account info.

attributes

object

Your delegate account attributes.

delegate_account_email

string

Your organization's Datadog principal email address.

id

string

The ID of the delegate service account.

type

enum

The type of account. Allowed enum values: gcp_sts_delegate

default: gcp_sts_delegate

{
  "data": {
    "attributes": {
      "delegate_account_email": "ddgci-1a19n28hb1a812221893@datadog-gci-sts-us5-prod.iam.gserviceaccount.com"
    },
    "id": "ddgci-1a19n28hb1a812221893@datadog-gci-sts-us5-prod.iam.gserviceaccount.com",
    "type": "gcp_sts_delegate"
  }
}

Not Authorized

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/integration/gcp/sts_delegate" \ -H "Accept: application/json" \ -H "DD-API-KEY: ${DD_API_KEY}" \ -H "DD-APPLICATION-KEY: ${DD_APP_KEY}"