Snowflake インテグレーションアカウントを更新してください

Note: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.

PATCH https://api.ap1.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.ap2.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.datadoghq.eu/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.ddog-gov.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.us2.ddog-gov.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.uk1.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.us3.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}https://api.us5.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/{account_id}

概要

Update a Snowflake integration account. Only the fields provided are changed. This endpoint requires the manage_integrations permission.

引数

パスパラメーター

名前

タイプ

説明

account_id [required]

string

Unique identifier of the integration account.

リクエスト

Body Data (required)

Expand All

フィールド

タイプ

説明

data [required]

object

Data envelope for updating a Snowflake integration account.

attributes [required]

object

Writable attributes used to update a Snowflake integration account. Every field is optional; only the fields provided are changed. When dataflows is provided, only the dataflow ids included in the request are modified; dataflows omitted from the map keep their current configuration, as do the settings of an included dataflow that provides only enabled.

authentication

 <oneOf>

Authentication for updating the Snowflake integration account. Exactly one method is set.

<auth_type=snowflake_private_key>

object

RSA key pair authentication, the only method Snowflake integration accounts support. Only the fields provided are changed; omit private_key to keep the stored one.

auth_type [required]

enum

The authentication method type. Allowed enum values: snowflake_private_key

default: snowflake_private_key

private_key

string

The private key, in PEM format.

private_key_name

string

Name that distinguishes this private key from other keys in Datadog.

private_key_passphrase

string

Passphrase that decrypts the private key. Provide it only when the key is encrypted. Omit it to keep the stored passphrase, send null or an empty string to remove it, or send a value to replace it.

dataflows

object

Data Datadog collects from Snowflake, keyed by dataflow id. Each dataflow turns on a distinct kind of collection: set enabled to start or stop it, and use settings to configure what it collects. Defaults listed on each dataflow apply when the account is created; on update, omitted fields keep their current values. Every dataflow reads from Snowflake as the user in settings.username, so that user's role must be granted access to the underlying views; a dataflow enabled without those grants is stored but collects no data.

snowflake-account-usage-metrics

object

Account-level usage metrics read from the Snowflake ACCOUNT_USAGE schema, covering storage usage, credit consumption, and query activity.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the account usage metrics dataflow. Only the fields provided are changed.

account_usage_metrics_aggregate_last_24h

boolean

The period each metric aggregates over. Set to true to aggregate the past 24 hours on a rolling basis, or false to aggregate the current day so far. Defaults to false.

snowflake-cloud-cost-metrics

object

Cost data aggregated from the Snowflake ORGANIZATION_USAGE schema. Cloud Cost Management must be enabled for your organization while this dataflow is enabled. Any request that enables this dataflow without Cloud Cost Management is rejected with a 422 response. The Snowflake role also needs the ORGANIZATION_BILLING_VIEWER database role to read the underlying cost views; without that role this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the Cloud Cost Management dataflow. Only the fields provided are changed.

query_tags

string

Snowflake query tags to ingest, so that cost data can be broken down by them in Cloud Cost Management. Provide the tag names as a comma-separated list without spaces, using only letters, digits, underscores, dots, and hyphens. Datadog does not collect query tags by default.

snowflake-data-observability-quality-monitoring

object

Data Observability, which collects lineage and data quality information from your Snowflake databases so you can explore how data flows and detect and resolve quality issues.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the Data Observability dataflow. Only the fields provided are changed.

do_table_crawler_cron

string

Cron expression setting how often Datadog crawls your Snowflake table metadata. It takes the five standard fields, with the restriction that the month must be * and that the day of the month and the day of the week cannot both be constrained. Common values are hourly (0 * * * *) and daily (0 0 * * *). Defaults to hourly (0 * * * *).

sync_snowflake_system_database

boolean

Whether metadata from the Snowflake SNOWFLAKE system database is included in Data Observability alongside your own databases. Defaults to true.

snowflake-event-table-logs

object

Records from your Snowflake event tables, used to monitor application behavior and identify issues. enabled turns the dataflow on and off as a whole, and the per-record-type toggles in settings select which kinds of record it collects while it is on. The Snowflake role needs usage granted on the database, the schema, and the event table itself; without those grants this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the event table dataflow. Each record type is collected independently so that you can control ingestion costs, and every record type is ingested into Datadog as logs tagged with its record_type. Only the fields provided are changed.

event_table_events_enabled

boolean

Whether records with a record_type of event are collected. Defaults to false.

event_table_logs_enabled

boolean

Whether records with a record_type of log are collected. Defaults to false.

event_table_logs_interval_min

int64

How often event table records are collected, in minutes. One of 5, 15, 30, 60, or 1440. Defaults to 5.

event_table_span_events_enabled

boolean

Whether records with a record_type of span_event are collected. Defaults to false.

event_table_spans_enabled

boolean

Whether records with a record_type of span are collected. Defaults to false.

snowflake-organization-usage-metrics

object

Organization-level usage metrics read from the Snowflake ORGANIZATION_USAGE schema, covering the credit consumption of every account in the organization and the history of data transferred out of Snowflake. Reading that schema requires the ORGADMIN role; without it this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the organization usage metrics dataflow. Only the fields provided are changed.

organization_usage_metrics_aggregate_last_24h

boolean

The period each metric aggregates over. Set to true to aggregate the past 24 hours on a rolling basis, or false to aggregate the current day so far. Defaults to false.

snowflake-query-history-logs

object

Per-query logs that let you identify long-running, poorly performing, and expensive queries.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the query history logs dataflow. Only the fields provided are changed.

join_query_history_with_access_history_enabled

boolean

Whether query logs are joined with Snowflake access history, which adds the objects each query read and wrote so you can follow how data is used and where it came from. Defaults to false.

query_history_logs_interval_min

int64

How often query history logs are collected, in minutes. One of 5, 15, 30, 60, 720, or 1440. Defaults to 5.

snowflake-security-logs

object

Security logs from the Snowflake ACCOUNT_USAGE schema, for analyzing the security of your Snowflake account and running threat detection with Cloud SIEM.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the security logs dataflow. Only the fields provided are changed.

security_logs_interval_min

int64

How often security logs are collected, in minutes. One of 5, 15, 30, 60, 360, 720, or 1440. Defaults to 5.

snowflake-task-history-logs

object

Execution logs for your scheduled Snowflake tasks, covering start time, end time, status, and any error message.

enabled

boolean

Whether Datadog collects this data. Defaults to false; set to true to start collection.

settings

object

Settings of the task history logs dataflow. Only the fields provided are changed.

task_history_logs_interval_min

int64

How often task history logs are collected, in minutes. One of 5, 15, 30, 60, or 1440. Defaults to 5.

name

string

Human-readable name of the Snowflake integration account. Must be unique within your Datadog organization.

settings

object

Settings for updating the Snowflake integration account. Only the fields provided are changed.

snowflake_account_identifier

string

Identifier of the Snowflake account to monitor, either as organization-account or as the legacy account_name.region_id.cloud_provider account locator. An account identifier can be configured once per Datadog organization; reusing one is rejected with a 422 response. Accounts reached through AWS PrivateLink are not supported.

username

string

Snowflake user Datadog authenticates as. Create a dedicated user for Datadog and grant it a role with access to the data you want to collect.

id [required]

string

Unique identifier of the Snowflake integration account to update.

type [required]

enum

The type of the integration account resource. Always integration-account. Allowed enum values: integration-account

default: integration-account

{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "snowflake_private_key",
        "private_key": "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----",
        "private_key_name": "my-rsa-key",
        "private_key_passphrase": "your-private-key-passphrase"
      },
      "dataflows": {
        "snowflake-account-usage-metrics": {
          "enabled": true,
          "settings": {
            "account_usage_metrics_aggregate_last_24h": false
          }
        },
        "snowflake-cloud-cost-metrics": {
          "enabled": true,
          "settings": {
            "query_tags": "env,team,cost_center"
          }
        },
        "snowflake-data-observability-quality-monitoring": {
          "enabled": true,
          "settings": {
            "do_table_crawler_cron": "0 */6 * * *",
            "sync_snowflake_system_database": true
          }
        },
        "snowflake-event-table-logs": {
          "enabled": true,
          "settings": {
            "event_table_events_enabled": true,
            "event_table_logs_enabled": true,
            "event_table_logs_interval_min": 15,
            "event_table_span_events_enabled": false,
            "event_table_spans_enabled": false
          }
        },
        "snowflake-organization-usage-metrics": {
          "enabled": true,
          "settings": {
            "organization_usage_metrics_aggregate_last_24h": false
          }
        },
        "snowflake-query-history-logs": {
          "enabled": true,
          "settings": {
            "join_query_history_with_access_history_enabled": true,
            "query_history_logs_interval_min": 15
          }
        },
        "snowflake-security-logs": {
          "enabled": true,
          "settings": {
            "security_logs_interval_min": 60
          }
        },
        "snowflake-task-history-logs": {
          "enabled": true,
          "settings": {
            "task_history_logs_interval_min": 30
          }
        }
      },
      "name": "prod-snowflake",
      "settings": {
        "snowflake_account_identifier": "myorg-myaccount",
        "username": "datadog_user"
      }
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "integration-account"
  }
}

応答

OK

Response payload for a single Snowflake integration account.

Expand All

フィールド

タイプ

説明

data [required]

object

Data envelope of a Snowflake integration account, including server-assigned identity.

attributes [required]

object

Attributes of a Snowflake integration account returned in responses.

authentication

 <oneOf>

Authentication configured on the Snowflake integration account.

<auth_type=snowflake_private_key>

object

The RSA key pair authentication method configured on the account.

auth_type [required]

enum

The authentication method type. Allowed enum values: snowflake_private_key

default: snowflake_private_key

private_key_name [required]

string

Name that distinguishes this private key from other keys in Datadog.

dataflows

object

Data Datadog collects from Snowflake, keyed by dataflow id.

snowflake-account-usage-metrics

object

Account-level usage metrics read from the Snowflake ACCOUNT_USAGE schema, covering storage usage, credit consumption, and query activity.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the account usage metrics dataflow.

account_usage_metrics_aggregate_last_24h

boolean

The period each metric aggregates over. When true, metrics aggregate the past 24 hours on a rolling basis; when false, they aggregate the current day so far.

snowflake-cloud-cost-metrics

object

Cost data aggregated from the Snowflake ORGANIZATION_USAGE schema. Requires Cloud Cost Management to be set up for your organization, and the ORGANIZATION_BILLING_VIEWER database role on the Snowflake role; without both this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the Cloud Cost Management dataflow.

query_tags

string

Snowflake query tags ingested as a comma-separated list of tag names, so that cost data can be broken down by them in Cloud Cost Management.

snowflake-data-observability-quality-monitoring

object

Data Observability, which collects lineage and data quality information from your Snowflake databases so you can explore how data flows and detect and resolve quality issues.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the Data Observability dataflow.

do_table_crawler_cron

string

Cron expression setting how often Datadog crawls your Snowflake table metadata.

sync_snowflake_system_database

boolean

Whether metadata from the Snowflake SNOWFLAKE system database is included in Data Observability alongside your own databases.

snowflake-event-table-logs

object

Records from your Snowflake event tables, used to monitor application behavior and identify issues. enabled turns the dataflow on and off as a whole, and the per-record-type toggles in settings select which kinds of record it collects while it is on. The Snowflake role needs usage granted on the database, the schema, and the event table itself; without those grants this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the event table dataflow. Each record type is collected independently so that you can control ingestion costs, and every record type is ingested into Datadog as logs tagged with its record_type.

event_table_events_enabled

boolean

Whether records with a record_type of event are collected.

event_table_logs_enabled

boolean

Whether records with a record_type of log are collected.

event_table_logs_interval_min

int64

How often event table records are collected, in minutes.

event_table_span_events_enabled

boolean

Whether records with a record_type of span_event are collected.

event_table_spans_enabled

boolean

Whether records with a record_type of span are collected.

snowflake-organization-usage-metrics

object

Organization-level usage metrics read from the Snowflake ORGANIZATION_USAGE schema, covering the credit consumption of every account in the organization and the history of data transferred out of Snowflake. Reading that schema requires the ORGADMIN role; without it this dataflow collects no data.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the organization usage metrics dataflow.

organization_usage_metrics_aggregate_last_24h

boolean

The period each metric aggregates over. When true, metrics aggregate the past 24 hours on a rolling basis; when false, they aggregate the current day so far.

snowflake-query-history-logs

object

Per-query logs that let you identify long-running, poorly performing, and expensive queries.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the query history logs dataflow.

join_query_history_with_access_history_enabled

boolean

Whether query logs are joined with Snowflake access history, which adds the objects each query read and wrote so you can follow how data is used and where it came from.

query_history_logs_interval_min

int64

How often query history logs are collected, in minutes.

snowflake-security-logs

object

Security logs from the Snowflake ACCOUNT_USAGE schema, for analyzing the security of your Snowflake account and running threat detection with Cloud SIEM.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the security logs dataflow.

security_logs_interval_min

int64

How often security logs are collected, in minutes.

snowflake-task-history-logs

object

Execution logs for your scheduled Snowflake tasks, covering start time, end time, status, and any error message.

enabled

boolean

Whether Datadog collects this data.

settings

object

Settings of the task history logs dataflow.

task_history_logs_interval_min

int64

How often task history logs are collected, in minutes.

name [required]

string

Human-readable name of the Snowflake integration account.

settings [required]

object

Settings configured on the Snowflake integration account.

snowflake_account_identifier [required]

string

Identifier of the Snowflake account being monitored.

username [required]

string

Snowflake user Datadog authenticates as.

id [required]

string

Server-generated unique identifier of the Snowflake integration account.

type [required]

enum

The type of the integration account resource. Always integration-account. Allowed enum values: integration-account

default: integration-account

{
  "data": {
    "attributes": {
      "authentication": {
        "auth_type": "snowflake_private_key",
        "private_key_name": "my-rsa-key"
      },
      "dataflows": {
        "snowflake-account-usage-metrics": {
          "enabled": true,
          "settings": {
            "account_usage_metrics_aggregate_last_24h": false
          }
        },
        "snowflake-cloud-cost-metrics": {
          "enabled": true,
          "settings": {
            "query_tags": "env,team,cost_center"
          }
        },
        "snowflake-data-observability-quality-monitoring": {
          "enabled": true,
          "settings": {
            "do_table_crawler_cron": "0 */6 * * *",
            "sync_snowflake_system_database": true
          }
        },
        "snowflake-event-table-logs": {
          "enabled": true,
          "settings": {
            "event_table_events_enabled": true,
            "event_table_logs_enabled": true,
            "event_table_logs_interval_min": 15,
            "event_table_span_events_enabled": false,
            "event_table_spans_enabled": false
          }
        },
        "snowflake-organization-usage-metrics": {
          "enabled": true,
          "settings": {
            "organization_usage_metrics_aggregate_last_24h": false
          }
        },
        "snowflake-query-history-logs": {
          "enabled": true,
          "settings": {
            "join_query_history_with_access_history_enabled": true,
            "query_history_logs_interval_min": 15
          }
        },
        "snowflake-security-logs": {
          "enabled": true,
          "settings": {
            "security_logs_interval_min": 60
          }
        },
        "snowflake-task-history-logs": {
          "enabled": true,
          "settings": {
            "task_history_logs_interval_min": 30
          }
        }
      },
      "name": "prod-snowflake",
      "settings": {
        "snowflake_account_identifier": "myorg-myaccount",
        "username": "datadog_user"
      }
    },
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "type": "integration-account"
  }
}

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"
  ]
}

The server cannot process the request because it contains invalid data.

API error response.

Expand All

フィールド

タイプ

説明

errors [required]

[object]

A list of errors.

detail

string

A human-readable explanation specific to this occurrence of the error.

meta

object

Non-standard meta-information about the error

source

object

References to the source of the error.

header

string

A string indicating the name of a single request header which caused the error.

parameter

string

A string indicating which URI query parameter caused the error.

pointer

string

A JSON pointer to the value in the request document that caused the error.

status

string

Status code of the response.

title

string

Short human-readable summary of the error.

{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "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"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

# Curl command
curl -X PATCH "https://api.ap1.datadoghq.com"https://api.ap2.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.us2.ddog-gov.com"https://api.uk1.datadoghq.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v2/integration-interfaces/snowflake/accounts/${account_id}" \ -H "Accept: application/json" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer ${DD_BEARER_TOKEN}" \ -d @- << EOF { "data": { "attributes": {}, "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "type": "integration-account" } } EOF
"""
Update a Snowflake integration account returns "OK" response
"""

from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.snowflake_integration_api import SnowflakeIntegrationApi
from datadog_api_client.v2.model.integration_account_type import IntegrationAccountType
from datadog_api_client.v2.model.snowflake_account_usage_metrics_integration_dataflow_request import (
    SnowflakeAccountUsageMetricsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_account_usage_metrics_integration_dataflow_settings_request import (
    SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_cloud_cost_metrics_integration_dataflow_request import (
    SnowflakeCloudCostMetricsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_cloud_cost_metrics_integration_dataflow_settings_request import (
    SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_data_observability_quality_monitoring_integration_dataflow_request import (
    SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_data_observability_quality_monitoring_integration_dataflow_settings_request import (
    SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_event_table_logs_integration_dataflow_request import (
    SnowflakeEventTableLogsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_event_table_logs_integration_dataflow_settings_request import (
    SnowflakeEventTableLogsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_integration_account_private_key_auth_type import (
    SnowflakeIntegrationAccountPrivateKeyAuthType,
)
from datadog_api_client.v2.model.snowflake_integration_account_private_key_auth_update import (
    SnowflakeIntegrationAccountPrivateKeyAuthUpdate,
)
from datadog_api_client.v2.model.snowflake_integration_account_settings_update import (
    SnowflakeIntegrationAccountSettingsUpdate,
)
from datadog_api_client.v2.model.snowflake_integration_account_update_attributes import (
    SnowflakeIntegrationAccountUpdateAttributes,
)
from datadog_api_client.v2.model.snowflake_integration_account_update_data import SnowflakeIntegrationAccountUpdateData
from datadog_api_client.v2.model.snowflake_integration_account_update_request import (
    SnowflakeIntegrationAccountUpdateRequest,
)
from datadog_api_client.v2.model.snowflake_integration_dataflows_request import SnowflakeIntegrationDataflowsRequest
from datadog_api_client.v2.model.snowflake_organization_usage_metrics_integration_dataflow_request import (
    SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_organization_usage_metrics_integration_dataflow_settings_request import (
    SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_query_history_logs_integration_dataflow_request import (
    SnowflakeQueryHistoryLogsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_query_history_logs_integration_dataflow_settings_request import (
    SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_security_logs_integration_dataflow_request import (
    SnowflakeSecurityLogsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_security_logs_integration_dataflow_settings_request import (
    SnowflakeSecurityLogsIntegrationDataflowSettingsRequest,
)
from datadog_api_client.v2.model.snowflake_task_history_logs_integration_dataflow_request import (
    SnowflakeTaskHistoryLogsIntegrationDataflowRequest,
)
from datadog_api_client.v2.model.snowflake_task_history_logs_integration_dataflow_settings_request import (
    SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest,
)

body = SnowflakeIntegrationAccountUpdateRequest(
    data=SnowflakeIntegrationAccountUpdateData(
        attributes=SnowflakeIntegrationAccountUpdateAttributes(
            authentication=SnowflakeIntegrationAccountPrivateKeyAuthUpdate(
                auth_type=SnowflakeIntegrationAccountPrivateKeyAuthType.SNOWFLAKE_PRIVATE_KEY,
                private_key="-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----",
                private_key_name="my-rsa-key",
                private_key_passphrase="your-private-key-passphrase",
            ),
            dataflows=SnowflakeIntegrationDataflowsRequest(
                snowflake_account_usage_metrics=SnowflakeAccountUsageMetricsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest(
                        account_usage_metrics_aggregate_last_24h=False,
                    ),
                ),
                snowflake_cloud_cost_metrics=SnowflakeCloudCostMetricsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest(
                        query_tags="env,team,cost_center",
                    ),
                ),
                snowflake_data_observability_quality_monitoring=SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest(
                        do_table_crawler_cron="0 */6 * * *",
                        sync_snowflake_system_database=True,
                    ),
                ),
                snowflake_event_table_logs=SnowflakeEventTableLogsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeEventTableLogsIntegrationDataflowSettingsRequest(
                        event_table_events_enabled=True,
                        event_table_logs_enabled=True,
                        event_table_logs_interval_min=15,
                        event_table_span_events_enabled=False,
                        event_table_spans_enabled=False,
                    ),
                ),
                snowflake_organization_usage_metrics=SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest(
                        organization_usage_metrics_aggregate_last_24h=False,
                    ),
                ),
                snowflake_query_history_logs=SnowflakeQueryHistoryLogsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest(
                        join_query_history_with_access_history_enabled=True,
                        query_history_logs_interval_min=15,
                    ),
                ),
                snowflake_security_logs=SnowflakeSecurityLogsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeSecurityLogsIntegrationDataflowSettingsRequest(
                        security_logs_interval_min=60,
                    ),
                ),
                snowflake_task_history_logs=SnowflakeTaskHistoryLogsIntegrationDataflowRequest(
                    enabled=True,
                    settings=SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest(
                        task_history_logs_interval_min=30,
                    ),
                ),
            ),
            name="prod-snowflake",
            settings=SnowflakeIntegrationAccountSettingsUpdate(
                snowflake_account_identifier="myorg-myaccount",
                username="datadog_user",
            ),
        ),
        id="a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        type=IntegrationAccountType.INTEGRATION_ACCOUNT,
    ),
)

configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["update_snowflake_integration_account"] = True
with ApiClient(configuration) as api_client:
    api_instance = SnowflakeIntegrationApi(api_client)
    response = api_instance.update_snowflake_integration_account(account_id="account_id", body=body)

    print(response)

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"
# Update a Snowflake integration account returns "OK" response

require "datadog_api_client"
DatadogAPIClient.configure do |config|
  config.access_token = ENV["DD_BEARER_TOKEN"]
  config.unstable_operations["v2.update_snowflake_integration_account".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SnowflakeIntegrationAPI.new

body = DatadogAPIClient::V2::SnowflakeIntegrationAccountUpdateRequest.new({
  data: DatadogAPIClient::V2::SnowflakeIntegrationAccountUpdateData.new({
    attributes: DatadogAPIClient::V2::SnowflakeIntegrationAccountUpdateAttributes.new({
      authentication: DatadogAPIClient::V2::SnowflakeIntegrationAccountPrivateKeyAuthUpdate.new({
        auth_type: DatadogAPIClient::V2::SnowflakeIntegrationAccountPrivateKeyAuthType::SNOWFLAKE_PRIVATE_KEY,
        private_key: '-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----',
        private_key_name: "my-rsa-key",
        private_key_passphrase: "your-private-key-passphrase",
      }),
      dataflows: DatadogAPIClient::V2::SnowflakeIntegrationDataflowsRequest.new({
        snowflake_account_usage_metrics: DatadogAPIClient::V2::SnowflakeAccountUsageMetricsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest.new({
            account_usage_metrics_aggregate_last_24h: false,
          }),
        }),
        snowflake_cloud_cost_metrics: DatadogAPIClient::V2::SnowflakeCloudCostMetricsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest.new({
            query_tags: "env,team,cost_center",
          }),
        }),
        snowflake_data_observability_quality_monitoring: DatadogAPIClient::V2::SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest.new({
            do_table_crawler_cron: "0 */6 * * *",
            sync_snowflake_system_database: true,
          }),
        }),
        snowflake_event_table_logs: DatadogAPIClient::V2::SnowflakeEventTableLogsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeEventTableLogsIntegrationDataflowSettingsRequest.new({
            event_table_events_enabled: true,
            event_table_logs_enabled: true,
            event_table_logs_interval_min: 15,
            event_table_span_events_enabled: false,
            event_table_spans_enabled: false,
          }),
        }),
        snowflake_organization_usage_metrics: DatadogAPIClient::V2::SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest.new({
            organization_usage_metrics_aggregate_last_24h: false,
          }),
        }),
        snowflake_query_history_logs: DatadogAPIClient::V2::SnowflakeQueryHistoryLogsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest.new({
            join_query_history_with_access_history_enabled: true,
            query_history_logs_interval_min: 15,
          }),
        }),
        snowflake_security_logs: DatadogAPIClient::V2::SnowflakeSecurityLogsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeSecurityLogsIntegrationDataflowSettingsRequest.new({
            security_logs_interval_min: 60,
          }),
        }),
        snowflake_task_history_logs: DatadogAPIClient::V2::SnowflakeTaskHistoryLogsIntegrationDataflowRequest.new({
          enabled: true,
          settings: DatadogAPIClient::V2::SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest.new({
            task_history_logs_interval_min: 30,
          }),
        }),
      }),
      name: "prod-snowflake",
      settings: DatadogAPIClient::V2::SnowflakeIntegrationAccountSettingsUpdate.new({
        snowflake_account_identifier: "myorg-myaccount",
        username: "datadog_user",
      }),
    }),
    id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT,
  }),
})
p api_instance.update_snowflake_integration_account("account_id", body)

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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"
// Update a Snowflake integration account 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/datadogV2"
)

func main() {
	body := datadogV2.SnowflakeIntegrationAccountUpdateRequest{
		Data: datadogV2.SnowflakeIntegrationAccountUpdateData{
			Attributes: datadogV2.SnowflakeIntegrationAccountUpdateAttributes{
				Authentication: &datadogV2.SnowflakeIntegrationAccountAuthenticationUpdate{
					SnowflakeIntegrationAccountPrivateKeyAuthUpdate: &datadogV2.SnowflakeIntegrationAccountPrivateKeyAuthUpdate{
						AuthType: datadogV2.SNOWFLAKEINTEGRATIONACCOUNTPRIVATEKEYAUTHTYPE_SNOWFLAKE_PRIVATE_KEY,
						PrivateKey: datadog.PtrString(`-----BEGIN PRIVATE KEY-----
MIIE...
-----END PRIVATE KEY-----`),
						PrivateKeyName:       datadog.PtrString("my-rsa-key"),
						PrivateKeyPassphrase: *datadog.NewNullableString(datadog.PtrString("your-private-key-passphrase")),
					}},
				Dataflows: &datadogV2.SnowflakeIntegrationDataflowsRequest{
					SnowflakeAccountUsageMetrics: &datadogV2.SnowflakeAccountUsageMetricsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest{
							AccountUsageMetricsAggregateLast24h: datadog.PtrBool(false),
						},
					},
					SnowflakeCloudCostMetrics: &datadogV2.SnowflakeCloudCostMetricsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest{
							QueryTags: datadog.PtrString("env,team,cost_center"),
						},
					},
					SnowflakeDataObservabilityQualityMonitoring: &datadogV2.SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest{
							DoTableCrawlerCron:          datadog.PtrString("0 */6 * * *"),
							SyncSnowflakeSystemDatabase: datadog.PtrBool(true),
						},
					},
					SnowflakeEventTableLogs: &datadogV2.SnowflakeEventTableLogsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeEventTableLogsIntegrationDataflowSettingsRequest{
							EventTableEventsEnabled:     datadog.PtrBool(true),
							EventTableLogsEnabled:       datadog.PtrBool(true),
							EventTableLogsIntervalMin:   datadog.PtrInt64(15),
							EventTableSpanEventsEnabled: datadog.PtrBool(false),
							EventTableSpansEnabled:      datadog.PtrBool(false),
						},
					},
					SnowflakeOrganizationUsageMetrics: &datadogV2.SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest{
							OrganizationUsageMetricsAggregateLast24h: datadog.PtrBool(false),
						},
					},
					SnowflakeQueryHistoryLogs: &datadogV2.SnowflakeQueryHistoryLogsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest{
							JoinQueryHistoryWithAccessHistoryEnabled: datadog.PtrBool(true),
							QueryHistoryLogsIntervalMin:              datadog.PtrInt64(15),
						},
					},
					SnowflakeSecurityLogs: &datadogV2.SnowflakeSecurityLogsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeSecurityLogsIntegrationDataflowSettingsRequest{
							SecurityLogsIntervalMin: datadog.PtrInt64(60),
						},
					},
					SnowflakeTaskHistoryLogs: &datadogV2.SnowflakeTaskHistoryLogsIntegrationDataflowRequest{
						Enabled: datadog.PtrBool(true),
						Settings: &datadogV2.SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest{
							TaskHistoryLogsIntervalMin: datadog.PtrInt64(30),
						},
					},
				},
				Name: datadog.PtrString("prod-snowflake"),
				Settings: &datadogV2.SnowflakeIntegrationAccountSettingsUpdate{
					SnowflakeAccountIdentifier: datadog.PtrString("myorg-myaccount"),
					Username:                   datadog.PtrString("datadog_user"),
				},
			},
			Id:   "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
			Type: datadogV2.INTEGRATIONACCOUNTTYPE_INTEGRATION_ACCOUNT,
		},
	}
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.UpdateSnowflakeIntegrationAccount", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSnowflakeIntegrationApi(apiClient)
	resp, r, err := api.UpdateSnowflakeIntegrationAccount(ctx, "account_id", body)

	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SnowflakeIntegrationApi.UpdateSnowflakeIntegrationAccount`: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SnowflakeIntegrationApi.UpdateSnowflakeIntegrationAccount`:\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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"
// Update a Snowflake integration account returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.SnowflakeIntegrationApi;
import com.datadog.api.client.v2.model.IntegrationAccountType;
import com.datadog.api.client.v2.model.SnowflakeAccountUsageMetricsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeCloudCostMetricsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeEventTableLogsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeEventTableLogsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountAuthenticationUpdate;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountPrivateKeyAuthType;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountPrivateKeyAuthUpdate;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountResponse;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountSettingsUpdate;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountUpdateAttributes;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountUpdateData;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountUpdateRequest;
import com.datadog.api.client.v2.model.SnowflakeIntegrationDataflowsRequest;
import com.datadog.api.client.v2.model.SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeQueryHistoryLogsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeSecurityLogsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeSecurityLogsIntegrationDataflowSettingsRequest;
import com.datadog.api.client.v2.model.SnowflakeTaskHistoryLogsIntegrationDataflowRequest;
import com.datadog.api.client.v2.model.SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
    defaultClient.setUnstableOperationEnabled("v2.updateSnowflakeIntegrationAccount", true);
    SnowflakeIntegrationApi apiInstance = new SnowflakeIntegrationApi(defaultClient);

    SnowflakeIntegrationAccountUpdateRequest body =
        new SnowflakeIntegrationAccountUpdateRequest()
            .data(
                new SnowflakeIntegrationAccountUpdateData()
                    .attributes(
                        new SnowflakeIntegrationAccountUpdateAttributes()
                            .authentication(
                                new SnowflakeIntegrationAccountAuthenticationUpdate(
                                    new SnowflakeIntegrationAccountPrivateKeyAuthUpdate()
                                        .authType(
                                            SnowflakeIntegrationAccountPrivateKeyAuthType
                                                .SNOWFLAKE_PRIVATE_KEY)
                                        .privateKey(
                                            """
-----BEGIN PRIVATE KEY-----
MIIE...
-----END PRIVATE KEY-----
""")
                                        .privateKeyName("my-rsa-key")
                                        .privateKeyPassphrase("your-private-key-passphrase")))
                            .dataflows(
                                new SnowflakeIntegrationDataflowsRequest()
                                    .snowflakeAccountUsageMetrics(
                                        new SnowflakeAccountUsageMetricsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest()
                                                    .accountUsageMetricsAggregateLast24h(false)))
                                    .snowflakeCloudCostMetrics(
                                        new SnowflakeCloudCostMetricsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest()
                                                    .queryTags("env,team,cost_center")))
                                    .snowflakeDataObservabilityQualityMonitoring(
                                        new SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest()
                                                    .doTableCrawlerCron("0 */6 * * *")
                                                    .syncSnowflakeSystemDatabase(true)))
                                    .snowflakeEventTableLogs(
                                        new SnowflakeEventTableLogsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeEventTableLogsIntegrationDataflowSettingsRequest()
                                                    .eventTableEventsEnabled(true)
                                                    .eventTableLogsEnabled(true)
                                                    .eventTableLogsIntervalMin(15L)
                                                    .eventTableSpanEventsEnabled(false)
                                                    .eventTableSpansEnabled(false)))
                                    .snowflakeOrganizationUsageMetrics(
                                        new SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest()
                                                    .organizationUsageMetricsAggregateLast24h(
                                                        false)))
                                    .snowflakeQueryHistoryLogs(
                                        new SnowflakeQueryHistoryLogsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest()
                                                    .joinQueryHistoryWithAccessHistoryEnabled(true)
                                                    .queryHistoryLogsIntervalMin(15L)))
                                    .snowflakeSecurityLogs(
                                        new SnowflakeSecurityLogsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeSecurityLogsIntegrationDataflowSettingsRequest()
                                                    .securityLogsIntervalMin(60L)))
                                    .snowflakeTaskHistoryLogs(
                                        new SnowflakeTaskHistoryLogsIntegrationDataflowRequest()
                                            .enabled(true)
                                            .settings(
                                                new SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest()
                                                    .taskHistoryLogsIntervalMin(30L))))
                            .name("prod-snowflake")
                            .settings(
                                new SnowflakeIntegrationAccountSettingsUpdate()
                                    .snowflakeAccountIdentifier("myorg-myaccount")
                                    .username("datadog_user")))
                    .id("a1b2c3d4-e5f6-7890-abcd-ef1234567890")
                    .type(IntegrationAccountType.INTEGRATION_ACCOUNT));

    try {
      SnowflakeIntegrationAccountResponse result =
          apiInstance.updateSnowflakeIntegrationAccount("account_id", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling SnowflakeIntegrationApi#updateSnowflakeIntegrationAccount");
      System.err.println("Status code: " + e.getCode());
      System.err.println("Reason: " + e.getResponseBody());
      System.err.println("Response headers: " + e.getResponseHeaders());
      e.printStackTrace();
    }
  }
}

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"
// Update a Snowflake integration account returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_snowflake_integration::SnowflakeIntegrationAPI;
use datadog_api_client::datadogV2::model::IntegrationAccountType;
use datadog_api_client::datadogV2::model::SnowflakeAccountUsageMetricsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeCloudCostMetricsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeEventTableLogsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeEventTableLogsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountAuthenticationUpdate;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountPrivateKeyAuthType;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountPrivateKeyAuthUpdate;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountSettingsUpdate;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountUpdateAttributes;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountUpdateData;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountUpdateRequest;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationDataflowsRequest;
use datadog_api_client::datadogV2::model::SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeQueryHistoryLogsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeSecurityLogsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeSecurityLogsIntegrationDataflowSettingsRequest;
use datadog_api_client::datadogV2::model::SnowflakeTaskHistoryLogsIntegrationDataflowRequest;
use datadog_api_client::datadogV2::model::SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest;

#[tokio::main]
async fn main() {
    let body =
        SnowflakeIntegrationAccountUpdateRequest::new(
            SnowflakeIntegrationAccountUpdateData::new(
                SnowflakeIntegrationAccountUpdateAttributes::new()
                    .authentication(
                        SnowflakeIntegrationAccountAuthenticationUpdate
                        ::SnowflakeIntegrationAccountPrivateKeyAuthUpdate(
                            Box::new(
                                SnowflakeIntegrationAccountPrivateKeyAuthUpdate::new(
                                    SnowflakeIntegrationAccountPrivateKeyAuthType::SNOWFLAKE_PRIVATE_KEY,
                                )
                                    .private_key(
                                        r#"-----BEGIN PRIVATE KEY-----
MIIE...
-----END PRIVATE KEY-----"#.to_string(),
                                    )
                                    .private_key_name("my-rsa-key".to_string())
                                    .private_key_passphrase(Some("your-private-key-passphrase".to_string())),
                            ),
                        ),
                    )
                    .dataflows(
                        SnowflakeIntegrationDataflowsRequest::new()
                            .snowflake_account_usage_metrics(
                                SnowflakeAccountUsageMetricsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeAccountUsageMetricsIntegrationDataflowSettingsRequest
                                        ::new().account_usage_metrics_aggregate_last_24h(false),
                                    ),
                            )
                            .snowflake_cloud_cost_metrics(
                                SnowflakeCloudCostMetricsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeCloudCostMetricsIntegrationDataflowSettingsRequest
                                        ::new().query_tags("env,team,cost_center".to_string()),
                                    ),
                            )
                            .snowflake_data_observability_quality_monitoring(
                                SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeDataObservabilityQualityMonitoringIntegrationDataflowSettingsRequest
                                        ::new()
                                            .do_table_crawler_cron("0 */6 * * *".to_string())
                                            .sync_snowflake_system_database(true),
                                    ),
                            )
                            .snowflake_event_table_logs(
                                SnowflakeEventTableLogsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeEventTableLogsIntegrationDataflowSettingsRequest::new()
                                            .event_table_events_enabled(true)
                                            .event_table_logs_enabled(true)
                                            .event_table_logs_interval_min(15)
                                            .event_table_span_events_enabled(false)
                                            .event_table_spans_enabled(false),
                                    ),
                            )
                            .snowflake_organization_usage_metrics(
                                SnowflakeOrganizationUsageMetricsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeOrganizationUsageMetricsIntegrationDataflowSettingsRequest
                                        ::new().organization_usage_metrics_aggregate_last_24h(false),
                                    ),
                            )
                            .snowflake_query_history_logs(
                                SnowflakeQueryHistoryLogsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeQueryHistoryLogsIntegrationDataflowSettingsRequest::new()
                                            .join_query_history_with_access_history_enabled(true)
                                            .query_history_logs_interval_min(15),
                                    ),
                            )
                            .snowflake_security_logs(
                                SnowflakeSecurityLogsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeSecurityLogsIntegrationDataflowSettingsRequest
                                        ::new().security_logs_interval_min(60),
                                    ),
                            )
                            .snowflake_task_history_logs(
                                SnowflakeTaskHistoryLogsIntegrationDataflowRequest::new()
                                    .enabled(true)
                                    .settings(
                                        SnowflakeTaskHistoryLogsIntegrationDataflowSettingsRequest
                                        ::new().task_history_logs_interval_min(30),
                                    ),
                            ),
                    )
                    .name("prod-snowflake".to_string())
                    .settings(
                        SnowflakeIntegrationAccountSettingsUpdate::new()
                            .snowflake_account_identifier("myorg-myaccount".to_string())
                            .username("datadog_user".to_string()),
                    ),
                "a1b2c3d4-e5f6-7890-abcd-ef1234567890".to_string(),
                IntegrationAccountType::INTEGRATION_ACCOUNT,
            ),
        );
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.update_snowflake_integration_account", true);
    let api = SnowflakeIntegrationAPI::with_config(configuration);
    let resp = api
        .update_snowflake_integration_account("account_id".to_string(), 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.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run
/**
 * Update a Snowflake integration account returns "OK" response
 */

import { client, v2 } from "@datadog/datadog-api-client";

const configuration = client.createConfiguration({
  authMethods: {
    AuthZ: {
      accessToken: process.env.DD_BEARER_TOKEN as string,
    },
  },
});
configuration.unstableOperations["v2.updateSnowflakeIntegrationAccount"] = true;
const apiInstance = new v2.SnowflakeIntegrationApi(configuration);

const params: v2.SnowflakeIntegrationApiUpdateSnowflakeIntegrationAccountRequest =
  {
    body: {
      data: {
        attributes: {
          authentication: {
            authType: "snowflake_private_key",
            privateKey:
              "-----BEGIN PRIVATE KEY-----\nMIIE...\n-----END PRIVATE KEY-----",
            privateKeyName: "my-rsa-key",
            privateKeyPassphrase: "your-private-key-passphrase",
          },
          dataflows: {
            snowflakeAccountUsageMetrics: {
              enabled: true,
              settings: {
                accountUsageMetricsAggregateLast24h: false,
              },
            },
            snowflakeCloudCostMetrics: {
              enabled: true,
              settings: {
                queryTags: "env,team,cost_center",
              },
            },
            snowflakeDataObservabilityQualityMonitoring: {
              enabled: true,
              settings: {
                doTableCrawlerCron: "0 */6 * * *",
                syncSnowflakeSystemDatabase: true,
              },
            },
            snowflakeEventTableLogs: {
              enabled: true,
              settings: {
                eventTableEventsEnabled: true,
                eventTableLogsEnabled: true,
                eventTableLogsIntervalMin: 15,
                eventTableSpanEventsEnabled: false,
                eventTableSpansEnabled: false,
              },
            },
            snowflakeOrganizationUsageMetrics: {
              enabled: true,
              settings: {
                organizationUsageMetricsAggregateLast24h: false,
              },
            },
            snowflakeQueryHistoryLogs: {
              enabled: true,
              settings: {
                joinQueryHistoryWithAccessHistoryEnabled: true,
                queryHistoryLogsIntervalMin: 15,
              },
            },
            snowflakeSecurityLogs: {
              enabled: true,
              settings: {
                securityLogsIntervalMin: 60,
              },
            },
            snowflakeTaskHistoryLogs: {
              enabled: true,
              settings: {
                taskHistoryLogsIntervalMin: 30,
              },
            },
          },
          name: "prod-snowflake",
          settings: {
            snowflakeAccountIdentifier: "myorg-myaccount",
            username: "datadog_user",
          },
        },
        id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
        type: "integration-account",
      },
    },
    accountId: "account_id",
  };

apiInstance
  .updateSnowflakeIntegrationAccount(params)
  .then((data: v2.SnowflakeIntegrationAccountResponse) => {
    console.log(
      "API called successfully. Returned data: " + JSON.stringify(data)
    );
  })
  .catch((error: any) => console.error(error));

Instructions

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

    
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comuk1.datadoghq.comddog-gov.comus2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"