Liste las cuentas de integración de Snowflake

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

GET https://api.ap1.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.ap2.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://api.datadoghq.eu/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/accountshttps://api.uk1.datadoghq.com/api/v2/integration-interfaces/snowflake/accountshttps://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/accounts

Descripción general

List Snowflake integration accounts. This endpoint requires the integrations_read permission.

Respuesta

OK

Response payload for a list of Snowflake integration accounts.

Expand All

Campo

Type

Descripción

data [required]

[object]

List of Snowflake integration accounts.

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

Campo

Type

Descripción

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Campo

Type

Descripción

errors [required]

[string]

A list of errors.

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

Not Found

API error response.

Expand All

Campo

Type

Descripción

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Campo

Type

Descripción

errors [required]

[string]

A list of errors.

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

Ejemplo de código

                  # Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

# Curl command
curl -X GET "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" \ -H "Accept: application/json" \ -H "Authorization: Bearer ${DD_BEARER_TOKEN}"
"""
List Snowflake integration accounts 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

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

    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"
# List Snowflake integration accounts returns "OK" response

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

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"
// List Snowflake integration accounts 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() {
	ctx := datadog.NewDefaultContext(context.Background())
	ctx = context.WithValue(ctx, datadog.ContextAccessToken, os.Getenv("DD_BEARER_TOKEN"))
	configuration := datadog.NewConfiguration()
	configuration.SetUnstableOperationEnabled("v2.ListSnowflakeIntegrationAccounts", true)
	apiClient := datadog.NewAPIClient(configuration)
	api := datadogV2.NewSnowflakeIntegrationApi(apiClient)
	resp, r, err := api.ListSnowflakeIntegrationAccounts(ctx)

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

	responseContent, _ := json.MarshalIndent(resp, "", "  ")
	fmt.Fprintf(os.Stdout, "Response from `SnowflakeIntegrationApi.ListSnowflakeIntegrationAccounts`:\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"
// List Snowflake integration accounts 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.SnowflakeIntegrationAccountsResponse;

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

    try {
      SnowflakeIntegrationAccountsResponse result = apiInstance.listSnowflakeIntegrationAccounts();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println(
          "Exception when calling SnowflakeIntegrationApi#listSnowflakeIntegrationAccounts");
      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"
// List Snowflake integration accounts returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_snowflake_integration::SnowflakeIntegrationAPI;

#[tokio::main]
async fn main() {
    let mut configuration = datadog::Configuration::new();
    configuration.set_unstable_operation_enabled("v2.ListSnowflakeIntegrationAccounts", true);
    let api = SnowflakeIntegrationAPI::with_config(configuration);
    let resp = api.list_snowflake_integration_accounts().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
/**
 * List Snowflake integration accounts 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.listSnowflakeIntegrationAccounts"] = true;
const apiInstance = new v2.SnowflakeIntegrationApi(configuration);

apiInstance
  .listSnowflakeIntegrationAccounts()
  .then((data: v2.SnowflakeIntegrationAccountsResponse) => {
    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"