Logs Archives

Archives forward all the logs ingested to a cloud storage system.

See the Archives Page for a list of the archives currently configured in Datadog.

GET https://api.ap1.datadoghq.com/api/v2/logs/config/archiveshttps://api.datadoghq.eu/api/v2/logs/config/archiveshttps://api.ddog-gov.com/api/v2/logs/config/archiveshttps://api.datadoghq.com/api/v2/logs/config/archiveshttps://api.us3.datadoghq.com/api/v2/logs/config/archiveshttps://api.us5.datadoghq.com/api/v2/logs/config/archives

Présentation

Get the list of configured logs archives with their definitions. This endpoint requires the logs_read_archives permission.

Réponse

OK

The available archives.

Expand All

Champ

Type

Description

data

[object]

A list of archives.

attributes

object

The attributes associated with the archive.

destination [required]

object <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

state

enum

The state of the archive. Allowed enum values: UNKNOWN,WORKING,FAILING,WORKING_AUTH_LEGACY

id

string

The archive ID.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": [
    {
      "attributes": {
        "destination": {
          "container": "container-name",
          "integration": {
            "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
            "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
          },
          "path": "string",
          "region": "string",
          "storage_account": "account-name",
          "type": "azure"
        },
        "include_tags": false,
        "name": "Nginx Archive",
        "query": "source:nginx",
        "rehydration_max_scan_size_in_gb": 100,
        "rehydration_tags": [
          "team:intake",
          "team:app"
        ],
        "state": "WORKING"
      },
      "id": "a2zcMylnM4OCHpYusxIi3g",
      "type": "archives"
    }
  ]
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Get all archives returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchives;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    try {
      LogsArchives result = apiInstance.listLogsArchives();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#listLogsArchives");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

POST https://api.ap1.datadoghq.com/api/v2/logs/config/archiveshttps://api.datadoghq.eu/api/v2/logs/config/archiveshttps://api.ddog-gov.com/api/v2/logs/config/archiveshttps://api.datadoghq.com/api/v2/logs/config/archiveshttps://api.us3.datadoghq.com/api/v2/logs/config/archiveshttps://api.us5.datadoghq.com/api/v2/logs/config/archives

Présentation

Create an archive in your organization. This endpoint requires the logs_write_archives permission.

Requête

Body Data (required)

The definition of the new archive.

Expand All

Champ

Type

Description

data

object

The definition of an archive.

attributes

object

The attributes associated with the archive.

destination [required]

 <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": {
    "attributes": {
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ]
    },
    "type": "archives"
  }
}

Réponse

OK

The logs archive.

Expand All

Champ

Type

Description

data

object

The definition of an archive.

attributes

object

The attributes associated with the archive.

destination [required]

object <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

state

enum

The state of the archive. Allowed enum values: UNKNOWN,WORKING,FAILING,WORKING_AUTH_LEGACY

id

string

The archive ID.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": {
    "attributes": {
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ],
      "state": "WORKING"
    },
    "id": "a2zcMylnM4OCHpYusxIi3g",
    "type": "archives"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Create an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequest;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestAttributes;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDefinition;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDestination;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzure;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzureType;
import com.datadog.api.client.v2.model.LogsArchiveIntegrationAzure;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    LogsArchiveCreateRequest body =
        new LogsArchiveCreateRequest()
            .data(
                new LogsArchiveCreateRequestDefinition()
                    .attributes(
                        new LogsArchiveCreateRequestAttributes()
                            .destination(
                                new LogsArchiveCreateRequestDestination(
                                    new LogsArchiveDestinationAzure()
                                        .container("container-name")
                                        .integration(
                                            new LogsArchiveIntegrationAzure()
                                                .clientId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa")
                                                .tenantId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"))
                                        .storageAccount("account-name")
                                        .type(LogsArchiveDestinationAzureType.AZURE)))
                            .includeTags(false)
                            .name("Nginx Archive")
                            .query("source:nginx")
                            .rehydrationMaxScanSizeInGb(100L)
                            .rehydrationTags(Arrays.asList("team:intake", "team:app")))
                    .type("archives"));

    try {
      LogsArchive result = apiInstance.createLogsArchive(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#createLogsArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}https://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}

Présentation

Get a specific archive from your organization. This endpoint requires the logs_read_archives permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Réponse

OK

The logs archive.

Expand All

Champ

Type

Description

data

object

The definition of an archive.

attributes

object

The attributes associated with the archive.

destination [required]

object <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

state

enum

The state of the archive. Allowed enum values: UNKNOWN,WORKING,FAILING,WORKING_AUTH_LEGACY

id

string

The archive ID.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": {
    "attributes": {
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ],
      "state": "WORKING"
    },
    "id": "a2zcMylnM4OCHpYusxIi3g",
    "type": "archives"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Get an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    try {
      LogsArchive result = apiInstance.getLogsArchive("archive_id");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#getLogsArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

PUT https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}https://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}

Présentation

Update a given archive configuration.

Note: Using this method updates your archive configuration by replacing your current configuration with the new one sent to your Datadog organization.

This endpoint requires the logs_write_archives permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Requête

Body Data (required)

New definition of the archive.

Expand All

Champ

Type

Description

data

object

The definition of an archive.

attributes

object

The attributes associated with the archive.

destination [required]

 <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": {
    "attributes": {
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ]
    },
    "type": "archives"
  }
}

Réponse

OK

The logs archive.

Expand All

Champ

Type

Description

data

object

The definition of an archive.

attributes

object

The attributes associated with the archive.

destination [required]

object <oneOf>

An archive's destination.

Option 1

object

The Azure archive destination.

container [required]

string

The container where the archive will be stored.

integration [required]

object

The Azure archive's integration destination.

client_id [required]

string

A client ID.

tenant_id [required]

string

A tenant ID.

path

string

The archive path.

region

string

The region where the archive will be stored.

storage_account [required]

string

The associated storage account.

type [required]

enum

Type of the Azure archive destination. Allowed enum values: azure

default: azure

Option 2

object

The GCS archive destination.

bucket [required]

string

The bucket where the archive will be stored.

integration [required]

object

The GCS archive's integration destination.

client_email [required]

string

A client email.

project_id

string

A project ID.

path

string

The archive path.

type [required]

enum

Type of the GCS archive destination. Allowed enum values: gcs

default: gcs

Option 3

object

The S3 archive destination.

bucket [required]

string

The bucket where the archive will be stored.

encryption

object

The S3 encryption settings.

key

string

An Amazon Resource Name (ARN) used to identify an AWS KMS key.

type [required]

enum

Type of S3 encryption for a destination. Allowed enum values: NO_OVERRIDE,SSE_S3,SSE_KMS

integration [required]

object

The S3 Archive's integration destination.

account_id [required]

string

The account ID for the integration.

role_name [required]

string

The path of the integration.

path

string

The archive path.

storage_class

enum

The storage class where the archive will be stored. Allowed enum values: STANDARD,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,GLACIER_IR

default: STANDARD

type [required]

enum

Type of the S3 archive destination. Allowed enum values: s3

default: s3

include_tags

boolean

To store the tags in the archive, set the value "true". If it is set to "false", the tags will be deleted when the logs are sent to the archive.

name [required]

string

The archive name.

query [required]

string

The archive query/filter. Logs matching this query are included in the archive.

rehydration_max_scan_size_in_gb

int64

Maximum scan size for rehydration from this archive.

rehydration_tags

[string]

An array of tags to add to rehydrated logs from an archive.

state

enum

The state of the archive. Allowed enum values: UNKNOWN,WORKING,FAILING,WORKING_AUTH_LEGACY

id

string

The archive ID.

type [required]

string

The type of the resource. The value should always be archives.

default: archives

{
  "data": {
    "attributes": {
      "destination": {
        "container": "container-name",
        "integration": {
          "client_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
          "tenant_id": "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"
        },
        "path": "string",
        "region": "string",
        "storage_account": "account-name",
        "type": "azure"
      },
      "include_tags": false,
      "name": "Nginx Archive",
      "query": "source:nginx",
      "rehydration_max_scan_size_in_gb": 100,
      "rehydration_tags": [
        "team:intake",
        "team:app"
      ],
      "state": "WORKING"
    },
    "id": "a2zcMylnM4OCHpYusxIi3g",
    "type": "archives"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Update an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchive;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequest;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestAttributes;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDefinition;
import com.datadog.api.client.v2.model.LogsArchiveCreateRequestDestination;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzure;
import com.datadog.api.client.v2.model.LogsArchiveDestinationAzureType;
import com.datadog.api.client.v2.model.LogsArchiveIntegrationAzure;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    LogsArchiveCreateRequest body =
        new LogsArchiveCreateRequest()
            .data(
                new LogsArchiveCreateRequestDefinition()
                    .attributes(
                        new LogsArchiveCreateRequestAttributes()
                            .destination(
                                new LogsArchiveCreateRequestDestination(
                                    new LogsArchiveDestinationAzure()
                                        .container("container-name")
                                        .integration(
                                            new LogsArchiveIntegrationAzure()
                                                .clientId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa")
                                                .tenantId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"))
                                        .storageAccount("account-name")
                                        .type(LogsArchiveDestinationAzureType.AZURE)))
                            .includeTags(false)
                            .name("Nginx Archive")
                            .query("source:nginx")
                            .rehydrationMaxScanSizeInGb(100L)
                            .rehydrationTags(Arrays.asList("team:intake", "team:app")))
                    .type("archives"));

    try {
      LogsArchive result = apiInstance.updateLogsArchive("archive_id", body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#updateLogsArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}https://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}https://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}https://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}

Présentation

Delete a given archive from your organization. This endpoint requires the logs_write_archives permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Réponse

OK

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Delete an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    try {
      apiInstance.deleteLogsArchive("archive_id");
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#deleteLogsArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}/readershttps://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readers

Présentation

Returns all read roles a given archive is restricted to. This endpoint requires the logs_read_config permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Réponse

OK

Response containing information about multiple roles.

Expand All

Champ

Type

Description

data

[object]

Array of returned roles.

attributes

object

Attributes of the role.

created_at

date-time

Creation time of the role.

modified_at

date-time

Time of last role modification.

name

string

The name of the role. The name is neither unique nor a stable identifier of the role.

user_count

int64

Number of users with that role.

id

string

The unique identifier of the role.

relationships

object

Relationships of the role object returned by the API.

permissions

object

Relationship to multiple permissions objects.

data

[object]

Relationships to permission objects.

id

string

ID of the permission.

type

enum

Permissions resource type. Allowed enum values: permissions

default: permissions

type [required]

enum

Roles type. Allowed enum values: roles

default: roles

meta

object

Object describing meta attributes of response.

page

object

Pagination object.

total_count

int64

Total count.

total_filtered_count

int64

Total count of elements matched by the filter.

{
  "data": [
    {
      "attributes": {
        "created_at": "2019-09-19T10:00:00.000Z",
        "modified_at": "2019-09-19T10:00:00.000Z",
        "name": "string",
        "user_count": "integer"
      },
      "id": "string",
      "relationships": {
        "permissions": {
          "data": [
            {
              "id": "string",
              "type": "permissions"
            }
          ]
        }
      },
      "type": "roles"
    }
  ],
  "meta": {
    "page": {
      "total_count": "integer",
      "total_filtered_count": "integer"
    }
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// List read roles for an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.RolesResponse;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    try {
      RolesResponse result = apiInstance.listArchiveReadRoles("archive_id");
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#listArchiveReadRoles");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

POST https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}/readershttps://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readers

Présentation

Adds a read role to an archive. (Roles API) This endpoint requires the logs_write_archives permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Requête

Body Data (required)

Expand All

Champ

Type

Description

data

object

Relationship to role object.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

{
  "data": {
    "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
    "type": "roles"
  }
}

Réponse

OK

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Grant role to an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.RelationshipToRole;
import com.datadog.api.client.v2.model.RelationshipToRoleData;
import com.datadog.api.client.v2.model.RolesType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    RelationshipToRole body =
        new RelationshipToRole()
            .data(
                new RelationshipToRoleData()
                    .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d")
                    .type(RolesType.ROLES));

    try {
      apiInstance.addReadRoleToArchive("archive_id", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#addReadRoleToArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

DELETE https://api.ap1.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.eu/api/v2/logs/config/archives/{archive_id}/readershttps://api.ddog-gov.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us3.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readershttps://api.us5.datadoghq.com/api/v2/logs/config/archives/{archive_id}/readers

Présentation

Removes a role from an archive. (Roles API) This endpoint requires the logs_write_archives permission.

Arguments

Paramètres du chemin

Nom

Type

Description

archive_id [required]

string

The ID of the archive.

Requête

Body Data (required)

Expand All

Champ

Type

Description

data

object

Relationship to role object.

id

string

The unique identifier of the role.

type

enum

Roles type. Allowed enum values: roles

default: roles

{
  "data": {
    "id": "3653d3c6-0c75-11ea-ad28-fb5701eabc7d",
    "type": "roles"
  }
}

Réponse

OK

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Not found

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Revoke role from an archive returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.RelationshipToRole;
import com.datadog.api.client.v2.model.RelationshipToRoleData;
import com.datadog.api.client.v2.model.RolesType;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    RelationshipToRole body =
        new RelationshipToRole()
            .data(
                new RelationshipToRoleData()
                    .id("3653d3c6-0c75-11ea-ad28-fb5701eabc7d")
                    .type(RolesType.ROLES));

    try {
      apiInstance.removeRoleFromArchive("archive_id", body);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#removeRoleFromArchive");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

GET https://api.ap1.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.datadoghq.eu/api/v2/logs/config/archive-orderhttps://api.ddog-gov.com/api/v2/logs/config/archive-orderhttps://api.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.us3.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.us5.datadoghq.com/api/v2/logs/config/archive-order

Présentation

Get the current order of your archives. This endpoint takes no JSON arguments. This endpoint requires the logs_read_config permission.

Réponse

OK

A ordered list of archive IDs.

Expand All

Champ

Type

Description

data

object

The definition of an archive order.

attributes [required]

object

The attributes associated with the archive order.

archive_ids [required]

[string]

An ordered array of <ARCHIVE_ID> strings, the order of archive IDs in the array define the overall archives order for Datadog.

type [required]

enum

Type of the archive order definition. Allowed enum values: archive_order

default: archive_order

{
  "data": {
    "attributes": {
      "archive_ids": [
        "a2zcMylnM4OCHpYusxIi1g",
        "a2zcMylnM4OCHpYusxIi2g",
        "a2zcMylnM4OCHpYusxIi3g"
      ]
    },
    "type": "archive_order"
  }
}

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Get archive order returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchiveOrder;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    try {
      LogsArchiveOrder result = apiInstance.getLogsArchiveOrder();
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#getLogsArchiveOrder");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"

PUT https://api.ap1.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.datadoghq.eu/api/v2/logs/config/archive-orderhttps://api.ddog-gov.com/api/v2/logs/config/archive-orderhttps://api.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.us3.datadoghq.com/api/v2/logs/config/archive-orderhttps://api.us5.datadoghq.com/api/v2/logs/config/archive-order

Présentation

Update the order of your archives. Since logs are processed sequentially, reordering an archive may change the structure and content of the data processed by other archives.

Note: Using the PUT method updates your archive’s order by replacing the current order with the new one.

This endpoint requires the logs_write_archives permission.

Requête

Body Data (required)

An object containing the new ordered list of archive IDs.

Expand All

Champ

Type

Description

data

object

The definition of an archive order.

attributes [required]

object

The attributes associated with the archive order.

archive_ids [required]

[string]

An ordered array of <ARCHIVE_ID> strings, the order of archive IDs in the array define the overall archives order for Datadog.

type [required]

enum

Type of the archive order definition. Allowed enum values: archive_order

default: archive_order

{
  "data": {
    "attributes": {
      "archive_ids": [
        "a2zcMylnM4OCHpYusxIi1g",
        "a2zcMylnM4OCHpYusxIi2g",
        "a2zcMylnM4OCHpYusxIi3g"
      ]
    },
    "type": "archive_order"
  }
}

Réponse

OK

A ordered list of archive IDs.

Expand All

Champ

Type

Description

data

object

The definition of an archive order.

attributes [required]

object

The attributes associated with the archive order.

archive_ids [required]

[string]

An ordered array of <ARCHIVE_ID> strings, the order of archive IDs in the array define the overall archives order for Datadog.

type [required]

enum

Type of the archive order definition. Allowed enum values: archive_order

default: archive_order

{
  "data": {
    "attributes": {
      "archive_ids": [
        "a2zcMylnM4OCHpYusxIi1g",
        "a2zcMylnM4OCHpYusxIi2g",
        "a2zcMylnM4OCHpYusxIi3g"
      ]
    },
    "type": "archive_order"
  }
}

Bad Request

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Forbidden

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Unprocessable Entity

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Too many requests

API error response.

Expand All

Champ

Type

Description

errors [required]

[string]

A list of errors.

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

Exemple de code

// Update archive order returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.LogsArchivesApi;
import com.datadog.api.client.v2.model.LogsArchiveOrder;
import com.datadog.api.client.v2.model.LogsArchiveOrderAttributes;
import com.datadog.api.client.v2.model.LogsArchiveOrderDefinition;
import com.datadog.api.client.v2.model.LogsArchiveOrderDefinitionType;
import java.util.Arrays;

public class Example {
  public static void main(String[] args) {
    ApiClient defaultClient = ApiClient.getDefaultApiClient();
    LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient);

    LogsArchiveOrder body =
        new LogsArchiveOrder()
            .data(
                new LogsArchiveOrderDefinition()
                    .attributes(
                        new LogsArchiveOrderAttributes()
                            .archiveIds(
                                Arrays.asList(
                                    "a2zcMylnM4OCHpYusxIi1g",
                                    "a2zcMylnM4OCHpYusxIi2g",
                                    "a2zcMylnM4OCHpYusxIi3g")))
                    .type(LogsArchiveOrderDefinitionType.ARCHIVE_ORDER));

    try {
      LogsArchiveOrder result = apiInstance.updateLogsArchiveOrder(body);
      System.out.println(result);
    } catch (ApiException e) {
      System.err.println("Exception when calling LogsArchivesApi#updateLogsArchiveOrder");
      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.comddog-gov.com" DD_API_KEY="<API-KEY>" DD_APP_KEY="<APP-KEY>" java "Example.java"