Énumérer les tables
https://api.datadoghq.com/api/v2/reference-tables/tableshttps://api.us3.datadoghq.com/api/v2/reference-tables/tableshttps://api.us5.datadoghq.com/api/v2/reference-tables/tableshttps://api.datadoghq.eu/api/v2/reference-tables/tableshttps://api.ap1.datadoghq.com/api/v2/reference-tables/tableshttps://api.ap2.datadoghq.com/api/v2/reference-tables/tableshttps://api.uk1.datadoghq.com/api/v2/reference-tables/tableshttps://api.ddog-gov.com/api/v2/reference-tables/tableshttps://api.us2.ddog-gov.com/api/v2/reference-tables/tablesPrésentation
Énumérez toutes les tables d'analyse de cette organisation.
Arguments
Chaînes de requête
page[limit]Number of tables to return.
15page[offset]Number of tables to skip for pagination.
0sortSort field and direction for the list of reference tables. Use field name for ascending, prefix with "-" for descending.
-updated_atupdated_at, table_name, status, -updated_at, -table_name, -statusfilter[status]Filter by table status.
filter[table_name][exact]Filter by exact table name match.
filter[table_name][contains]Filter by table name containing substring.
Réponse
OK
List of reference tables.
data [required]The reference tables.
attributesAttributes that define the reference table's configuration and properties.
created_byUUID of the user who created the reference table.
descriptionOptional text describing the purpose or contents of this reference table.
file_metadataMetadata specifying where and how to access the reference table's data file.
For cloud storage tables (S3/GCS/Azure):
- sync_enabled and access_details will always be present
- error fields (error_message, error_row_count, error_type) are present only when errors occur
For local file tables:
- error fields (error_message, error_row_count) are present only when errors occur
- sync_enabled, access_details are never present
access_detailsCloud storage access configuration. Only present for cloud storage sources (S3, GCS, Azure).
aws_detailAmazon Web Services S3 storage access configuration.
aws_account_idAWS account ID where the S3 bucket is located.
aws_bucket_nameS3 bucket containing the CSV file.
file_pathThe relative file path from the S3 bucket root to the CSV file.
azure_detailAzure Blob Storage access configuration.
azure_client_idAzure service principal (application) client ID with permissions to read from the container.
azure_container_nameAzure Blob Storage container containing the CSV file.
azure_storage_account_nameAzure storage account where the container is located.
azure_tenant_idAzure Active Directory tenant ID.
file_pathThe relative file path from the Azure container root to the CSV file.
gcp_detailGoogle Cloud Platform storage access configuration.
file_pathThe relative file path from the GCS bucket root to the CSV file.
gcp_bucket_nameGCP bucket containing the CSV file.
gcp_project_idGCP project ID where the bucket is located.
gcp_service_account_emailService account email with read permissions for the GCS bucket.
error_messageThe error message returned from the last operation (sync for cloud storage, upload for local file).
error_row_countThe number of rows that failed to process.
error_typeThe type of error that occurred during file processing. Only applicable for cloud storage sources.
TABLE_SCHEMA_ERROR, FILE_FORMAT_ERROR, CONFIGURATION_ERROR, QUOTA_EXCEEDED, CONFLICT_ERROR, VALIDATION_ERROR, STATE_ERROR, OPERATION_ERROR, SYSTEM_ERRORsync_enabledWhether this table is synced automatically from cloud storage. Only applicable for cloud storage sources.
last_updated_byUUID of the user who last updated the reference table.
row_countThe number of successfully processed rows in the reference table.
schemaSchema defining the structure and columns of the reference table.
fields [required]The schema fields. Maximum of 200 columns.
name [required]The field name.
type [required]The field type for reference table schema fields.
STRING, INT32primary_keys [required]List of field names that serve as primary keys for the table. Only one primary key is supported, and it is used as an ID to retrieve rows.
sourceThe source type for reference table data. Includes all possible source types that can appear in responses.
LOCAL_FILE, S3, GCS, AZURE, SERVICENOW, SALESFORCE, DATABRICKS, SNOWFLAKEstatusThe processing status of the table.
table_nameUnique name to identify this reference table. Used in enrichment processors and API calls.
tagsTags for organizing and filtering reference tables.
updated_atWhen the reference table was last updated, in ISO 8601 format.
idUnique identifier for the reference table.
type [required]Reference table resource type.
reference_tablereference_table{
"data": [
{
"attributes": {
"created_by": "00000000-0000-0000-0000-000000000000",
"description": "example description",
"file_metadata": {
"access_details": {},
"error_message": "",
"error_row_count": 0,
"upload_id": "00000000-0000-0000-0000-000000000000"
},
"last_updated_by": "",
"row_count": 5,
"schema": {
"fields": [
{
"name": "id",
"type": "INT32"
},
{
"name": "name",
"type": "STRING"
}
],
"primary_keys": [
"id"
]
},
"source": "LOCAL_FILE",
"status": "DONE",
"table_name": "test_reference_table",
"tags": [
"tag1",
"tag2"
],
"updated_at": "2000-01-01T01:00:00+00:00"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "reference_table"
},
{
"attributes": {
"created_by": "00000000-0000-0000-0000-000000000000",
"description": "example description",
"file_metadata": {
"access_details": {
"aws_detail": {
"aws_account_id": "test-account-id",
"aws_bucket_name": "test-bucket",
"file_path": "test_rt.csv"
}
},
"error_message": "",
"error_row_count": 0,
"sync_enabled": true
},
"last_updated_by": "00000000-0000-0000-0000-000000000000",
"row_count": 5,
"schema": {
"fields": [
{
"name": "location",
"type": "STRING"
},
{
"name": "file_name",
"type": "STRING"
}
],
"primary_keys": [
"location"
]
},
"source": "S3",
"status": "DONE",
"table_name": "test_reference_table_2",
"tags": [
"test_tag1",
"tag2",
"3"
],
"updated_at": "2000-01-01T01:00:00+00:00"
},
"id": "00000000-0000-0000-0000-000000000000",
"type": "reference_table"
}
]
}Forbidden
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Too many requests
API error response.
errors [required]A list of errors.
{
"errors": [
"Bad Request"
]
}Exemple de code
# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"# 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 GET "https://api.${DD_SITE}/api/v2/reference-tables/tables" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"// List tables 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()
apiClient := datadog.NewAPIClient(configuration)
api := datadogV2.NewReferenceTablesApi(apiClient)
resp, r, err := api.ListTables(ctx, *datadogV2.NewListTablesOptionalParameters())
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `ReferenceTablesApi.ListTables`: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
responseContent, _ := json.MarshalIndent(resp, "", " ")
fmt.Fprintf(os.Stdout, "Response from `ReferenceTablesApi.ListTables`:\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"// List tables returns "OK" response
import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.ReferenceTablesApi;
import com.datadog.api.client.v2.model.TableResultV2Array;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
ReferenceTablesApi apiInstance = new ReferenceTablesApi(defaultClient);
try {
TableResultV2Array result = apiInstance.listTables();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling ReferenceTablesApi#listTables");
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""""
List tables returns "OK" response
"""
from os import environ
from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.reference_tables_api import ReferenceTablesApi
configuration = Configuration()
configuration.access_token = environ["DD_BEARER_TOKEN"]
with ApiClient(configuration) as api_client:
api_instance = ReferenceTablesApi(api_client)
response = api_instance.list_tables()
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"# List tables returns "OK" response
require "datadog_api_client"
DatadogAPIClient.configure do |config|
config.access_token = ENV["DD_BEARER_TOKEN"]
end
api_instance = DatadogAPIClient::V2::ReferenceTablesAPI.new
p api_instance.list_tables()
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"// List tables returns "OK" response
use datadog_api_client::datadog;
use datadog_api_client::datadogV2::api_reference_tables::ListTablesOptionalParams;
use datadog_api_client::datadogV2::api_reference_tables::ReferenceTablesAPI;
#[tokio::main]
async fn main() {
let configuration = datadog::Configuration::new();
let api = ReferenceTablesAPI::with_config(configuration);
let resp = api.list_tables(ListTablesOptionalParams::default()).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="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us3.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us5.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="datadoghq.eu" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ap2.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="uk1.datadoghq.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo runDD_SITE="us2.ddog-gov.com" DD_API_KEY="<DD_API_KEY>" DD_APP_KEY="<DD_APP_KEY>" cargo run/**
* List tables 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,
},
},
});
const apiInstance = new v2.ReferenceTablesApi(configuration);
apiInstance
.listTables()
.then((data: v2.TableResultV2Array) => {
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"