Create a Snowflake integration account
https://api.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.us3.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.us5.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.datadoghq.eu/api/v2/integration-interfaces/snowflake/accountshttps://api.ap1.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.ap2.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.uk1.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.ddog-gov.com/api/v2/integration-interfaces/snowflake/accountshttps://api.us2.ddog-gov.com/api/v2/integration-interfaces/snowflake/accounts개요
Create a Snowflake integration account.
요청
Body Data (required)
data [required]Data envelope for creating a Snowflake integration account.
attributes [required]Writable attributes used to create a Snowflake integration account.
authentication [required]Authentication for creating the Snowflake integration account. Exactly one method is set.
<auth_type=snowflake_private_key>RSA key pair authentication, the only method Snowflake integration accounts support. Generate an RSA key pair and assign the public key to the Snowflake user named in settings.username.
auth_type [required]The authentication method type.
snowflake_private_keysnowflake_private_keyprivate_key [required]The private key, in PEM format.
private_key_name [required]Name that distinguishes this private key from other keys in Datadog.
private_key_passphrasePassphrase that decrypts the private key. Provide it only when the key is encrypted.
dataflowsData 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-metricsAccount-level usage metrics read from the Snowflake ACCOUNT_USAGE schema, covering storage usage, credit consumption, and query activity.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the account usage metrics dataflow. Only the fields provided are changed.
account_usage_metrics_aggregate_last_24hThe 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-metricsCost 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.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the Cloud Cost Management dataflow. Only the fields provided are changed.
query_tagsSnowflake 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-monitoringData 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.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the Data Observability dataflow. Only the fields provided are changed.
do_table_crawler_cronCron 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_databaseWhether metadata from the Snowflake SNOWFLAKE system database is included in Data Observability alongside your own databases. Defaults to true.
snowflake-event-table-logsRecords 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.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings 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_enabledWhether records with a record_type of event are collected. Defaults to false.
event_table_logs_enabledWhether records with a record_type of log are collected. Defaults to false.
event_table_logs_interval_minHow often event table records are collected, in minutes. One of 5, 15, 30, 60, or 1440. Defaults to 5.
event_table_span_events_enabledWhether records with a record_type of span_event are collected. Defaults to false.
event_table_spans_enabledWhether records with a record_type of span are collected. Defaults to false.
snowflake-organization-usage-metricsOrganization-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.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the organization usage metrics dataflow. Only the fields provided are changed.
organization_usage_metrics_aggregate_last_24hThe 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-logsPer-query logs that let you identify long-running, poorly performing, and expensive queries.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the query history logs dataflow. Only the fields provided are changed.
join_query_history_with_access_history_enabledWhether 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_minHow often query history logs are collected, in minutes. One of 5, 15, 30, 60, 720, or 1440. Defaults to 5.
snowflake-security-logsSecurity logs from the Snowflake ACCOUNT_USAGE schema, for analyzing the security of your Snowflake account and running threat detection with Cloud SIEM.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the security logs dataflow. Only the fields provided are changed.
security_logs_interval_minHow often security logs are collected, in minutes. One of 5, 15, 30, 60, 360, 720, or 1440. Defaults to 5.
snowflake-task-history-logsExecution logs for your scheduled Snowflake tasks, covering start time, end time, status, and any error message.
enabledWhether Datadog collects this data. Defaults to false; set to true to start collection.
settingsSettings of the task history logs dataflow. Only the fields provided are changed.
task_history_logs_interval_minHow often task history logs are collected, in minutes. One of 5, 15, 30, 60, or 1440. Defaults to 5.
name [required]Human-readable name of the Snowflake integration account. Must be unique within your Datadog organization.
settings [required]Settings for creating the Snowflake integration account.
snowflake_account_identifier [required]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 [required]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.
type [required]The type of the integration account resource. Always integration-account.
integration-accountintegration-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"
}
},
"type": "integration-account"
}
}응답
Created
Response payload for a single Snowflake integration account.
data [required]Data envelope of a Snowflake integration account, including server-assigned identity.
attributes [required]Attributes of a Snowflake integration account returned in responses.
authenticationAuthentication configured on the Snowflake integration account.
<auth_type=snowflake_private_key>The RSA key pair authentication method configured on the account.
auth_type [required]The authentication method type.
snowflake_private_keysnowflake_private_keyprivate_key_name [required]Name that distinguishes this private key from other keys in Datadog.
dataflowsData Datadog collects from Snowflake, keyed by dataflow id.
snowflake-account-usage-metricsAccount-level usage metrics read from the Snowflake ACCOUNT_USAGE schema, covering storage usage, credit consumption, and query activity.
enabledWhether Datadog collects this data.
settingsSettings of the account usage metrics dataflow.
account_usage_metrics_aggregate_last_24hThe 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-metricsCost 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.
enabledWhether Datadog collects this data.
settingsSettings of the Cloud Cost Management dataflow.
query_tagsSnowflake 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-monitoringData 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.
enabledWhether Datadog collects this data.
settingsSettings of the Data Observability dataflow.
do_table_crawler_cronCron expression setting how often Datadog crawls your Snowflake table metadata.
sync_snowflake_system_databaseWhether metadata from the Snowflake SNOWFLAKE system database is included in Data Observability alongside your own databases.
snowflake-event-table-logsRecords 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.
enabledWhether Datadog collects this data.
settingsSettings 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_enabledWhether records with a record_type of event are collected.
event_table_logs_enabledWhether records with a record_type of log are collected.
event_table_logs_interval_minHow often event table records are collected, in minutes.
event_table_span_events_enabledWhether records with a record_type of span_event are collected.
event_table_spans_enabledWhether records with a record_type of span are collected.
snowflake-organization-usage-metricsOrganization-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.
enabledWhether Datadog collects this data.
settingsSettings of the organization usage metrics dataflow.
organization_usage_metrics_aggregate_last_24hThe 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-logsPer-query logs that let you identify long-running, poorly performing, and expensive queries.
enabledWhether Datadog collects this data.
settingsSettings of the query history logs dataflow.
join_query_history_with_access_history_enabledWhether 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_minHow often query history logs are collected, in minutes.
snowflake-security-logsSecurity logs from the Snowflake ACCOUNT_USAGE schema, for analyzing the security of your Snowflake account and running threat detection with Cloud SIEM.
enabledWhether Datadog collects this data.
settingsSettings of the security logs dataflow.
security_logs_interval_minHow often security logs are collected, in minutes.
snowflake-task-history-logsExecution logs for your scheduled Snowflake tasks, covering start time, end time, status, and any error message.
enabledWhether Datadog collects this data.
settingsSettings of the task history logs dataflow.
task_history_logs_interval_minHow often task history logs are collected, in minutes.
name [required]Human-readable name of the Snowflake integration account.
settings [required]Settings configured on the Snowflake integration account.
snowflake_account_identifier [required]Identifier of the Snowflake account being monitored.
username [required]Snowflake user Datadog authenticates as.
id [required]Server-generated unique identifier of the Snowflake integration account.
type [required]The type of the integration account resource. Always integration-account.
integration-accountintegration-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.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Not Found
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}The server cannot process the request because it contains invalid data.
API error response.
errors [required]A list of errors.
detailA human-readable explanation specific to this occurrence of the error.
metaNon-standard meta-information about the error
sourceReferences to the source of the error.
headerA string indicating the name of a single request header which caused the error.
parameterA string indicating which URI query parameter caused the error.
pointerA JSON pointer to the value in the request document that caused the error.
statusStatus code of the response.
titleShort 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.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}코드 예시
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"
curl -X POST "https://api.${DD_SITE}/api/v2/integration-interfaces/snowflake/accounts" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
"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"
}
},
"type": "integration-account"
}
}
EOF// Create a Snowflake integration account returns "Created" 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.SnowflakeIntegrationAccountCreateRequest{
Data: datadogV2.SnowflakeIntegrationAccountCreateData{
Attributes: datadogV2.SnowflakeIntegrationAccountCreateAttributes{
Authentication: datadogV2.SnowflakeIntegrationAccountAuthenticationRequest{
SnowflakeIntegrationAccountPrivateKeyAuthRequest: &datadogV2.SnowflakeIntegrationAccountPrivateKeyAuthRequest{
AuthType: datadogV2.SNOWFLAKEINTEGRATIONACCOUNTPRIVATEKEYAUTHTYPE_SNOWFLAKE_PRIVATE_KEY,
PrivateKey: `-----BEGIN PRIVATE KEY-----
MIIE...
-----END PRIVATE KEY-----`,
PrivateKeyName: "my-rsa-key",
PrivateKeyPassphrase: 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: "prod-snowflake",
Settings: datadogV2.SnowflakeIntegrationAccountSettingsRequest{
SnowflakeAccountIdentifier: "myorg-myaccount",
Username: "datadog_user",
},
},
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.CreateSnowflakeIntegrationAccount", true)
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewSnowflakeIntegrationApi(apiClient)
resp, r, err := api.CreateSnowflakeIntegrationAccount(ctx, body)
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `SnowflakeIntegrationApi.CreateSnowflakeIntegrationAccount`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `SnowflakeIntegrationApi.CreateSnowflakeIntegrationAccount`:\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.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" go run "main.go"// Create a Snowflake integration account returns "Created" 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.SnowflakeIntegrationAccountAuthenticationRequest;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountCreateAttributes;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountCreateData;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountCreateRequest;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountPrivateKeyAuthRequest;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountPrivateKeyAuthType;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountResponse;
import com.datadog.api.client.v2.model.SnowflakeIntegrationAccountSettingsRequest;
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.createSnowflakeIntegrationAccount", true);
SnowflakeIntegrationApi apiInstance = new SnowflakeIntegrationApi(defaultClient);
SnowflakeIntegrationAccountCreateRequest body =
new SnowflakeIntegrationAccountCreateRequest()
.data(
new SnowflakeIntegrationAccountCreateData()
.attributes(
new SnowflakeIntegrationAccountCreateAttributes()
.authentication(
new SnowflakeIntegrationAccountAuthenticationRequest(
new SnowflakeIntegrationAccountPrivateKeyAuthRequest()
.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 SnowflakeIntegrationAccountSettingsRequest()
.snowflakeAccountIdentifier("myorg-myaccount")
.username("datadog_user")))
.type(IntegrationAccountType.INTEGRATION_ACCOUNT));
try {
SnowflakeIntegrationAccountResponse result =
apiInstance.createSnowflakeIntegrationAccount(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println(
"Exception when calling SnowflakeIntegrationApi#createSnowflakeIntegrationAccount");
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.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" java "Example.java""""
Create a Snowflake integration account returns "Created" 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_create_attributes import (
SnowflakeIntegrationAccountCreateAttributes,
)
from datadog_api_client.v2.model.snowflake_integration_account_create_data import SnowflakeIntegrationAccountCreateData
from datadog_api_client.v2.model.snowflake_integration_account_create_request import (
SnowflakeIntegrationAccountCreateRequest,
)
from datadog_api_client.v2.model.snowflake_integration_account_private_key_auth_request import (
SnowflakeIntegrationAccountPrivateKeyAuthRequest,
)
from datadog_api_client.v2.model.snowflake_integration_account_private_key_auth_type import (
SnowflakeIntegrationAccountPrivateKeyAuthType,
)
from datadog_api_client.v2.model.snowflake_integration_account_settings_request import (
SnowflakeIntegrationAccountSettingsRequest,
)
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 = SnowflakeIntegrationAccountCreateRequest(
data=SnowflakeIntegrationAccountCreateData(
attributes=SnowflakeIntegrationAccountCreateAttributes(
authentication=SnowflakeIntegrationAccountPrivateKeyAuthRequest(
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=SnowflakeIntegrationAccountSettingsRequest(
snowflake_account_identifier="myorg-myaccount",
username="datadog_user",
),
),
type=IntegrationAccountType.INTEGRATION_ACCOUNT,
),
)
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
configuration.unstable_operations["create_snowflake_integration_account"] = True
with ApiClient(configuration) as api_client:
api_instance = SnowflakeIntegrationApi(api_client)
response = api_instance.create_snowflake_integration_account(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.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" python3 "example.py"# Create a Snowflake integration account returns "Created" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
config.unstable_operations["v2.create_snowflake_integration_account".to_sym] = true
end
api_instance = DatadogAPIClient::V2::SnowflakeIntegrationAPI.new
body = DatadogAPIClient::V2::SnowflakeIntegrationAccountCreateRequest.new({
data: DatadogAPIClient::V2::SnowflakeIntegrationAccountCreateData.new({
attributes: DatadogAPIClient::V2::SnowflakeIntegrationAccountCreateAttributes.new({
authentication: DatadogAPIClient::V2::SnowflakeIntegrationAccountPrivateKeyAuthRequest.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::SnowflakeIntegrationAccountSettingsRequest.new({
snowflake_account_identifier: "myorg-myaccount",
username: "datadog_user",
}),
}),
type: DatadogAPIClient::V2::IntegrationAccountType::INTEGRATION_ACCOUNT,
}),
})
p api_instance.create_snowflake_integration_account(body)
Instructions
First install the library and its dependencies and then save the example to example.rb and run following commands:
DD_SITE="datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" rb "example.rb"// Create a Snowflake integration account returns "Created" 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::SnowflakeIntegrationAccountAuthenticationRequest;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountCreateAttributes;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountCreateData;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountCreateRequest;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountPrivateKeyAuthRequest;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountPrivateKeyAuthType;
use datadog_api_client::datadogV2::model::SnowflakeIntegrationAccountSettingsRequest;
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 =
SnowflakeIntegrationAccountCreateRequest::new(
SnowflakeIntegrationAccountCreateData::new(
SnowflakeIntegrationAccountCreateAttributes::new(
SnowflakeIntegrationAccountAuthenticationRequest::SnowflakeIntegrationAccountPrivateKeyAuthRequest(
Box::new(
SnowflakeIntegrationAccountPrivateKeyAuthRequest::new(
SnowflakeIntegrationAccountPrivateKeyAuthType::SNOWFLAKE_PRIVATE_KEY,
r#"-----BEGIN PRIVATE KEY-----
MIIE...
-----END PRIVATE KEY-----"#.to_string(),
"my-rsa-key".to_string(),
).private_key_passphrase("your-private-key-passphrase".to_string()),
),
),
"prod-snowflake".to_string(),
SnowflakeIntegrationAccountSettingsRequest::new(
"myorg-myaccount".to_string(),
"datadog_user".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),
),
),
),
IntegrationAccountType::INTEGRATION_ACCOUNT,
),
);
let mut configuration = datadog::Configuration::new();
configuration.set_unstable_operation_enabled("v2.create_snowflake_integration_account", true);
let api = SnowflakeIntegrationAPI::with_config(configuration);
let resp = api.create_snowflake_integration_account(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.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" cargo run/**
* Create a Snowflake integration account returns "Created" 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.createSnowflakeIntegrationAccount"] = true;
const apiInstance = new v2.SnowflakeIntegrationApi(configuration);
const params: v2.SnowflakeIntegrationApiCreateSnowflakeIntegrationAccountRequest =
{
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",
},
},
type: "integration-account",
},
},
};
apiInstance
.createSnowflakeIntegrationAccount(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.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us3.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us5.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="datadoghq.eu" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ap2.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="uk1.datadoghq.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"DD_SITE="us2.ddog-gov.com" DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>" tsc "example.ts"