From 5ff0b29f907b329d498bbd35b75401bd87e34b69 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 11:56:42 +0200 Subject: [PATCH 01/10] [logs][archives] Add tests for Java --- .../v2/client/api/LogsArchivesApiTest.java | 193 ++++++++++++++++++ .../azure/in/create.json | 1 + .../azure/out/create.json | 2 + .../logs_archives_fixtures/gcs/in/create.json | 1 + .../gcs/out/create.json | 1 + .../logs_archives_fixtures/s3/in/create.json | 1 + .../logs_archives_fixtures/s3/in/update.json | 1 + .../logs_archives_fixtures/s3/out/create.json | 1 + .../logs_archives_fixtures/s3/out/getall.json | 1 + .../s3/out/getbyid.json | 1 + .../logs_archives_fixtures/s3/out/update.json | 1 + 11 files changed, 204 insertions(+) create mode 100644 src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/out/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json create mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java new file mode 100644 index 00000000000..67ba4881724 --- /dev/null +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.api; + +import static com.github.tomakehurst.wiremock.client.WireMock.delete; +import static com.github.tomakehurst.wiremock.client.WireMock.equalToJson; +import static com.github.tomakehurst.wiremock.client.WireMock.get; +import static com.github.tomakehurst.wiremock.client.WireMock.okJson; +import static com.github.tomakehurst.wiremock.client.WireMock.post; +import static com.github.tomakehurst.wiremock.client.WireMock.put; +import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; +import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; +import static org.junit.Assert.assertEquals; +import static org.junit.Assume.assumeTrue; + +import com.datadog.api.RecordingMode; +import com.datadog.api.TestUtils; +import com.datadog.api.v2.client.ApiResponse; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.model.LogsArchive; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequest; +import com.datadog.api.v2.client.model.LogsArchiveDefinition; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3Type; +import com.datadog.api.v2.client.model.LogsArchives; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.IOException; +import java.util.List; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * API tests for LogsArchivesApi + */ +public class LogsArchivesApiTest extends V2APITest { + + private static LogsArchivesApi api; + + // ObjectMapper instance configure to not fail when encountering unknown properties + private static ObjectMapper objectMapper = new ObjectMapper().configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); + + private final String fixturePrefix = "v2/client/api/logs_archives_fixtures"; + private final String apiUri = "/api/v2/logs/config/archives"; + + + @BeforeClass + public static void initApi() { + api = new LogsArchivesApi(generalApiUnitTestClient); + } + + /** + * Create an archive + * + * Create an archive in your organization. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void createLogsArchiveTest() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + final String[] cases = {"s3", "gcs", "azure"}; + for(String archiveType: cases) { + String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "create.json")); + String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); + stubFor(post(urlPathEqualTo(apiUri)) + .withRequestBody(equalToJson(inputData)) + .willReturn(okJson(outputData).withStatus(200)) + ); + LogsArchive response = api.createLogsArchive().body(objectMapper.readValue(inputData, LogsArchiveCreateRequest.class)).execute(); + assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); + } + } + + /** + * Delete an archive + * + * Delete a given archive from your organization. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void deleteLogsArchiveTest() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + String archiveType = "s3"; + String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); + String archiveId = "XVlBzgbaiC"; + stubFor(delete(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + .willReturn(okJson(fixtureData).withStatus(204)) + ); + ApiResponse response = api.deleteLogsArchive(archiveId).executeWithHttpInfo(); + assertEquals(204, response.getStatusCode()); + } + + /** + * Get an archive + * + * Get a specific archive from your organization. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void getLogsArchiveTest() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + String archiveType = "s3"; + String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); + String archiveId = "XVlBzgbaiC"; + stubFor(get(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + .willReturn(okJson(fixtureData).withStatus(200)) + ); + LogsArchive response = api.getLogsArchive(archiveId).execute(); + checkS3Archive(response.getData()); + } + + /** + * Get all archives + * + * Get the list of configured logs archives with their definitions. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void listLogsArchivesTest() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + String archiveType = "s3"; + String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getall.json")); + stubFor(get(urlPathEqualTo(apiUri)) + .willReturn(okJson(fixtureData).withStatus(200)) + ); + LogsArchives response = api.listLogsArchives().execute(); + assertEquals(1, response.getData().size()); + checkS3Archive(response.getData().get(0)); + } + + /** + * Update an archive + * + * 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. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void updateLogsArchiveTest() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + String archiveType = "s3"; + String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "update.json")); + String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "update.json")); + String archiveId = "XVlBzgbaiC"; + stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + .withRequestBody(equalToJson(inputData)) + .willReturn(okJson(outputData).withStatus(200)) + ); + LogsArchive response = api.updateLogsArchive(archiveId).body(objectMapper.readValue(inputData, LogsArchiveCreateRequest.class)).execute(); + checkS3Archive(response.getData(), "/path/toto", "service:toto"); + } + + private void checkS3Archive(LogsArchiveDefinition outputArchive) { + checkS3Archive(outputArchive, "/path/blou", "source:tata"); + } + + private void checkS3Archive(LogsArchiveDefinition outputArchive, String path, String query) { + assertEquals(outputArchive.getType(), "archives"); + LogsArchiveDestinationS3 destination = (LogsArchiveDestinationS3) outputArchive.getAttributes().getDestination().getActualInstance(); + assertEquals(destination.getType(), LogsArchiveDestinationS3Type.S3); + assertEquals(destination.getIntegration().getAccountId(), "711111111111"); + assertEquals(destination.getIntegration().getRoleName(), "DatadogGoClientTestIntegrationRole"); + assertEquals(destination.getPath(), path); + assertEquals(destination.getBucket(), "dd-logs-test-datadog-api-client-go"); + assertEquals(outputArchive.getAttributes().getName(), "datadog-api-client-go Tests Archive"); + assertEquals(outputArchive.getAttributes().getQuery(), query); + assertEquals(outputArchive.getId(), "XVlBzgbaiC"); + } + +} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json new file mode 100644 index 00000000000..3172ec66160 --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa","tenant_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","region":"my-region","storage_account":"storageAccount","type":"azure"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json new file mode 100644 index 00000000000..da8448df601 --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json @@ -0,0 +1,2 @@ +{"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa","tenant_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","region":"my-region","storage_account":"storageAccount","type":"azure"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} + diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json new file mode 100644 index 00000000000..fc05bd2a2bd --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"email@email.com","project_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","type":"gcs"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/out/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/out/create.json new file mode 100644 index 00000000000..f330b1f57bf --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/out/create.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"email@email.com","project_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","type":"gcs"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json new file mode 100644 index 00000000000..17a0522813e --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json new file mode 100644 index 00000000000..ee6337ed15d --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json new file mode 100644 index 00000000000..0de28cdd41c --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json new file mode 100644 index 00000000000..1a6b8b0ddbe --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json @@ -0,0 +1 @@ +{"data":[{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"XVlBzgbaiC","type":"archives"}]} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json new file mode 100644 index 00000000000..69e2d323e97 --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"XVlBzgbaiC","type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json new file mode 100644 index 00000000000..e258ff80661 --- /dev/null +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json @@ -0,0 +1 @@ +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} From ca57a8f38eb829ad07b69e1df7a89679a8155ca6 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 14:21:35 +0200 Subject: [PATCH 02/10] [logs][archives] No deser for input --- .../v2/client/api/LogsArchivesApiTest.java | 140 +++++++++++++++--- .../azure/in/create.json | 1 - .../logs_archives_fixtures/gcs/in/create.json | 1 - .../logs_archives_fixtures/s3/in/create.json | 1 - .../logs_archives_fixtures/s3/in/update.json | 1 - 5 files changed, 123 insertions(+), 21 deletions(-) delete mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json delete mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json delete mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json delete mode 100644 src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index 67ba4881724..5d0bb8e6452 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -24,18 +24,27 @@ import com.datadog.api.RecordingMode; import com.datadog.api.TestUtils; -import com.datadog.api.v2.client.ApiResponse; import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.ApiResponse; import com.datadog.api.v2.client.model.LogsArchive; import com.datadog.api.v2.client.model.LogsArchiveCreateRequest; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestAttributes; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDefinition; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDestination; import com.datadog.api.v2.client.model.LogsArchiveDefinition; +import com.datadog.api.v2.client.model.LogsArchiveDestinationAzure; +import com.datadog.api.v2.client.model.LogsArchiveDestinationAzureType; +import com.datadog.api.v2.client.model.LogsArchiveDestinationGCS; +import com.datadog.api.v2.client.model.LogsArchiveDestinationGCSType; import com.datadog.api.v2.client.model.LogsArchiveDestinationS3; import com.datadog.api.v2.client.model.LogsArchiveDestinationS3Type; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationAzure; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationGCS; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationS3; import com.datadog.api.v2.client.model.LogsArchives; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import java.io.IOException; -import java.util.List; import org.junit.BeforeClass; import org.junit.Test; @@ -59,7 +68,7 @@ public static void initApi() { } /** - * Create an archive + * Create an archive S3 * * Create an archive in your organization. * @@ -68,21 +77,66 @@ public static void initApi() { * if the Api call fails */ @Test - public void createLogsArchiveTest() throws IOException, ApiException { + public void createLogsArchiveTestS3() throws IOException, ApiException { assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; - final String[] cases = {"s3", "gcs", "azure"}; - for(String archiveType: cases) { - String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "create.json")); - String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); - stubFor(post(urlPathEqualTo(apiUri)) - .withRequestBody(equalToJson(inputData)) - .willReturn(okJson(outputData).withStatus(200)) - ); - LogsArchive response = api.createLogsArchive().body(objectMapper.readValue(inputData, LogsArchiveCreateRequest.class)).execute(); - assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); - } + LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestS3(); + String archiveType = "s3"; + String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); + stubFor(post(urlPathEqualTo(apiUri)) + .withRequestBody(equalToJson(objectMapper.writeValueAsString(archive))) + .willReturn(okJson(outputData).withStatus(200)) + ); + LogsArchive response = api.createLogsArchive().body(archive).execute(); + assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); } - + + /** + * Create an archive Azure + * + * Create an archive in your organization. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void createLogsArchiveTestAzure() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestAzure(); + String archiveType = "s3"; + String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); + stubFor(post(urlPathEqualTo(apiUri)) + .withRequestBody(equalToJson(objectMapper.writeValueAsString(archive))) + .willReturn(okJson(outputData).withStatus(200)) + ); + LogsArchive response = api.createLogsArchive().body(archive).execute(); + assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); + } + + /** + * Create an archive GCS + * + * Create an archive in your organization. + * + * @throws IOException + * @throws ApiException + * if the Api call fails + */ + @Test + public void createLogsArchiveTestGCS() throws IOException, ApiException { + assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; + LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestGCS(); + String archiveType = "s3"; + String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); + stubFor(post(urlPathEqualTo(apiUri)) + .withRequestBody(equalToJson(objectMapper.writeValueAsString(archive))) + .willReturn(okJson(outputData).withStatus(200)) + ); + LogsArchive response = api.createLogsArchive().body(archive).execute(); + assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); + } + + /** * Delete an archive * @@ -162,17 +216,69 @@ public void listLogsArchivesTest() throws IOException, ApiException { public void updateLogsArchiveTest() throws IOException, ApiException { assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; String archiveType = "s3"; + LogsArchiveCreateRequest input = getLogsArchiveCreateRequestS3(); String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "update.json")); String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "update.json")); String archiveId = "XVlBzgbaiC"; stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) - .withRequestBody(equalToJson(inputData)) + .withRequestBody(equalToJson(objectMapper.writeValueAsString(input))) .willReturn(okJson(outputData).withStatus(200)) ); LogsArchive response = api.updateLogsArchive(archiveId).body(objectMapper.readValue(inputData, LogsArchiveCreateRequest.class)).execute(); checkS3Archive(response.getData(), "/path/toto", "service:toto"); } + private LogsArchiveCreateRequest getLogsArchiveCreateRequestS3() { + LogsArchiveIntegrationS3 integration = new LogsArchiveIntegrationS3() + .accountId("711111111111") + .roleName("DatadogGoClientTestIntegrationRole"); + LogsArchiveDestinationS3 destination = new LogsArchiveDestinationS3() + .integration(integration) + .bucket("dd-logs-test-datadog-api-client-go") + .path("/path/toto") + .type(LogsArchiveDestinationS3Type.S3); + LogsArchiveCreateRequestAttributes attributes = new LogsArchiveCreateRequestAttributes() + .destination(new LogsArchiveCreateRequestDestination(destination)) + .name("datadog-api-client-go Tests Archive") + .query("service:toto"); + return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); + } + + private LogsArchiveCreateRequest getLogsArchiveCreateRequestAzure() { + LogsArchiveIntegrationAzure integration = new LogsArchiveIntegrationAzure() + .clientId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa") + .tenantId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"); + LogsArchiveDestinationAzure destination = new LogsArchiveDestinationAzure() + .integration(integration) + .path("/path/blou") + .region("my-region") + .storageAccount("storageAccount") + .path("/path/blou") + .container("my-container") + .type(LogsArchiveDestinationAzureType.AZURE); + LogsArchiveCreateRequestAttributes attributes = new LogsArchiveCreateRequestAttributes() + .destination(new LogsArchiveCreateRequestDestination(destination)) + .name("datadog-api-client-go Tests Archive") + .query("service:toto"); + return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); + } + + private LogsArchiveCreateRequest getLogsArchiveCreateRequestGCS() { + LogsArchiveIntegrationGCS integration = new LogsArchiveIntegrationGCS() + .clientEmail("email@email.com") + .projectId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"); + LogsArchiveDestinationGCS destination = new LogsArchiveDestinationGCS() + .integration(integration) + .bucket("dd-logs-test-datadog-api-client-go") + .path("/path/blou") + .type(LogsArchiveDestinationGCSType.GCS); + LogsArchiveCreateRequestAttributes attributes = new LogsArchiveCreateRequestAttributes() + .destination(new LogsArchiveCreateRequestDestination(destination)) + .name("datadog-api-client-go Tests Archive") + .query("service:toto"); + return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); + } + private void checkS3Archive(LogsArchiveDefinition outputArchive) { checkS3Archive(outputArchive, "/path/blou", "source:tata"); } diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json deleted file mode 100644 index 3172ec66160..00000000000 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/in/create.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa","tenant_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","region":"my-region","storage_account":"storageAccount","type":"azure"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json deleted file mode 100644 index fc05bd2a2bd..00000000000 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/gcs/in/create.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"client_email":"email@email.com","project_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","type":"gcs"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json deleted file mode 100644 index 17a0522813e..00000000000 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/create.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json deleted file mode 100644 index ee6337ed15d..00000000000 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/in/update.json +++ /dev/null @@ -1 +0,0 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"type":"archives"}} From 86a5b87329f7ed5dcd597a1799b9516cf696c3b4 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 14:24:01 +0200 Subject: [PATCH 03/10] [logs][archives] Run the tests independently of the mode --- .../datadog/api/v2/client/api/LogsArchivesApiTest.java | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index 5d0bb8e6452..f8bf16ea0c9 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -20,9 +20,7 @@ import static com.github.tomakehurst.wiremock.client.WireMock.stubFor; import static com.github.tomakehurst.wiremock.client.WireMock.urlPathEqualTo; import static org.junit.Assert.assertEquals; -import static org.junit.Assume.assumeTrue; -import com.datadog.api.RecordingMode; import com.datadog.api.TestUtils; import com.datadog.api.v2.client.ApiException; import com.datadog.api.v2.client.ApiResponse; @@ -78,7 +76,6 @@ public static void initApi() { */ @Test public void createLogsArchiveTestS3() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestS3(); String archiveType = "s3"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); @@ -101,7 +98,6 @@ public void createLogsArchiveTestS3() throws IOException, ApiException { */ @Test public void createLogsArchiveTestAzure() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestAzure(); String archiveType = "s3"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); @@ -124,7 +120,6 @@ public void createLogsArchiveTestAzure() throws IOException, ApiException { */ @Test public void createLogsArchiveTestGCS() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestGCS(); String archiveType = "s3"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); @@ -148,7 +143,6 @@ public void createLogsArchiveTestGCS() throws IOException, ApiException { */ @Test public void deleteLogsArchiveTest() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; String archiveType = "s3"; String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); String archiveId = "XVlBzgbaiC"; @@ -170,7 +164,6 @@ public void deleteLogsArchiveTest() throws IOException, ApiException { */ @Test public void getLogsArchiveTest() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; String archiveType = "s3"; String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); String archiveId = "XVlBzgbaiC"; @@ -192,7 +185,6 @@ public void getLogsArchiveTest() throws IOException, ApiException { */ @Test public void listLogsArchivesTest() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; String archiveType = "s3"; String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getall.json")); stubFor(get(urlPathEqualTo(apiUri)) @@ -214,7 +206,6 @@ public void listLogsArchivesTest() throws IOException, ApiException { */ @Test public void updateLogsArchiveTest() throws IOException, ApiException { - assumeTrue(TestUtils.getRecordingMode() == RecordingMode.MODE_REPLAYING) ; String archiveType = "s3"; LogsArchiveCreateRequest input = getLogsArchiveCreateRequestS3(); String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "update.json")); From 417e7894f760b59432f9aca702481643678bbc89 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 14:25:21 +0200 Subject: [PATCH 04/10] [logs][archives] Remove final dep on input fixture --- .../com/datadog/api/v2/client/api/LogsArchivesApiTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index f8bf16ea0c9..35ebf09d424 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -208,14 +208,13 @@ public void listLogsArchivesTest() throws IOException, ApiException { public void updateLogsArchiveTest() throws IOException, ApiException { String archiveType = "s3"; LogsArchiveCreateRequest input = getLogsArchiveCreateRequestS3(); - String inputData = TestUtils.getFixture(String.format("%s/%s/in/%s", fixturePrefix, archiveType, "update.json")); String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "update.json")); String archiveId = "XVlBzgbaiC"; stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) .withRequestBody(equalToJson(objectMapper.writeValueAsString(input))) .willReturn(okJson(outputData).withStatus(200)) ); - LogsArchive response = api.updateLogsArchive(archiveId).body(objectMapper.readValue(inputData, LogsArchiveCreateRequest.class)).execute(); + LogsArchive response = api.updateLogsArchive(archiveId).body(input).execute(); checkS3Archive(response.getData(), "/path/toto", "service:toto"); } From 855f2256a0e7f2e2f4ea5721b83976da607a5064 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Saiz Date: Wed, 3 Jun 2020 16:04:53 +0200 Subject: [PATCH 05/10] Apply suggestions from code review Co-authored-by: Jiri Kuncar --- .../com/datadog/api/v2/client/api/LogsArchivesApiTest.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index 35ebf09d424..5bba7df06f6 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -3,9 +3,6 @@ * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2019-Present Datadog, Inc. * - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). - * https://openapi-generator.tech - * Do not edit the class manually. */ @@ -99,7 +96,7 @@ public void createLogsArchiveTestS3() throws IOException, ApiException { @Test public void createLogsArchiveTestAzure() throws IOException, ApiException { LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestAzure(); - String archiveType = "s3"; + String archiveType = "azure"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); stubFor(post(urlPathEqualTo(apiUri)) .withRequestBody(equalToJson(objectMapper.writeValueAsString(archive))) @@ -121,7 +118,7 @@ public void createLogsArchiveTestAzure() throws IOException, ApiException { @Test public void createLogsArchiveTestGCS() throws IOException, ApiException { LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestGCS(); - String archiveType = "s3"; + String archiveType = "gcs"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); stubFor(post(urlPathEqualTo(apiUri)) .withRequestBody(equalToJson(objectMapper.writeValueAsString(archive))) From dd4545424ef306daa540fdd70b55f6edab8bb25e Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 16:43:14 +0200 Subject: [PATCH 06/10] [logs][archives] Make dummy id --- .../api/v2/client/api/LogsArchivesApiTest.java | 18 ++++++++---------- .../logs_archives_fixtures/s3/out/create.json | 2 +- .../logs_archives_fixtures/s3/out/getall.json | 2 +- .../logs_archives_fixtures/s3/out/getbyid.json | 2 +- .../logs_archives_fixtures/s3/out/update.json | 2 +- 5 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index 5bba7df06f6..14a0e9c3e45 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -48,6 +48,7 @@ */ public class LogsArchivesApiTest extends V2APITest { + public static final String ARCHIVE_ID = "FOObar"; private static LogsArchivesApi api; // ObjectMapper instance configure to not fail when encountering unknown properties @@ -142,11 +143,10 @@ public void createLogsArchiveTestGCS() throws IOException, ApiException { public void deleteLogsArchiveTest() throws IOException, ApiException { String archiveType = "s3"; String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); - String archiveId = "XVlBzgbaiC"; - stubFor(delete(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + stubFor(delete(urlPathEqualTo(String.format("%s/%s", apiUri, ARCHIVE_ID))) .willReturn(okJson(fixtureData).withStatus(204)) ); - ApiResponse response = api.deleteLogsArchive(archiveId).executeWithHttpInfo(); + ApiResponse response = api.deleteLogsArchive(ARCHIVE_ID).executeWithHttpInfo(); assertEquals(204, response.getStatusCode()); } @@ -163,11 +163,10 @@ public void deleteLogsArchiveTest() throws IOException, ApiException { public void getLogsArchiveTest() throws IOException, ApiException { String archiveType = "s3"; String fixtureData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "getbyid.json")); - String archiveId = "XVlBzgbaiC"; - stubFor(get(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + stubFor(get(urlPathEqualTo(String.format("%s/%s", apiUri, ARCHIVE_ID))) .willReturn(okJson(fixtureData).withStatus(200)) ); - LogsArchive response = api.getLogsArchive(archiveId).execute(); + LogsArchive response = api.getLogsArchive(ARCHIVE_ID).execute(); checkS3Archive(response.getData()); } @@ -206,12 +205,11 @@ public void updateLogsArchiveTest() throws IOException, ApiException { String archiveType = "s3"; LogsArchiveCreateRequest input = getLogsArchiveCreateRequestS3(); String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "update.json")); - String archiveId = "XVlBzgbaiC"; - stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, archiveId))) + stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, ARCHIVE_ID))) .withRequestBody(equalToJson(objectMapper.writeValueAsString(input))) .willReturn(okJson(outputData).withStatus(200)) ); - LogsArchive response = api.updateLogsArchive(archiveId).body(input).execute(); + LogsArchive response = api.updateLogsArchive(ARCHIVE_ID).body(input).execute(); checkS3Archive(response.getData(), "/path/toto", "service:toto"); } @@ -280,7 +278,7 @@ private void checkS3Archive(LogsArchiveDefinition outputArchive, String path, St assertEquals(destination.getBucket(), "dd-logs-test-datadog-api-client-go"); assertEquals(outputArchive.getAttributes().getName(), "datadog-api-client-go Tests Archive"); assertEquals(outputArchive.getAttributes().getQuery(), query); - assertEquals(outputArchive.getId(), "XVlBzgbaiC"); + assertEquals(outputArchive.getId(), ARCHIVE_ID); } } diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json index 0de28cdd41c..065ab1e2d82 100644 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/create.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"FOObar","type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json index 1a6b8b0ddbe..3c4be7d6897 100644 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getall.json @@ -1 +1 @@ -{"data":[{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"XVlBzgbaiC","type":"archives"}]} +{"data":[{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"FOObar","type":"archives"}]} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json index 69e2d323e97..c603d365327 100644 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/getbyid.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"XVlBzgbaiC","type":"archives"}} +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/blou","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"source:tata"},"id":"FOObar","type":"archives"}} diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json index e258ff80661..5154396e237 100644 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/s3/out/update.json @@ -1 +1 @@ -{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} +{"data":{"attributes":{"destination":{"bucket":"dd-logs-test-datadog-api-client-go","integration":{"account_id":"711111111111","role_name":"DatadogGoClientTestIntegrationRole"},"path":"/path/toto","type":"s3"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"FOObar","type":"archives"}} From 723e4d69e335f66114858c79745cdfd30a4a4d37 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 17:46:30 +0200 Subject: [PATCH 07/10] [logs][archives] Remove checkArchive method --- .../v2/client/api/LogsArchivesApiTest.java | 25 +++---------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index 14a0e9c3e45..b50da03da05 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -26,7 +26,6 @@ import com.datadog.api.v2.client.model.LogsArchiveCreateRequestAttributes; import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDefinition; import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDestination; -import com.datadog.api.v2.client.model.LogsArchiveDefinition; import com.datadog.api.v2.client.model.LogsArchiveDestinationAzure; import com.datadog.api.v2.client.model.LogsArchiveDestinationAzureType; import com.datadog.api.v2.client.model.LogsArchiveDestinationGCS; @@ -167,7 +166,7 @@ public void getLogsArchiveTest() throws IOException, ApiException { .willReturn(okJson(fixtureData).withStatus(200)) ); LogsArchive response = api.getLogsArchive(ARCHIVE_ID).execute(); - checkS3Archive(response.getData()); + assertEquals(objectMapper.readValue(fixtureData, LogsArchive.class), response); } /** @@ -187,8 +186,7 @@ public void listLogsArchivesTest() throws IOException, ApiException { .willReturn(okJson(fixtureData).withStatus(200)) ); LogsArchives response = api.listLogsArchives().execute(); - assertEquals(1, response.getData().size()); - checkS3Archive(response.getData().get(0)); + assertEquals(objectMapper.readValue(fixtureData, LogsArchives.class), response); } /** @@ -210,7 +208,7 @@ public void updateLogsArchiveTest() throws IOException, ApiException { .willReturn(okJson(outputData).withStatus(200)) ); LogsArchive response = api.updateLogsArchive(ARCHIVE_ID).body(input).execute(); - checkS3Archive(response.getData(), "/path/toto", "service:toto"); + assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); } private LogsArchiveCreateRequest getLogsArchiveCreateRequestS3() { @@ -263,22 +261,5 @@ private LogsArchiveCreateRequest getLogsArchiveCreateRequestGCS() { .query("service:toto"); return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); } - - private void checkS3Archive(LogsArchiveDefinition outputArchive) { - checkS3Archive(outputArchive, "/path/blou", "source:tata"); - } - - private void checkS3Archive(LogsArchiveDefinition outputArchive, String path, String query) { - assertEquals(outputArchive.getType(), "archives"); - LogsArchiveDestinationS3 destination = (LogsArchiveDestinationS3) outputArchive.getAttributes().getDestination().getActualInstance(); - assertEquals(destination.getType(), LogsArchiveDestinationS3Type.S3); - assertEquals(destination.getIntegration().getAccountId(), "711111111111"); - assertEquals(destination.getIntegration().getRoleName(), "DatadogGoClientTestIntegrationRole"); - assertEquals(destination.getPath(), path); - assertEquals(destination.getBucket(), "dd-logs-test-datadog-api-client-go"); - assertEquals(outputArchive.getAttributes().getName(), "datadog-api-client-go Tests Archive"); - assertEquals(outputArchive.getAttributes().getQuery(), query); - assertEquals(outputArchive.getId(), ARCHIVE_ID); - } } From b34846a721f6ddf2cb807352f40cf01d388da7f1 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Date: Wed, 3 Jun 2020 17:48:22 +0200 Subject: [PATCH 08/10] [logs][archives] Rename create request methods --- .../api/v2/client/api/LogsArchivesApiTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java index b50da03da05..1de7aeafce6 100644 --- a/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java +++ b/src/test/java/com/datadog/api/v2/client/api/LogsArchivesApiTest.java @@ -73,7 +73,7 @@ public static void initApi() { */ @Test public void createLogsArchiveTestS3() throws IOException, ApiException { - LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestS3(); + LogsArchiveCreateRequest archive = createLogsArchiveCreateRequestS3(); String archiveType = "s3"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); stubFor(post(urlPathEqualTo(apiUri)) @@ -95,7 +95,7 @@ public void createLogsArchiveTestS3() throws IOException, ApiException { */ @Test public void createLogsArchiveTestAzure() throws IOException, ApiException { - LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestAzure(); + LogsArchiveCreateRequest archive = createLogsArchiveCreateRequestAzure(); String archiveType = "azure"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); stubFor(post(urlPathEqualTo(apiUri)) @@ -117,7 +117,7 @@ public void createLogsArchiveTestAzure() throws IOException, ApiException { */ @Test public void createLogsArchiveTestGCS() throws IOException, ApiException { - LogsArchiveCreateRequest archive = getLogsArchiveCreateRequestGCS(); + LogsArchiveCreateRequest archive = createLogsArchiveCreateRequestGCS(); String archiveType = "gcs"; String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "create.json")); stubFor(post(urlPathEqualTo(apiUri)) @@ -201,7 +201,7 @@ public void listLogsArchivesTest() throws IOException, ApiException { @Test public void updateLogsArchiveTest() throws IOException, ApiException { String archiveType = "s3"; - LogsArchiveCreateRequest input = getLogsArchiveCreateRequestS3(); + LogsArchiveCreateRequest input = createLogsArchiveCreateRequestS3(); String outputData = TestUtils.getFixture(String.format("%s/%s/out/%s", fixturePrefix, archiveType, "update.json")); stubFor(put(urlPathEqualTo(String.format("%s/%s", apiUri, ARCHIVE_ID))) .withRequestBody(equalToJson(objectMapper.writeValueAsString(input))) @@ -211,7 +211,7 @@ public void updateLogsArchiveTest() throws IOException, ApiException { assertEquals(objectMapper.readValue(outputData, LogsArchive.class), response); } - private LogsArchiveCreateRequest getLogsArchiveCreateRequestS3() { + private LogsArchiveCreateRequest createLogsArchiveCreateRequestS3() { LogsArchiveIntegrationS3 integration = new LogsArchiveIntegrationS3() .accountId("711111111111") .roleName("DatadogGoClientTestIntegrationRole"); @@ -227,7 +227,7 @@ private LogsArchiveCreateRequest getLogsArchiveCreateRequestS3() { return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); } - private LogsArchiveCreateRequest getLogsArchiveCreateRequestAzure() { + private LogsArchiveCreateRequest createLogsArchiveCreateRequestAzure() { LogsArchiveIntegrationAzure integration = new LogsArchiveIntegrationAzure() .clientId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa") .tenantId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"); @@ -246,7 +246,7 @@ private LogsArchiveCreateRequest getLogsArchiveCreateRequestAzure() { return new LogsArchiveCreateRequest().data(new LogsArchiveCreateRequestDefinition().attributes(attributes)); } - private LogsArchiveCreateRequest getLogsArchiveCreateRequestGCS() { + private LogsArchiveCreateRequest createLogsArchiveCreateRequestGCS() { LogsArchiveIntegrationGCS integration = new LogsArchiveIntegrationGCS() .clientEmail("email@email.com") .projectId("aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"); From cba5a65eb705f3725e6c44885be07b572bf97936 Mon Sep 17 00:00:00 2001 From: Inigo Mediavilla Saiz Date: Wed, 3 Jun 2020 17:49:01 +0200 Subject: [PATCH 09/10] Update src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json Co-authored-by: Jiri Kuncar --- .../v2/client/api/logs_archives_fixtures/azure/out/create.json | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json index da8448df601..412d15898f9 100644 --- a/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json +++ b/src/test/resources/com/datadog/api/v2/client/api/logs_archives_fixtures/azure/out/create.json @@ -1,2 +1 @@ {"data":{"attributes":{"destination":{"container":"my-container","integration":{"client_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa","tenant_id":"aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa"},"path":"/path/blou","region":"my-region","storage_account":"storageAccount","type":"azure"},"name":"datadog-api-client-go Tests Archive","query":"service:toto"},"id":"XVlBzgbaiC","type":"archives"}} - From 25c7a9a0578b94a81587991d5c9660ded663993b Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 4 Jun 2020 13:37:48 +0000 Subject: [PATCH 10/10] Regenerate client from commit 343cf1b of spec repo --- .apigentools-info | 8 +- .openapi-generator/FILES | 62 ++ api/openapi.yaml | 669 +++++++++++++ api_docs/v2/LogsArchive.md | 13 + api_docs/v2/LogsArchiveAttributes.md | 16 + api_docs/v2/LogsArchiveCreateRequest.md | 13 + .../v2/LogsArchiveCreateRequestAttributes.md | 15 + .../v2/LogsArchiveCreateRequestDefinition.md | 14 + .../v2/LogsArchiveCreateRequestDestination.md | 19 + api_docs/v2/LogsArchiveDefinition.md | 15 + api_docs/v2/LogsArchiveDestination.md | 19 + api_docs/v2/LogsArchiveDestinationAzure.md | 18 + .../v2/LogsArchiveDestinationAzureType.md | 11 + api_docs/v2/LogsArchiveDestinationGCS.md | 16 + api_docs/v2/LogsArchiveDestinationGCSType.md | 11 + api_docs/v2/LogsArchiveDestinationS3.md | 16 + api_docs/v2/LogsArchiveDestinationS3Type.md | 11 + api_docs/v2/LogsArchiveIntegrationAzure.md | 14 + api_docs/v2/LogsArchiveIntegrationGCS.md | 14 + api_docs/v2/LogsArchiveIntegrationS3.md | 14 + api_docs/v2/LogsArchiveState.md | 17 + api_docs/v2/LogsArchives.md | 13 + api_docs/v2/LogsArchivesApi.md | 667 +++++++++++++ api_docs/v2/RelationshipToRole.md | 13 + .../com/datadog/api/v2/client/ApiClient.java | 3 + .../api/v2/client/api/LogsArchivesApi.java | 911 ++++++++++++++++++ .../api/v2/client/model/LogsArchive.java | 102 ++ .../client/model/LogsArchiveAttributes.java | 194 ++++ .../model/LogsArchiveCreateRequest.java | 102 ++ .../LogsArchiveCreateRequestAttributes.java | 161 ++++ .../LogsArchiveCreateRequestDefinition.java | 132 +++ .../LogsArchiveCreateRequestDestination.java | 153 +++ .../client/model/LogsArchiveDefinition.java | 145 +++ .../client/model/LogsArchiveDestination.java | 153 +++ .../model/LogsArchiveDestinationAzure.java | 254 +++++ .../LogsArchiveDestinationAzureType.java | 55 ++ .../model/LogsArchiveDestinationGCS.java | 193 ++++ .../model/LogsArchiveDestinationGCSType.java | 55 ++ .../model/LogsArchiveDestinationS3.java | 193 ++++ .../model/LogsArchiveDestinationS3Type.java | 55 ++ .../model/LogsArchiveIntegrationAzure.java | 130 +++ .../model/LogsArchiveIntegrationGCS.java | 130 +++ .../model/LogsArchiveIntegrationS3.java | 130 +++ .../api/v2/client/model/LogsArchiveState.java | 61 ++ .../api/v2/client/model/LogsArchives.java | 112 +++ .../v2/client/model/RelationshipToRole.java | 102 ++ src/main/java/com/datadog/api/v2/openapi.yaml | 564 +++++++++++ 47 files changed, 5784 insertions(+), 4 deletions(-) create mode 100644 api_docs/v2/LogsArchive.md create mode 100644 api_docs/v2/LogsArchiveAttributes.md create mode 100644 api_docs/v2/LogsArchiveCreateRequest.md create mode 100644 api_docs/v2/LogsArchiveCreateRequestAttributes.md create mode 100644 api_docs/v2/LogsArchiveCreateRequestDefinition.md create mode 100644 api_docs/v2/LogsArchiveCreateRequestDestination.md create mode 100644 api_docs/v2/LogsArchiveDefinition.md create mode 100644 api_docs/v2/LogsArchiveDestination.md create mode 100644 api_docs/v2/LogsArchiveDestinationAzure.md create mode 100644 api_docs/v2/LogsArchiveDestinationAzureType.md create mode 100644 api_docs/v2/LogsArchiveDestinationGCS.md create mode 100644 api_docs/v2/LogsArchiveDestinationGCSType.md create mode 100644 api_docs/v2/LogsArchiveDestinationS3.md create mode 100644 api_docs/v2/LogsArchiveDestinationS3Type.md create mode 100644 api_docs/v2/LogsArchiveIntegrationAzure.md create mode 100644 api_docs/v2/LogsArchiveIntegrationGCS.md create mode 100644 api_docs/v2/LogsArchiveIntegrationS3.md create mode 100644 api_docs/v2/LogsArchiveState.md create mode 100644 api_docs/v2/LogsArchives.md create mode 100644 api_docs/v2/LogsArchivesApi.md create mode 100644 api_docs/v2/RelationshipToRole.md create mode 100644 src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchive.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveAttributes.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequest.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributes.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinition.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestination.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDefinition.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestination.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzure.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureType.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCS.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSType.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Type.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzure.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCS.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchiveState.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/LogsArchives.java create mode 100644 src/main/java/com/datadog/api/v2/client/model/RelationshipToRole.java diff --git a/.apigentools-info b/.apigentools-info index 35a56b95a22..ea4a8aa9c46 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.2.0", - "regenerated": "2020-06-03 07:12:24.512161", - "spec_repo_commit": "80b557a" + "regenerated": "2020-06-04 13:37:41.170666", + "spec_repo_commit": "343cf1b" }, "v2": { "apigentools_version": "1.2.0", - "regenerated": "2020-06-03 07:12:30.608918", - "spec_repo_commit": "80b557a" + "regenerated": "2020-06-04 13:37:47.550342", + "spec_repo_commit": "343cf1b" } } } \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index bb0b0a62013..d5a38610d37 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -16,6 +16,26 @@ docs/DashboardListUpdateItemsRequest.md docs/DashboardListUpdateItemsResponse.md docs/DashboardListsApi.md docs/DashboardType.md +docs/LogsArchive.md +docs/LogsArchiveAttributes.md +docs/LogsArchiveCreateRequest.md +docs/LogsArchiveCreateRequestAttributes.md +docs/LogsArchiveCreateRequestDefinition.md +docs/LogsArchiveCreateRequestDestination.md +docs/LogsArchiveDefinition.md +docs/LogsArchiveDestination.md +docs/LogsArchiveDestinationAzure.md +docs/LogsArchiveDestinationAzureType.md +docs/LogsArchiveDestinationGCS.md +docs/LogsArchiveDestinationGCSType.md +docs/LogsArchiveDestinationS3.md +docs/LogsArchiveDestinationS3Type.md +docs/LogsArchiveIntegrationAzure.md +docs/LogsArchiveIntegrationGCS.md +docs/LogsArchiveIntegrationS3.md +docs/LogsArchiveState.md +docs/LogsArchives.md +docs/LogsArchivesApi.md docs/Organization.md docs/OrganizationAttributes.md docs/OrganizationsType.md @@ -31,6 +51,7 @@ docs/RelationshipToOrganizations.md docs/RelationshipToPermission.md docs/RelationshipToPermissionData.md docs/RelationshipToPermissions.md +docs/RelationshipToRole.md docs/RelationshipToRoleData.md docs/RelationshipToRoles.md docs/RelationshipToUser.md @@ -106,6 +127,7 @@ src/main/java/com/datadog/api/v2/client/ServerConfiguration.java src/main/java/com/datadog/api/v2/client/ServerVariable.java src/main/java/com/datadog/api/v2/client/StringUtil.java src/main/java/com/datadog/api/v2/client/api/DashboardListsApi.java +src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java src/main/java/com/datadog/api/v2/client/api/RolesApi.java src/main/java/com/datadog/api/v2/client/api/SecurityMonitoringApi.java src/main/java/com/datadog/api/v2/client/api/UsersApi.java @@ -127,6 +149,25 @@ src/main/java/com/datadog/api/v2/client/model/DashboardListItems.java src/main/java/com/datadog/api/v2/client/model/DashboardListUpdateItemsRequest.java src/main/java/com/datadog/api/v2/client/model/DashboardListUpdateItemsResponse.java src/main/java/com/datadog/api/v2/client/model/DashboardType.java +src/main/java/com/datadog/api/v2/client/model/LogsArchive.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveAttributes.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequest.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributes.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinition.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestination.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDefinition.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestination.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzure.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureType.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCS.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSType.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Type.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzure.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCS.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3.java +src/main/java/com/datadog/api/v2/client/model/LogsArchiveState.java +src/main/java/com/datadog/api/v2/client/model/LogsArchives.java src/main/java/com/datadog/api/v2/client/model/Organization.java src/main/java/com/datadog/api/v2/client/model/OrganizationAttributes.java src/main/java/com/datadog/api/v2/client/model/OrganizationsType.java @@ -142,6 +183,7 @@ src/main/java/com/datadog/api/v2/client/model/RelationshipToOrganizations.java src/main/java/com/datadog/api/v2/client/model/RelationshipToPermission.java src/main/java/com/datadog/api/v2/client/model/RelationshipToPermissionData.java src/main/java/com/datadog/api/v2/client/model/RelationshipToPermissions.java +src/main/java/com/datadog/api/v2/client/model/RelationshipToRole.java src/main/java/com/datadog/api/v2/client/model/RelationshipToRoleData.java src/main/java/com/datadog/api/v2/client/model/RelationshipToRoles.java src/main/java/com/datadog/api/v2/client/model/RelationshipToUser.java @@ -208,6 +250,25 @@ src/test/java/com/datadog/api/v2/client/model/DashboardListItemsTest.java src/test/java/com/datadog/api/v2/client/model/DashboardListUpdateItemsRequestTest.java src/test/java/com/datadog/api/v2/client/model/DashboardListUpdateItemsResponseTest.java src/test/java/com/datadog/api/v2/client/model/DashboardTypeTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributesTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinitionTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestinationTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDefinitionTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureTypeTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSTypeTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Test.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3TypeTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveDestinationTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzureTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCSTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3Test.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveStateTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchiveTest.java +src/test/java/com/datadog/api/v2/client/model/LogsArchivesTest.java src/test/java/com/datadog/api/v2/client/model/OrganizationAttributesTest.java src/test/java/com/datadog/api/v2/client/model/OrganizationTest.java src/test/java/com/datadog/api/v2/client/model/OrganizationsTypeTest.java @@ -224,6 +285,7 @@ src/test/java/com/datadog/api/v2/client/model/RelationshipToPermissionDataTest.j src/test/java/com/datadog/api/v2/client/model/RelationshipToPermissionTest.java src/test/java/com/datadog/api/v2/client/model/RelationshipToPermissionsTest.java src/test/java/com/datadog/api/v2/client/model/RelationshipToRoleDataTest.java +src/test/java/com/datadog/api/v2/client/model/RelationshipToRoleTest.java src/test/java/com/datadog/api/v2/client/model/RelationshipToRolesTest.java src/test/java/com/datadog/api/v2/client/model/RelationshipToUserDataTest.java src/test/java/com/datadog/api/v2/client/model/RelationshipToUserTest.java diff --git a/api/openapi.yaml b/api/openapi.yaml index 583adbbe03f..25846c51c7d 100644 --- a/api/openapi.yaml +++ b/api/openapi.yaml @@ -36,6 +36,15 @@ tags: organize, find, and share all of your dashboards with your team and organization. name: Dashboard Lists +- description: |- + Archives forward all the logs ingested to a cloud storage system. + + See the [Archives Page](https://app.datadoghq.com/logs/pipelines/archives) + for a list of the archives currently configured in our UI. + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/logs/archives/ + name: Logs Archives - description: |- The Roles API is used to create and manage Datadog roles, what [global permissions](https://docs.datadoghq.com/account_management/rbac/) @@ -243,6 +252,335 @@ paths: x-codegen-request-body-name: body x-contentType: application/json x-accepts: application/json + /api/v2/logs/config/archives: + get: + description: Get the list of configured logs archives with their definitions. + operationId: ListLogsArchives + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchives' + description: OK + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Get all archives + tags: + - Logs Archives + x-accepts: application/json + post: + description: Create an archive in your organization. + operationId: CreateLogsArchive + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchiveCreateRequest' + description: The definition of the new archive. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /api/v2/logs/config/archives/{archive_id}: + delete: + description: Delete a given archive from your organization. + operationId: DeleteLogsArchive + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Delete an archive + tags: + - Logs Archives + x-accepts: application/json + get: + description: Get a specific archive from your organization. + operationId: GetLogsArchive + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get an archive + tags: + - Logs Archives + x-accepts: application/json + put: + description: |- + 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. + operationId: UpdateLogsArchive + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchiveCreateRequest' + description: New definition of the archive. + required: true + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Update an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-contentType: application/json + x-accepts: application/json + /api/v2/logs/config/archives/{archive_id}/readers: + delete: + description: Removes a role from an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + operationId: RemoveRoleFromArchive + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Revoke role from an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-contentType: application/json + x-accepts: application/json + get: + description: Returns all read roles a given archive is restricted to. + operationId: ListArchiveReadRoles + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/RolesResponse' + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: List read roles for an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-accepts: application/json + post: + description: Adds a read role to an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + operationId: AddReadRoleToArchive + parameters: + - description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + responses: + "204": + description: OK + "400": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + "403": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + "404": + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Grant role to an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: |- + **Note**: This endpoint is in public beta. + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/). + x-contentType: application/json + x-accepts: application/json /api/v2/permissions: get: description: Returns a list of all permissions, including name, description, @@ -1382,6 +1720,15 @@ components: headers: {} links: {} parameters: + ArchiveID: + description: The ID of the archive. + explode: false + in: path + name: archive_id + required: true + schema: + type: string + style: simple PageNumber: description: Specific page number to return. explode: true @@ -1729,6 +2076,318 @@ components: - INTEGRATION_SCREENBOARD - INTEGRATION_TIMEBOARD - HOST_TIMEBOARD + LogsArchive: + description: The logs archive. + example: + data: + attributes: + query: source:nginx + name: Nginx Archive + state: WORKING + id: a2zcMylnM4OCHpYusxIi3g + type: archives + properties: + data: + $ref: '#/components/schemas/LogsArchiveDefinition' + type: object + LogsArchiveAttributes: + description: The attributes associated with the archive. + example: + query: source:nginx + name: Nginx Archive + state: WORKING + properties: + destination: + $ref: '#/components/schemas/LogsArchiveDestination' + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + state: + $ref: '#/components/schemas/LogsArchiveState' + required: + - destination + - name + - query + type: object + LogsArchiveCreateRequest: + description: The logs archive. + example: + data: + attributes: + query: source:nginx + name: Nginx Archive + type: archives + properties: + data: + $ref: '#/components/schemas/LogsArchiveCreateRequestDefinition' + type: object + LogsArchiveCreateRequestAttributes: + description: The attributes associated with the archive. + example: + query: source:nginx + name: Nginx Archive + properties: + destination: + $ref: '#/components/schemas/LogsArchiveCreateRequestDestination' + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + required: + - destination + - name + - query + type: object + LogsArchiveCreateRequestDefinition: + description: The definition of an archive. + example: + attributes: + query: source:nginx + name: Nginx Archive + type: archives + properties: + attributes: + $ref: '#/components/schemas/LogsArchiveCreateRequestAttributes' + type: + default: archives + description: The type of the resource. The value should always be archives. + example: archives + type: string + required: + - type + type: object + LogsArchiveCreateRequestDestination: + description: An archive's destination. + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - integration + - type + type: object + LogsArchiveDefinition: + description: The definition of an archive. + example: + attributes: + query: source:nginx + name: Nginx Archive + state: WORKING + id: a2zcMylnM4OCHpYusxIi3g + type: archives + properties: + attributes: + $ref: '#/components/schemas/LogsArchiveAttributes' + id: + description: The archive ID. + example: a2zcMylnM4OCHpYusxIi3g + readOnly: true + type: string + type: + default: archives + description: The type of the resource. The value should always be archives. + example: archives + readOnly: true + type: string + required: + - type + type: object + LogsArchiveDestination: + description: An archive's destination. + nullable: true + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - integration + - type + type: object + LogsArchiveDestinationAzure: + description: The Azure archive destination. + properties: + container: + description: The container where the archive will be stored. + example: container-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationAzure' + path: + description: The archive path. + type: string + region: + description: The region where the archive will be stored. + type: string + storage_account: + description: The associated storage account. + example: account-name + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationAzureType' + required: + - container + - integration + - storage_account + - type + type: object + LogsArchiveDestinationAzureType: + default: azure + description: Type of the Azure archive destination. + enum: + - azure + example: azure + type: string + x-enum-varnames: + - AZURE + LogsArchiveDestinationGCS: + description: The GCS archive destination. + properties: + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationGCS' + path: + description: The archive path. + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationGCSType' + required: + - bucket + - integration + - type + type: object + LogsArchiveDestinationGCSType: + default: gcs + description: Type of the GCS archive destination. + enum: + - gcs + example: gcs + type: string + x-enum-varnames: + - GCS + LogsArchiveDestinationS3: + description: The S3 archive destination. + properties: + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationS3' + path: + description: The archive path. + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationS3Type' + required: + - bucket + - integration + - type + type: object + LogsArchiveDestinationS3Type: + default: s3 + description: Type of the S3 archive destination. + enum: + - s3 + example: s3 + type: string + x-enum-varnames: + - S3 + LogsArchiveIntegrationAzure: + description: The Azure archive's integration destination. + properties: + client_id: + description: A client ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + tenant_id: + description: A tenant ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + required: + - client_id + - tenant_id + type: object + LogsArchiveIntegrationGCS: + description: The GCS archive's integration destination. + properties: + client_email: + description: A client email. + example: youremail@example.com + type: string + project_id: + description: A project ID. + example: project-id + type: string + required: + - client_email + - project_id + type: object + LogsArchiveIntegrationS3: + description: The S3 Archive's integration destination. + properties: + account_id: + description: The account ID for the integration. + example: "123456789012" + type: string + role_name: + description: The path of the integration. + example: role-name + type: string + required: + - account_id + - role_name + type: object + LogsArchiveState: + description: The state of the archive. + enum: + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + example: WORKING + type: string + x-enum-varnames: + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + LogsArchives: + description: The available archives. + example: + data: + - attributes: + query: source:nginx + name: Nginx Archive + state: WORKING + id: a2zcMylnM4OCHpYusxIi3g + type: archives + - attributes: + query: source:nginx + name: Nginx Archive + state: WORKING + id: a2zcMylnM4OCHpYusxIi3g + type: archives + properties: + data: + description: A list of archives. + items: + $ref: '#/components/schemas/LogsArchiveDefinition' + type: array + type: object Organization: description: Organization object. properties: @@ -1978,6 +2637,16 @@ components: $ref: '#/components/schemas/RelationshipToPermissionData' type: array type: object + RelationshipToRole: + description: Relationship to role. + example: + data: + id: 3653d3c6-0c75-11ea-ad28-fb5701eabc7d + type: roles + properties: + data: + $ref: '#/components/schemas/RelationshipToRoleData' + type: object RelationshipToRoleData: description: Relationship to role object. example: diff --git a/api_docs/v2/LogsArchive.md b/api_docs/v2/LogsArchive.md new file mode 100644 index 00000000000..2f1a4cb5e34 --- /dev/null +++ b/api_docs/v2/LogsArchive.md @@ -0,0 +1,13 @@ + + +# LogsArchive + +The logs archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**LogsArchiveDefinition**](LogsArchiveDefinition.md) | | [optional] + + + diff --git a/api_docs/v2/LogsArchiveAttributes.md b/api_docs/v2/LogsArchiveAttributes.md new file mode 100644 index 00000000000..05b4aaa22a9 --- /dev/null +++ b/api_docs/v2/LogsArchiveAttributes.md @@ -0,0 +1,16 @@ + + +# LogsArchiveAttributes + +The attributes associated with the archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | [**LogsArchiveDestination**](LogsArchiveDestination.md) | | +**name** | **String** | The archive name. | +**query** | **String** | The archive query/filter. Logs matching this query are included in the archive. | +**state** | [**LogsArchiveState**](LogsArchiveState.md) | | [optional] + + + diff --git a/api_docs/v2/LogsArchiveCreateRequest.md b/api_docs/v2/LogsArchiveCreateRequest.md new file mode 100644 index 00000000000..c337229c76d --- /dev/null +++ b/api_docs/v2/LogsArchiveCreateRequest.md @@ -0,0 +1,13 @@ + + +# LogsArchiveCreateRequest + +The logs archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**LogsArchiveCreateRequestDefinition**](LogsArchiveCreateRequestDefinition.md) | | [optional] + + + diff --git a/api_docs/v2/LogsArchiveCreateRequestAttributes.md b/api_docs/v2/LogsArchiveCreateRequestAttributes.md new file mode 100644 index 00000000000..87a3ab0b9a2 --- /dev/null +++ b/api_docs/v2/LogsArchiveCreateRequestAttributes.md @@ -0,0 +1,15 @@ + + +# LogsArchiveCreateRequestAttributes + +The attributes associated with the archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**destination** | [**LogsArchiveCreateRequestDestination**](LogsArchiveCreateRequestDestination.md) | | +**name** | **String** | The archive name. | +**query** | **String** | The archive query/filter. Logs matching this query are included in the archive. | + + + diff --git a/api_docs/v2/LogsArchiveCreateRequestDefinition.md b/api_docs/v2/LogsArchiveCreateRequestDefinition.md new file mode 100644 index 00000000000..1e8816ebdb6 --- /dev/null +++ b/api_docs/v2/LogsArchiveCreateRequestDefinition.md @@ -0,0 +1,14 @@ + + +# LogsArchiveCreateRequestDefinition + +The definition of an archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**LogsArchiveCreateRequestAttributes**](LogsArchiveCreateRequestAttributes.md) | | [optional] +**type** | **String** | The type of the resource. The value should always be archives. | + + + diff --git a/api_docs/v2/LogsArchiveCreateRequestDestination.md b/api_docs/v2/LogsArchiveCreateRequestDestination.md new file mode 100644 index 00000000000..e039b7982d9 --- /dev/null +++ b/api_docs/v2/LogsArchiveCreateRequestDestination.md @@ -0,0 +1,19 @@ + + +# LogsArchiveCreateRequestDestination + +An archive's destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**container** | **String** | The container where the archive will be stored. | +**integration** | [**LogsArchiveIntegrationS3**](LogsArchiveIntegrationS3.md) | | +**path** | **String** | The archive path. | [optional] +**region** | **String** | The region where the archive will be stored. | [optional] +**storageAccount** | **String** | The associated storage account. | +**type** | [**LogsArchiveDestinationS3Type**](LogsArchiveDestinationS3Type.md) | | +**bucket** | **String** | The bucket where the archive will be stored. | + + + diff --git a/api_docs/v2/LogsArchiveDefinition.md b/api_docs/v2/LogsArchiveDefinition.md new file mode 100644 index 00000000000..d9f3d2ec45e --- /dev/null +++ b/api_docs/v2/LogsArchiveDefinition.md @@ -0,0 +1,15 @@ + + +# LogsArchiveDefinition + +The definition of an archive. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**attributes** | [**LogsArchiveAttributes**](LogsArchiveAttributes.md) | | [optional] +**id** | **String** | The archive ID. | [optional] [readonly] +**type** | **String** | The type of the resource. The value should always be archives. | [readonly] + + + diff --git a/api_docs/v2/LogsArchiveDestination.md b/api_docs/v2/LogsArchiveDestination.md new file mode 100644 index 00000000000..fb01bfb4880 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestination.md @@ -0,0 +1,19 @@ + + +# LogsArchiveDestination + +An archive's destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**container** | **String** | The container where the archive will be stored. | +**integration** | [**LogsArchiveIntegrationS3**](LogsArchiveIntegrationS3.md) | | +**path** | **String** | The archive path. | [optional] +**region** | **String** | The region where the archive will be stored. | [optional] +**storageAccount** | **String** | The associated storage account. | +**type** | [**LogsArchiveDestinationS3Type**](LogsArchiveDestinationS3Type.md) | | +**bucket** | **String** | The bucket where the archive will be stored. | + + + diff --git a/api_docs/v2/LogsArchiveDestinationAzure.md b/api_docs/v2/LogsArchiveDestinationAzure.md new file mode 100644 index 00000000000..64a35155ac7 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationAzure.md @@ -0,0 +1,18 @@ + + +# LogsArchiveDestinationAzure + +The Azure archive destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**container** | **String** | The container where the archive will be stored. | +**integration** | [**LogsArchiveIntegrationAzure**](LogsArchiveIntegrationAzure.md) | | +**path** | **String** | The archive path. | [optional] +**region** | **String** | The region where the archive will be stored. | [optional] +**storageAccount** | **String** | The associated storage account. | +**type** | [**LogsArchiveDestinationAzureType**](LogsArchiveDestinationAzureType.md) | | + + + diff --git a/api_docs/v2/LogsArchiveDestinationAzureType.md b/api_docs/v2/LogsArchiveDestinationAzureType.md new file mode 100644 index 00000000000..e50ad4701b9 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationAzureType.md @@ -0,0 +1,11 @@ + + +# LogsArchiveDestinationAzureType + +## Enum + + +* `AZURE` (value: `"azure"`) + + + diff --git a/api_docs/v2/LogsArchiveDestinationGCS.md b/api_docs/v2/LogsArchiveDestinationGCS.md new file mode 100644 index 00000000000..c13f03d6d63 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationGCS.md @@ -0,0 +1,16 @@ + + +# LogsArchiveDestinationGCS + +The GCS archive destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bucket** | **String** | The bucket where the archive will be stored. | +**integration** | [**LogsArchiveIntegrationGCS**](LogsArchiveIntegrationGCS.md) | | +**path** | **String** | The archive path. | [optional] +**type** | [**LogsArchiveDestinationGCSType**](LogsArchiveDestinationGCSType.md) | | + + + diff --git a/api_docs/v2/LogsArchiveDestinationGCSType.md b/api_docs/v2/LogsArchiveDestinationGCSType.md new file mode 100644 index 00000000000..8a0d56343a8 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationGCSType.md @@ -0,0 +1,11 @@ + + +# LogsArchiveDestinationGCSType + +## Enum + + +* `GCS` (value: `"gcs"`) + + + diff --git a/api_docs/v2/LogsArchiveDestinationS3.md b/api_docs/v2/LogsArchiveDestinationS3.md new file mode 100644 index 00000000000..efab419e669 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationS3.md @@ -0,0 +1,16 @@ + + +# LogsArchiveDestinationS3 + +The S3 archive destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bucket** | **String** | The bucket where the archive will be stored. | +**integration** | [**LogsArchiveIntegrationS3**](LogsArchiveIntegrationS3.md) | | +**path** | **String** | The archive path. | [optional] +**type** | [**LogsArchiveDestinationS3Type**](LogsArchiveDestinationS3Type.md) | | + + + diff --git a/api_docs/v2/LogsArchiveDestinationS3Type.md b/api_docs/v2/LogsArchiveDestinationS3Type.md new file mode 100644 index 00000000000..a486ffe1540 --- /dev/null +++ b/api_docs/v2/LogsArchiveDestinationS3Type.md @@ -0,0 +1,11 @@ + + +# LogsArchiveDestinationS3Type + +## Enum + + +* `S3` (value: `"s3"`) + + + diff --git a/api_docs/v2/LogsArchiveIntegrationAzure.md b/api_docs/v2/LogsArchiveIntegrationAzure.md new file mode 100644 index 00000000000..e98ec2e9414 --- /dev/null +++ b/api_docs/v2/LogsArchiveIntegrationAzure.md @@ -0,0 +1,14 @@ + + +# LogsArchiveIntegrationAzure + +The Azure archive's integration destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clientId** | **String** | A client ID. | +**tenantId** | **String** | A tenant ID. | + + + diff --git a/api_docs/v2/LogsArchiveIntegrationGCS.md b/api_docs/v2/LogsArchiveIntegrationGCS.md new file mode 100644 index 00000000000..595beba7d4c --- /dev/null +++ b/api_docs/v2/LogsArchiveIntegrationGCS.md @@ -0,0 +1,14 @@ + + +# LogsArchiveIntegrationGCS + +The GCS archive's integration destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**clientEmail** | **String** | A client email. | +**projectId** | **String** | A project ID. | + + + diff --git a/api_docs/v2/LogsArchiveIntegrationS3.md b/api_docs/v2/LogsArchiveIntegrationS3.md new file mode 100644 index 00000000000..b9c34655ba1 --- /dev/null +++ b/api_docs/v2/LogsArchiveIntegrationS3.md @@ -0,0 +1,14 @@ + + +# LogsArchiveIntegrationS3 + +The S3 Archive's integration destination. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**accountId** | **String** | The account ID for the integration. | +**roleName** | **String** | The path of the integration. | + + + diff --git a/api_docs/v2/LogsArchiveState.md b/api_docs/v2/LogsArchiveState.md new file mode 100644 index 00000000000..2dd57712a1e --- /dev/null +++ b/api_docs/v2/LogsArchiveState.md @@ -0,0 +1,17 @@ + + +# LogsArchiveState + +## Enum + + +* `UNKNOWN` (value: `"UNKNOWN"`) + +* `WORKING` (value: `"WORKING"`) + +* `FAILING` (value: `"FAILING"`) + +* `WORKING_AUTH_LEGACY` (value: `"WORKING_AUTH_LEGACY"`) + + + diff --git a/api_docs/v2/LogsArchives.md b/api_docs/v2/LogsArchives.md new file mode 100644 index 00000000000..c8baa13c627 --- /dev/null +++ b/api_docs/v2/LogsArchives.md @@ -0,0 +1,13 @@ + + +# LogsArchives + +The available archives. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List<LogsArchiveDefinition>**](LogsArchiveDefinition.md) | A list of archives. | [optional] + + + diff --git a/api_docs/v2/LogsArchivesApi.md b/api_docs/v2/LogsArchivesApi.md new file mode 100644 index 00000000000..da771f8ec19 --- /dev/null +++ b/api_docs/v2/LogsArchivesApi.md @@ -0,0 +1,667 @@ +# LogsArchivesApi + +All URIs are relative to *https://api.datadoghq.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**addReadRoleToArchive**](LogsArchivesApi.md#addReadRoleToArchive) | **POST** /api/v2/logs/config/archives/{archive_id}/readers | Grant role to an archive +[**createLogsArchive**](LogsArchivesApi.md#createLogsArchive) | **POST** /api/v2/logs/config/archives | Create an archive +[**deleteLogsArchive**](LogsArchivesApi.md#deleteLogsArchive) | **DELETE** /api/v2/logs/config/archives/{archive_id} | Delete an archive +[**getLogsArchive**](LogsArchivesApi.md#getLogsArchive) | **GET** /api/v2/logs/config/archives/{archive_id} | Get an archive +[**listArchiveReadRoles**](LogsArchivesApi.md#listArchiveReadRoles) | **GET** /api/v2/logs/config/archives/{archive_id}/readers | List read roles for an archive +[**listLogsArchives**](LogsArchivesApi.md#listLogsArchives) | **GET** /api/v2/logs/config/archives | Get all archives +[**removeRoleFromArchive**](LogsArchivesApi.md#removeRoleFromArchive) | **DELETE** /api/v2/logs/config/archives/{archive_id}/readers | Revoke role from an archive +[**updateLogsArchive**](LogsArchivesApi.md#updateLogsArchive) | **PUT** /api/v2/logs/config/archives/{archive_id} | Update an archive + + + +## addReadRoleToArchive + +> addReadRoleToArchive(archiveId).body(body).execute(); + +Grant role to an archive + +Adds a read role to an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + RelationshipToRole body = new RelationshipToRole(); // RelationshipToRole | + try { + api.addReadRoleToArchive(archiveId) + .body(body) + .execute(); + } 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + **body** | [**RelationshipToRole**](RelationshipToRole.md)| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + + +## createLogsArchive + +> LogsArchive createLogsArchive().body(body).execute(); + +Create an archive + +Create an archive in your organization. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + LogsArchiveCreateRequest body = new LogsArchiveCreateRequest(); // LogsArchiveCreateRequest | The definition of the new archive. + try { + LogsArchive result = api.createLogsArchive() + .body(body) + .execute(); + 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**LogsArchiveCreateRequest**](LogsArchiveCreateRequest.md)| The definition of the new archive. | + +### Return type + +[**LogsArchive**](LogsArchive.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | + + +## deleteLogsArchive + +> deleteLogsArchive(archiveId).execute(); + +Delete an archive + +Delete a given archive from your organization. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + try { + api.deleteLogsArchive(archiveId) + .execute(); + } 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + +### Return type + +null (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + + +## getLogsArchive + +> LogsArchive getLogsArchive(archiveId).execute(); + +Get an archive + +Get a specific archive from your organization. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + try { + LogsArchive result = api.getLogsArchive(archiveId) + .execute(); + 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + +### Return type + +[**LogsArchive**](LogsArchive.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + + +## listArchiveReadRoles + +> RolesResponse listArchiveReadRoles(archiveId).execute(); + +List read roles for an archive + +Returns all read roles a given archive is restricted to. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + try { + RolesResponse result = api.listArchiveReadRoles(archiveId) + .execute(); + 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + +### Return type + +[**RolesResponse**](RolesResponse.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + + +## listLogsArchives + +> LogsArchives listLogsArchives().execute(); + +Get all archives + +Get the list of configured logs archives with their definitions. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + try { + LogsArchives result = api.listLogsArchives() + .execute(); + 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(); + } + } +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**LogsArchives**](LogsArchives.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **403** | Forbidden | - | + + +## removeRoleFromArchive + +> removeRoleFromArchive(archiveId).body(body).execute(); + +Revoke role from an archive + +Removes a role from an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + RelationshipToRole body = new RelationshipToRole(); // RelationshipToRole | + try { + api.removeRoleFromArchive(archiveId) + .body(body) + .execute(); + } 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + **body** | [**RelationshipToRole**](RelationshipToRole.md)| | [optional] + +### Return type + +null (empty response body) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **204** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + + +## updateLogsArchive + +> LogsArchive updateLogsArchive(archiveId).body(body).execute(); + +Update an archive + +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. + +### Example + +```java +// Import classes: +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.auth.*; +import com.datadog.api.v2.client.models.*; +import com.datadog.api.v2.client.api.LogsArchivesApi; + +public class Example { + public static void main(String[] args) { + ApiClient defaultClient = Configuration.getDefaultApiClient(); + // Configure the Datadog site to send API calls to + HashMap serverVariables = new HashMap(); + String site = System.getenv("DD_SITE"); + if (site != null) { + serverVariables.put("site", site); + defaultClient.setServerVariables(serverVariables); + } + // Configure API key authorization: + HashMap secrets = new HashMap(); + secrets.put("apiKeyAuth", System.getenv("DD_CLIENT_API_KEY")); + secrets.put("appKeyAuth", System.getenv("DD_CLIENT_APP_KEY")); + defaultClient.configureApiKeys(secrets); + + LogsArchivesApi apiInstance = new LogsArchivesApi(defaultClient); + String archiveId = "archiveId_example"; // String | The ID of the archive. + LogsArchiveCreateRequest body = new LogsArchiveCreateRequest(); // LogsArchiveCreateRequest | New definition of the archive. + try { + LogsArchive result = api.updateLogsArchive(archiveId) + .body(body) + .execute(); + 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(); + } + } +} +``` + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **archiveId** | **String**| The ID of the archive. | + **body** | [**LogsArchiveCreateRequest**](LogsArchiveCreateRequest.md)| New definition of the archive. | + +### Return type + +[**LogsArchive**](LogsArchive.md) + +### Authorization + +[apiKeyAuth](../README.md#apiKeyAuth), [appKeyAuth](../README.md#appKeyAuth) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK | - | +| **400** | Bad Request | - | +| **403** | Forbidden | - | +| **404** | Not found | - | + diff --git a/api_docs/v2/RelationshipToRole.md b/api_docs/v2/RelationshipToRole.md new file mode 100644 index 00000000000..79e8e300ab3 --- /dev/null +++ b/api_docs/v2/RelationshipToRole.md @@ -0,0 +1,13 @@ + + +# RelationshipToRole + +Relationship to role. +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**RelationshipToRoleData**](RelationshipToRoleData.md) | | [optional] + + + diff --git a/src/main/java/com/datadog/api/v2/client/ApiClient.java b/src/main/java/com/datadog/api/v2/client/ApiClient.java index 6538faabcb5..c5f2fe15b5f 100644 --- a/src/main/java/com/datadog/api/v2/client/ApiClient.java +++ b/src/main/java/com/datadog/api/v2/client/ApiClient.java @@ -121,6 +121,9 @@ public class ApiClient { protected DateFormat dateFormat; protected final Map unstableOperations = new HashMap() {{ + put("addReadRoleToArchive", false); + put("listArchiveReadRoles", false); + put("removeRoleFromArchive", false); }}; protected static final java.util.logging.Logger logger = java.util.logging.Logger.getLogger(ApiClient.class.getName()); diff --git a/src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java b/src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java new file mode 100644 index 00000000000..cadb312b878 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/api/LogsArchivesApi.java @@ -0,0 +1,911 @@ +package com.datadog.api.v2.client.api; + +import com.datadog.api.v2.client.ApiException; +import com.datadog.api.v2.client.ApiClient; +import com.datadog.api.v2.client.ApiResponse; +import com.datadog.api.v2.client.Configuration; +import com.datadog.api.v2.client.Pair; + +import javax.ws.rs.core.GenericType; + +import com.datadog.api.v2.client.model.APIErrorResponse; +import com.datadog.api.v2.client.model.LogsArchive; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequest; +import com.datadog.api.v2.client.model.LogsArchives; +import com.datadog.api.v2.client.model.RelationshipToRole; +import com.datadog.api.v2.client.model.RolesResponse; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + + +public class LogsArchivesApi { + private ApiClient apiClient; + + public LogsArchivesApi() { + this(Configuration.getDefaultApiClient()); + } + + public LogsArchivesApi(ApiClient apiClient) { + this.apiClient = apiClient; + } + + /** + * Get the API cilent + * + * @return API client + */ + public ApiClient getApiClient() { + return apiClient; + } + + /** + * Set the API cilent + * + * @param apiClient an instance of API client + */ + public void setApiClient(ApiClient apiClient) { + this.apiClient = apiClient; + } + + +private ApiResponse addReadRoleToArchiveWithHttpInfo(String archiveId, RelationshipToRole body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling addReadRoleToArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}/readers" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "addReadRoleToArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + return apiClient.invokeAPI("LogsArchivesApi.addReadRoleToArchive", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + + public class APIaddReadRoleToArchiveRequest { + private String archiveId; + private RelationshipToRole body; + + private APIaddReadRoleToArchiveRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Set body + * @param body (optional) + * @return APIaddReadRoleToArchiveRequest + */ + public APIaddReadRoleToArchiveRequest body(RelationshipToRole body) { + this.body = body; + return this; + } + + /** + * Execute addReadRoleToArchive request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute addReadRoleToArchive request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return addReadRoleToArchiveWithHttpInfo(archiveId, body); + } + } + + /** + * Grant role to an archive + * Adds a read role to an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + * @param archiveId The ID of the archive. (required) + * @return addReadRoleToArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIaddReadRoleToArchiveRequest addReadRoleToArchive(String archiveId) throws ApiException { + String operationId = "addReadRoleToArchive"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIaddReadRoleToArchiveRequest(archiveId); + } + +private ApiResponse createLogsArchiveWithHttpInfo(LogsArchiveCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling createLogsArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "createLogsArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("LogsArchivesApi.createLogsArchive", localVarPath, "POST", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + + public class APIcreateLogsArchiveRequest { + private LogsArchiveCreateRequest body; + + private APIcreateLogsArchiveRequest() { + } + + /** + * Set body + * @param body The definition of the new archive. (required) + * @return APIcreateLogsArchiveRequest + */ + public APIcreateLogsArchiveRequest body(LogsArchiveCreateRequest body) { + this.body = body; + return this; + } + + /** + * Execute createLogsArchive request + * @return LogsArchive + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
+ + */ + + public LogsArchive execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute createLogsArchive request with HTTP info returned + * @return ApiResponse<LogsArchive> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return createLogsArchiveWithHttpInfo(body); + } + } + + /** + * Create an archive + * Create an archive in your organization. + * @return createLogsArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIcreateLogsArchiveRequest createLogsArchive() throws ApiException { + return new APIcreateLogsArchiveRequest(); + } + +private ApiResponse deleteLogsArchiveWithHttpInfo(String archiveId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling deleteLogsArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "deleteLogsArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + return apiClient.invokeAPI("LogsArchivesApi.deleteLogsArchive", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + + public class APIdeleteLogsArchiveRequest { + private String archiveId; + + private APIdeleteLogsArchiveRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Execute deleteLogsArchive request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute deleteLogsArchive request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return deleteLogsArchiveWithHttpInfo(archiveId); + } + } + + /** + * Delete an archive + * Delete a given archive from your organization. + * @param archiveId The ID of the archive. (required) + * @return deleteLogsArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIdeleteLogsArchiveRequest deleteLogsArchive(String archiveId) throws ApiException { + return new APIdeleteLogsArchiveRequest(archiveId); + } + +private ApiResponse getLogsArchiveWithHttpInfo(String archiveId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling getLogsArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "getLogsArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("LogsArchivesApi.getLogsArchive", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + + public class APIgetLogsArchiveRequest { + private String archiveId; + + private APIgetLogsArchiveRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Execute getLogsArchive request + * @return LogsArchive + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public LogsArchive execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute getLogsArchive request with HTTP info returned + * @return ApiResponse<LogsArchive> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return getLogsArchiveWithHttpInfo(archiveId); + } + } + + /** + * Get an archive + * Get a specific archive from your organization. + * @param archiveId The ID of the archive. (required) + * @return getLogsArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIgetLogsArchiveRequest getLogsArchive(String archiveId) throws ApiException { + return new APIgetLogsArchiveRequest(archiveId); + } + +private ApiResponse listArchiveReadRolesWithHttpInfo(String archiveId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling listArchiveReadRoles"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}/readers" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "listArchiveReadRoles"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("LogsArchivesApi.listArchiveReadRoles", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + + public class APIlistArchiveReadRolesRequest { + private String archiveId; + + private APIlistArchiveReadRolesRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Execute listArchiveReadRoles request + * @return RolesResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public RolesResponse execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute listArchiveReadRoles request with HTTP info returned + * @return ApiResponse<RolesResponse> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listArchiveReadRolesWithHttpInfo(archiveId); + } + } + + /** + * List read roles for an archive + * Returns all read roles a given archive is restricted to. + * @param archiveId The ID of the archive. (required) + * @return listArchiveReadRolesRequest + * @throws ApiException if fails to make API call + + + */ + public APIlistArchiveReadRolesRequest listArchiveReadRoles(String archiveId) throws ApiException { + String operationId = "listArchiveReadRoles"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIlistArchiveReadRolesRequest(archiveId); + } + +private ApiResponse listLogsArchivesWithHttpInfo() throws ApiException { + Object localVarPostBody = null; + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "listLogsArchives"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("LogsArchivesApi.listLogsArchives", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + + public class APIlistLogsArchivesRequest { + + private APIlistLogsArchivesRequest() { + } + + /** + * Execute listLogsArchives request + * @return LogsArchives + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
+ + */ + + public LogsArchives execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute listLogsArchives request with HTTP info returned + * @return ApiResponse<LogsArchives> + * @throws ApiException if fails to make API call + * @http.response.details + + + + +
Status Code Description Response Headers
200 OK -
403 Forbidden -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return listLogsArchivesWithHttpInfo(); + } + } + + /** + * Get all archives + * Get the list of configured logs archives with their definitions. + * @return listLogsArchivesRequest + * @throws ApiException if fails to make API call + + + */ + public APIlistLogsArchivesRequest listLogsArchives() throws ApiException { + return new APIlistLogsArchivesRequest(); + } + +private ApiResponse removeRoleFromArchiveWithHttpInfo(String archiveId, RelationshipToRole body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling removeRoleFromArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}/readers" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "removeRoleFromArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + return apiClient.invokeAPI("LogsArchivesApi.removeRoleFromArchive", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, null, null); + } + + public class APIremoveRoleFromArchiveRequest { + private String archiveId; + private RelationshipToRole body; + + private APIremoveRoleFromArchiveRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Set body + * @param body (optional) + * @return APIremoveRoleFromArchiveRequest + */ + public APIremoveRoleFromArchiveRequest body(RelationshipToRole body) { + this.body = body; + return this; + } + + /** + * Execute removeRoleFromArchive request + + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public void execute() throws ApiException { + this.executeWithHttpInfo().getData(); + } + + /** + * Execute removeRoleFromArchive request with HTTP info returned + * @return ApiResponse<Void> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
204 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return removeRoleFromArchiveWithHttpInfo(archiveId, body); + } + } + + /** + * Revoke role from an archive + * Removes a role from an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + * @param archiveId The ID of the archive. (required) + * @return removeRoleFromArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIremoveRoleFromArchiveRequest removeRoleFromArchive(String archiveId) throws ApiException { + String operationId = "removeRoleFromArchive"; + if (apiClient.isUnstableOperationEnabled(operationId)) { + apiClient.getLogger().warning(String.format("Using unstable operation '%s'", operationId)); + } else { + throw new ApiException(0, String.format("Unstable operation '%s' is disabled", operationId)); + } + return new APIremoveRoleFromArchiveRequest(archiveId); + } + +private ApiResponse updateLogsArchiveWithHttpInfo(String archiveId, LogsArchiveCreateRequest body) throws ApiException { + Object localVarPostBody = body; + + // verify the required parameter 'archiveId' is set + if (archiveId == null) { + throw new ApiException(400, "Missing the required parameter 'archiveId' when calling updateLogsArchive"); + } + + // verify the required parameter 'body' is set + if (body == null) { + throw new ApiException(400, "Missing the required parameter 'body' when calling updateLogsArchive"); + } + + // create path and map variables + String localVarPath = "/api/v2/logs/config/archives/{archive_id}" + .replaceAll("\\{" + "archive_id" + "\\}", apiClient.escapeString(archiveId.toString())); + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + + // Set Operation-ID header for telemetry + localVarHeaderParams.put("DD-OPERATION-ID", "updateLogsArchive"); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + "application/json" + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "apiKeyAuth", "appKeyAuth" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("LogsArchivesApi.updateLogsArchive", localVarPath, "PUT", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, null); + } + + public class APIupdateLogsArchiveRequest { + private String archiveId; + private LogsArchiveCreateRequest body; + + private APIupdateLogsArchiveRequest(String archiveId) { + this.archiveId = archiveId; + } + + /** + * Set body + * @param body New definition of the archive. (required) + * @return APIupdateLogsArchiveRequest + */ + public APIupdateLogsArchiveRequest body(LogsArchiveCreateRequest body) { + this.body = body; + return this; + } + + /** + * Execute updateLogsArchive request + * @return LogsArchive + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + + public LogsArchive execute() throws ApiException { + return this.executeWithHttpInfo().getData(); + } + + /** + * Execute updateLogsArchive request with HTTP info returned + * @return ApiResponse<LogsArchive> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + +
Status Code Description Response Headers
200 OK -
400 Bad Request -
403 Forbidden -
404 Not found -
+ + */ + public ApiResponse executeWithHttpInfo() throws ApiException { + return updateLogsArchiveWithHttpInfo(archiveId, body); + } + } + + /** + * Update an archive + * 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. + * @param archiveId The ID of the archive. (required) + * @return updateLogsArchiveRequest + * @throws ApiException if fails to make API call + + + */ + public APIupdateLogsArchiveRequest updateLogsArchive(String archiveId) throws ApiException { + return new APIupdateLogsArchiveRequest(archiveId); + } +} diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchive.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchive.java new file mode 100644 index 00000000000..9a460fd2c00 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchive.java @@ -0,0 +1,102 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDefinition; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The logs archive. + */ +@ApiModel(description = "The logs archive.") +@JsonPropertyOrder({ + LogsArchive.JSON_PROPERTY_DATA +}) + +public class LogsArchive { + public static final String JSON_PROPERTY_DATA = "data"; + private LogsArchiveDefinition data; + + + public LogsArchive data(LogsArchiveDefinition data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogsArchiveDefinition getData() { + return data; + } + + + public void setData(LogsArchiveDefinition data) { + this.data = data; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchive logsArchive = (LogsArchive) o; + return Objects.equals(this.data, logsArchive.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchive {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveAttributes.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveAttributes.java new file mode 100644 index 00000000000..adbc75cd1e0 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveAttributes.java @@ -0,0 +1,194 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestination; +import com.datadog.api.v2.client.model.LogsArchiveState; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The attributes associated with the archive. + */ +@ApiModel(description = "The attributes associated with the archive.") +@JsonPropertyOrder({ + LogsArchiveAttributes.JSON_PROPERTY_DESTINATION, + LogsArchiveAttributes.JSON_PROPERTY_NAME, + LogsArchiveAttributes.JSON_PROPERTY_QUERY, + LogsArchiveAttributes.JSON_PROPERTY_STATE +}) + +public class LogsArchiveAttributes { + public static final String JSON_PROPERTY_DESTINATION = "destination"; + private LogsArchiveDestination destination; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + public static final String JSON_PROPERTY_STATE = "state"; + private LogsArchiveState state; + + + public LogsArchiveAttributes destination(LogsArchiveDestination destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @javax.annotation.Nullable + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DESTINATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveDestination getDestination() { + return destination; + } + + + public void setDestination(LogsArchiveDestination destination) { + this.destination = destination; + } + + + public LogsArchiveAttributes name(String name) { + + this.name = name; + return this; + } + + /** + * The archive name. + * @return name + **/ + @ApiModelProperty(example = "Nginx Archive", required = true, value = "The archive name.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public LogsArchiveAttributes query(String query) { + + this.query = query; + return this; + } + + /** + * The archive query/filter. Logs matching this query are included in the archive. + * @return query + **/ + @ApiModelProperty(example = "source:nginx", required = true, value = "The archive query/filter. Logs matching this query are included in the archive.") + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuery() { + return query; + } + + + public void setQuery(String query) { + this.query = query; + } + + + public LogsArchiveAttributes state(LogsArchiveState state) { + + this.state = state; + return this; + } + + /** + * Get state + * @return state + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_STATE) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogsArchiveState getState() { + return state; + } + + + public void setState(LogsArchiveState state) { + this.state = state; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveAttributes logsArchiveAttributes = (LogsArchiveAttributes) o; + return Objects.equals(this.destination, logsArchiveAttributes.destination) && + Objects.equals(this.name, logsArchiveAttributes.name) && + Objects.equals(this.query, logsArchiveAttributes.query) && + Objects.equals(this.state, logsArchiveAttributes.state); + } + + @Override + public int hashCode() { + return Objects.hash(destination, name, query, state); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveAttributes {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append(" state: ").append(toIndentedString(state)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequest.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequest.java new file mode 100644 index 00000000000..49400445707 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequest.java @@ -0,0 +1,102 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDefinition; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The logs archive. + */ +@ApiModel(description = "The logs archive.") +@JsonPropertyOrder({ + LogsArchiveCreateRequest.JSON_PROPERTY_DATA +}) + +public class LogsArchiveCreateRequest { + public static final String JSON_PROPERTY_DATA = "data"; + private LogsArchiveCreateRequestDefinition data; + + + public LogsArchiveCreateRequest data(LogsArchiveCreateRequestDefinition data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogsArchiveCreateRequestDefinition getData() { + return data; + } + + + public void setData(LogsArchiveCreateRequestDefinition data) { + this.data = data; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveCreateRequest logsArchiveCreateRequest = (LogsArchiveCreateRequest) o; + return Objects.equals(this.data, logsArchiveCreateRequest.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveCreateRequest {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributes.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributes.java new file mode 100644 index 00000000000..2961152a8b4 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestAttributes.java @@ -0,0 +1,161 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestDestination; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The attributes associated with the archive. + */ +@ApiModel(description = "The attributes associated with the archive.") +@JsonPropertyOrder({ + LogsArchiveCreateRequestAttributes.JSON_PROPERTY_DESTINATION, + LogsArchiveCreateRequestAttributes.JSON_PROPERTY_NAME, + LogsArchiveCreateRequestAttributes.JSON_PROPERTY_QUERY +}) + +public class LogsArchiveCreateRequestAttributes { + public static final String JSON_PROPERTY_DESTINATION = "destination"; + private LogsArchiveCreateRequestDestination destination; + + public static final String JSON_PROPERTY_NAME = "name"; + private String name; + + public static final String JSON_PROPERTY_QUERY = "query"; + private String query; + + + public LogsArchiveCreateRequestAttributes destination(LogsArchiveCreateRequestDestination destination) { + + this.destination = destination; + return this; + } + + /** + * Get destination + * @return destination + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_DESTINATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveCreateRequestDestination getDestination() { + return destination; + } + + + public void setDestination(LogsArchiveCreateRequestDestination destination) { + this.destination = destination; + } + + + public LogsArchiveCreateRequestAttributes name(String name) { + + this.name = name; + return this; + } + + /** + * The archive name. + * @return name + **/ + @ApiModelProperty(example = "Nginx Archive", required = true, value = "The archive name.") + @JsonProperty(JSON_PROPERTY_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getName() { + return name; + } + + + public void setName(String name) { + this.name = name; + } + + + public LogsArchiveCreateRequestAttributes query(String query) { + + this.query = query; + return this; + } + + /** + * The archive query/filter. Logs matching this query are included in the archive. + * @return query + **/ + @ApiModelProperty(example = "source:nginx", required = true, value = "The archive query/filter. Logs matching this query are included in the archive.") + @JsonProperty(JSON_PROPERTY_QUERY) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getQuery() { + return query; + } + + + public void setQuery(String query) { + this.query = query; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveCreateRequestAttributes logsArchiveCreateRequestAttributes = (LogsArchiveCreateRequestAttributes) o; + return Objects.equals(this.destination, logsArchiveCreateRequestAttributes.destination) && + Objects.equals(this.name, logsArchiveCreateRequestAttributes.name) && + Objects.equals(this.query, logsArchiveCreateRequestAttributes.query); + } + + @Override + public int hashCode() { + return Objects.hash(destination, name, query); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveCreateRequestAttributes {\n"); + sb.append(" destination: ").append(toIndentedString(destination)).append("\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" query: ").append(toIndentedString(query)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinition.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinition.java new file mode 100644 index 00000000000..9048d57feef --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDefinition.java @@ -0,0 +1,132 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveCreateRequestAttributes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The definition of an archive. + */ +@ApiModel(description = "The definition of an archive.") +@JsonPropertyOrder({ + LogsArchiveCreateRequestDefinition.JSON_PROPERTY_ATTRIBUTES, + LogsArchiveCreateRequestDefinition.JSON_PROPERTY_TYPE +}) + +public class LogsArchiveCreateRequestDefinition { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private LogsArchiveCreateRequestAttributes attributes; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "archives"; + + + public LogsArchiveCreateRequestDefinition attributes(LogsArchiveCreateRequestAttributes attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogsArchiveCreateRequestAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(LogsArchiveCreateRequestAttributes attributes) { + this.attributes = attributes; + } + + + public LogsArchiveCreateRequestDefinition type(String type) { + + this.type = type; + return this; + } + + /** + * The type of the resource. The value should always be archives. + * @return type + **/ + @ApiModelProperty(example = "archives", required = true, value = "The type of the resource. The value should always be archives.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + public void setType(String type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveCreateRequestDefinition logsArchiveCreateRequestDefinition = (LogsArchiveCreateRequestDefinition) o; + return Objects.equals(this.attributes, logsArchiveCreateRequestDefinition.attributes) && + Objects.equals(this.type, logsArchiveCreateRequestDefinition.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveCreateRequestDefinition {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestination.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestination.java new file mode 100644 index 00000000000..99e569e3b69 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveCreateRequestDestination.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestinationAzure; +import com.datadog.api.v2.client.model.LogsArchiveDestinationGCS; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3Type; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationS3; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=LogsArchiveCreateRequestDestination.LogsArchiveCreateRequestDestinationDeserializer.class) +public class LogsArchiveCreateRequestDestination extends AbstractOpenApiSchema { + public static class LogsArchiveCreateRequestDestinationDeserializer extends StdDeserializer { + public LogsArchiveCreateRequestDestinationDeserializer() { + this(LogsArchiveCreateRequestDestination.class); + } + + public LogsArchiveCreateRequestDestinationDeserializer(Class vc) { + super(vc); + } + + @Override + public LogsArchiveCreateRequestDestination deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize LogsArchiveDestinationAzure + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationAzure.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + // deserialize LogsArchiveDestinationGCS + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationGCS.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + // deserialize LogsArchiveDestinationS3 + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationS3.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + if (match == 1) { + LogsArchiveCreateRequestDestination ret = new LogsArchiveCreateRequestDestination(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for LogsArchiveCreateRequestDestination: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public LogsArchiveCreateRequestDestination() { + super("oneOf", Boolean.FALSE); + } + + public LogsArchiveCreateRequestDestination(LogsArchiveDestinationAzure o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public LogsArchiveCreateRequestDestination(LogsArchiveDestinationGCS o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public LogsArchiveCreateRequestDestination(LogsArchiveDestinationS3 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("LogsArchiveDestinationAzure", new GenericType() { + }); + schemas.put("LogsArchiveDestinationGCS", new GenericType() { + }); + schemas.put("LogsArchiveDestinationS3", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return LogsArchiveCreateRequestDestination.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof LogsArchiveDestinationAzure) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LogsArchiveDestinationGCS) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LogsArchiveDestinationS3) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be LogsArchiveDestinationAzure, LogsArchiveDestinationGCS, LogsArchiveDestinationS3"); + } + + + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDefinition.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDefinition.java new file mode 100644 index 00000000000..0a17701560f --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDefinition.java @@ -0,0 +1,145 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveAttributes; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The definition of an archive. + */ +@ApiModel(description = "The definition of an archive.") +@JsonPropertyOrder({ + LogsArchiveDefinition.JSON_PROPERTY_ATTRIBUTES, + LogsArchiveDefinition.JSON_PROPERTY_ID, + LogsArchiveDefinition.JSON_PROPERTY_TYPE +}) + +public class LogsArchiveDefinition { + public static final String JSON_PROPERTY_ATTRIBUTES = "attributes"; + private LogsArchiveAttributes attributes; + + public static final String JSON_PROPERTY_ID = "id"; + private String id; + + public static final String JSON_PROPERTY_TYPE = "type"; + private String type = "archives"; + + + public LogsArchiveDefinition attributes(LogsArchiveAttributes attributes) { + + this.attributes = attributes; + return this; + } + + /** + * Get attributes + * @return attributes + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_ATTRIBUTES) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public LogsArchiveAttributes getAttributes() { + return attributes; + } + + + public void setAttributes(LogsArchiveAttributes attributes) { + this.attributes = attributes; + } + + + /** + * The archive ID. + * @return id + **/ + @javax.annotation.Nullable + @ApiModelProperty(example = "a2zcMylnM4OCHpYusxIi3g", value = "The archive ID.") + @JsonProperty(JSON_PROPERTY_ID) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getId() { + return id; + } + + + + + /** + * The type of the resource. The value should always be archives. + * @return type + **/ + @ApiModelProperty(example = "archives", required = true, value = "The type of the resource. The value should always be archives.") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getType() { + return type; + } + + + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveDefinition logsArchiveDefinition = (LogsArchiveDefinition) o; + return Objects.equals(this.attributes, logsArchiveDefinition.attributes) && + Objects.equals(this.id, logsArchiveDefinition.id) && + Objects.equals(this.type, logsArchiveDefinition.type); + } + + @Override + public int hashCode() { + return Objects.hash(attributes, id, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveDefinition {\n"); + sb.append(" attributes: ").append(toIndentedString(attributes)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestination.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestination.java new file mode 100644 index 00000000000..1b818e3ef33 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestination.java @@ -0,0 +1,153 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestinationAzure; +import com.datadog.api.v2.client.model.LogsArchiveDestinationGCS; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3Type; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationS3; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import javax.ws.rs.core.GenericType; +import javax.ws.rs.core.Response; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Map; + +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.JsonNode; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.deser.std.StdDeserializer; + + +@JsonDeserialize(using=LogsArchiveDestination.LogsArchiveDestinationDeserializer.class) +public class LogsArchiveDestination extends AbstractOpenApiSchema { + public static class LogsArchiveDestinationDeserializer extends StdDeserializer { + public LogsArchiveDestinationDeserializer() { + this(LogsArchiveDestination.class); + } + + public LogsArchiveDestinationDeserializer(Class vc) { + super(vc); + } + + @Override + public LogsArchiveDestination deserialize(JsonParser jp, DeserializationContext ctxt) throws IOException, JsonProcessingException { + JsonNode tree = jp.readValueAsTree(); + + int match = 0; + Object deserialized = null; + // deserialize LogsArchiveDestinationAzure + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationAzure.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + // deserialize LogsArchiveDestinationGCS + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationGCS.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + // deserialize LogsArchiveDestinationS3 + try { + deserialized = tree.traverse(jp.getCodec()).readValueAs(LogsArchiveDestinationS3.class); + match++; + } catch (Exception e) { + // deserialization failed, continue + } + + if (match == 1) { + LogsArchiveDestination ret = new LogsArchiveDestination(); + ret.setActualInstance(deserialized); + return ret; + } + throw new IOException(String.format("Failed deserialization for LogsArchiveDestination: %d classes match result, expected 1", match)); + } + } + + // store a list of schema names defined in oneOf + public final static Map schemas = new HashMap(); + + public LogsArchiveDestination() { + super("oneOf", Boolean.FALSE); + } + + public LogsArchiveDestination(LogsArchiveDestinationAzure o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public LogsArchiveDestination(LogsArchiveDestinationGCS o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + public LogsArchiveDestination(LogsArchiveDestinationS3 o) { + super("oneOf", Boolean.FALSE); + setActualInstance(o); + } + + static { + schemas.put("LogsArchiveDestinationAzure", new GenericType() { + }); + schemas.put("LogsArchiveDestinationGCS", new GenericType() { + }); + schemas.put("LogsArchiveDestinationS3", new GenericType() { + }); + } + + @Override + public Map getSchemas() { + return LogsArchiveDestination.schemas; + } + + @Override + public void setActualInstance(Object instance) { + if (instance instanceof LogsArchiveDestinationAzure) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LogsArchiveDestinationGCS) { + super.setActualInstance(instance); + return; + } + + if (instance instanceof LogsArchiveDestinationS3) { + super.setActualInstance(instance); + return; + } + + throw new RuntimeException("Invalid instance type. Must be LogsArchiveDestinationAzure, LogsArchiveDestinationGCS, LogsArchiveDestinationS3"); + } + + + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzure.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzure.java new file mode 100644 index 00000000000..a1ba159db6d --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzure.java @@ -0,0 +1,254 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestinationAzureType; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationAzure; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The Azure archive destination. + */ +@ApiModel(description = "The Azure archive destination.") +@JsonPropertyOrder({ + LogsArchiveDestinationAzure.JSON_PROPERTY_CONTAINER, + LogsArchiveDestinationAzure.JSON_PROPERTY_INTEGRATION, + LogsArchiveDestinationAzure.JSON_PROPERTY_PATH, + LogsArchiveDestinationAzure.JSON_PROPERTY_REGION, + LogsArchiveDestinationAzure.JSON_PROPERTY_STORAGE_ACCOUNT, + LogsArchiveDestinationAzure.JSON_PROPERTY_TYPE +}) + +public class LogsArchiveDestinationAzure { + public static final String JSON_PROPERTY_CONTAINER = "container"; + private String container; + + public static final String JSON_PROPERTY_INTEGRATION = "integration"; + private LogsArchiveIntegrationAzure integration; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_REGION = "region"; + private String region; + + public static final String JSON_PROPERTY_STORAGE_ACCOUNT = "storage_account"; + private String storageAccount; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsArchiveDestinationAzureType type = LogsArchiveDestinationAzureType.AZURE; + + + public LogsArchiveDestinationAzure container(String container) { + + this.container = container; + return this; + } + + /** + * The container where the archive will be stored. + * @return container + **/ + @ApiModelProperty(example = "container-name", required = true, value = "The container where the archive will be stored.") + @JsonProperty(JSON_PROPERTY_CONTAINER) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getContainer() { + return container; + } + + + public void setContainer(String container) { + this.container = container; + } + + + public LogsArchiveDestinationAzure integration(LogsArchiveIntegrationAzure integration) { + + this.integration = integration; + return this; + } + + /** + * Get integration + * @return integration + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveIntegrationAzure getIntegration() { + return integration; + } + + + public void setIntegration(LogsArchiveIntegrationAzure integration) { + this.integration = integration; + } + + + public LogsArchiveDestinationAzure path(String path) { + + this.path = path; + return this; + } + + /** + * The archive path. + * @return path + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The archive path.") + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + + public LogsArchiveDestinationAzure region(String region) { + + this.region = region; + return this; + } + + /** + * The region where the archive will be stored. + * @return region + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The region where the archive will be stored.") + @JsonProperty(JSON_PROPERTY_REGION) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getRegion() { + return region; + } + + + public void setRegion(String region) { + this.region = region; + } + + + public LogsArchiveDestinationAzure storageAccount(String storageAccount) { + + this.storageAccount = storageAccount; + return this; + } + + /** + * The associated storage account. + * @return storageAccount + **/ + @ApiModelProperty(example = "account-name", required = true, value = "The associated storage account.") + @JsonProperty(JSON_PROPERTY_STORAGE_ACCOUNT) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getStorageAccount() { + return storageAccount; + } + + + public void setStorageAccount(String storageAccount) { + this.storageAccount = storageAccount; + } + + + public LogsArchiveDestinationAzure type(LogsArchiveDestinationAzureType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveDestinationAzureType getType() { + return type; + } + + + public void setType(LogsArchiveDestinationAzureType type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveDestinationAzure logsArchiveDestinationAzure = (LogsArchiveDestinationAzure) o; + return Objects.equals(this.container, logsArchiveDestinationAzure.container) && + Objects.equals(this.integration, logsArchiveDestinationAzure.integration) && + Objects.equals(this.path, logsArchiveDestinationAzure.path) && + Objects.equals(this.region, logsArchiveDestinationAzure.region) && + Objects.equals(this.storageAccount, logsArchiveDestinationAzure.storageAccount) && + Objects.equals(this.type, logsArchiveDestinationAzure.type); + } + + @Override + public int hashCode() { + return Objects.hash(container, integration, path, region, storageAccount, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveDestinationAzure {\n"); + sb.append(" container: ").append(toIndentedString(container)).append("\n"); + sb.append(" integration: ").append(toIndentedString(integration)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" region: ").append(toIndentedString(region)).append("\n"); + sb.append(" storageAccount: ").append(toIndentedString(storageAccount)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureType.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureType.java new file mode 100644 index 00000000000..6a59b7d62d9 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationAzureType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Type of the Azure archive destination. + */ +public enum LogsArchiveDestinationAzureType { + + AZURE("azure"); + + private String value; + + LogsArchiveDestinationAzureType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogsArchiveDestinationAzureType fromValue(String value) { + for (LogsArchiveDestinationAzureType b : LogsArchiveDestinationAzureType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCS.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCS.java new file mode 100644 index 00000000000..9980791357f --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCS.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestinationGCSType; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationGCS; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The GCS archive destination. + */ +@ApiModel(description = "The GCS archive destination.") +@JsonPropertyOrder({ + LogsArchiveDestinationGCS.JSON_PROPERTY_BUCKET, + LogsArchiveDestinationGCS.JSON_PROPERTY_INTEGRATION, + LogsArchiveDestinationGCS.JSON_PROPERTY_PATH, + LogsArchiveDestinationGCS.JSON_PROPERTY_TYPE +}) + +public class LogsArchiveDestinationGCS { + public static final String JSON_PROPERTY_BUCKET = "bucket"; + private String bucket; + + public static final String JSON_PROPERTY_INTEGRATION = "integration"; + private LogsArchiveIntegrationGCS integration; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsArchiveDestinationGCSType type = LogsArchiveDestinationGCSType.GCS; + + + public LogsArchiveDestinationGCS bucket(String bucket) { + + this.bucket = bucket; + return this; + } + + /** + * The bucket where the archive will be stored. + * @return bucket + **/ + @ApiModelProperty(example = "bucket-name", required = true, value = "The bucket where the archive will be stored.") + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBucket() { + return bucket; + } + + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + + public LogsArchiveDestinationGCS integration(LogsArchiveIntegrationGCS integration) { + + this.integration = integration; + return this; + } + + /** + * Get integration + * @return integration + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveIntegrationGCS getIntegration() { + return integration; + } + + + public void setIntegration(LogsArchiveIntegrationGCS integration) { + this.integration = integration; + } + + + public LogsArchiveDestinationGCS path(String path) { + + this.path = path; + return this; + } + + /** + * The archive path. + * @return path + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The archive path.") + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + + public LogsArchiveDestinationGCS type(LogsArchiveDestinationGCSType type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveDestinationGCSType getType() { + return type; + } + + + public void setType(LogsArchiveDestinationGCSType type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveDestinationGCS logsArchiveDestinationGCS = (LogsArchiveDestinationGCS) o; + return Objects.equals(this.bucket, logsArchiveDestinationGCS.bucket) && + Objects.equals(this.integration, logsArchiveDestinationGCS.integration) && + Objects.equals(this.path, logsArchiveDestinationGCS.path) && + Objects.equals(this.type, logsArchiveDestinationGCS.type); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, integration, path, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveDestinationGCS {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" integration: ").append(toIndentedString(integration)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSType.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSType.java new file mode 100644 index 00000000000..72145d83951 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationGCSType.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Type of the GCS archive destination. + */ +public enum LogsArchiveDestinationGCSType { + + GCS("gcs"); + + private String value; + + LogsArchiveDestinationGCSType(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogsArchiveDestinationGCSType fromValue(String value) { + for (LogsArchiveDestinationGCSType b : LogsArchiveDestinationGCSType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3.java new file mode 100644 index 00000000000..7b0ee990c31 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3.java @@ -0,0 +1,193 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDestinationS3Type; +import com.datadog.api.v2.client.model.LogsArchiveIntegrationS3; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The S3 archive destination. + */ +@ApiModel(description = "The S3 archive destination.") +@JsonPropertyOrder({ + LogsArchiveDestinationS3.JSON_PROPERTY_BUCKET, + LogsArchiveDestinationS3.JSON_PROPERTY_INTEGRATION, + LogsArchiveDestinationS3.JSON_PROPERTY_PATH, + LogsArchiveDestinationS3.JSON_PROPERTY_TYPE +}) + +public class LogsArchiveDestinationS3 { + public static final String JSON_PROPERTY_BUCKET = "bucket"; + private String bucket; + + public static final String JSON_PROPERTY_INTEGRATION = "integration"; + private LogsArchiveIntegrationS3 integration; + + public static final String JSON_PROPERTY_PATH = "path"; + private String path; + + public static final String JSON_PROPERTY_TYPE = "type"; + private LogsArchiveDestinationS3Type type = LogsArchiveDestinationS3Type.S3; + + + public LogsArchiveDestinationS3 bucket(String bucket) { + + this.bucket = bucket; + return this; + } + + /** + * The bucket where the archive will be stored. + * @return bucket + **/ + @ApiModelProperty(example = "bucket-name", required = true, value = "The bucket where the archive will be stored.") + @JsonProperty(JSON_PROPERTY_BUCKET) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getBucket() { + return bucket; + } + + + public void setBucket(String bucket) { + this.bucket = bucket; + } + + + public LogsArchiveDestinationS3 integration(LogsArchiveIntegrationS3 integration) { + + this.integration = integration; + return this; + } + + /** + * Get integration + * @return integration + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_INTEGRATION) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveIntegrationS3 getIntegration() { + return integration; + } + + + public void setIntegration(LogsArchiveIntegrationS3 integration) { + this.integration = integration; + } + + + public LogsArchiveDestinationS3 path(String path) { + + this.path = path; + return this; + } + + /** + * The archive path. + * @return path + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "The archive path.") + @JsonProperty(JSON_PROPERTY_PATH) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public String getPath() { + return path; + } + + + public void setPath(String path) { + this.path = path; + } + + + public LogsArchiveDestinationS3 type(LogsArchiveDestinationS3Type type) { + + this.type = type; + return this; + } + + /** + * Get type + * @return type + **/ + @ApiModelProperty(required = true, value = "") + @JsonProperty(JSON_PROPERTY_TYPE) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public LogsArchiveDestinationS3Type getType() { + return type; + } + + + public void setType(LogsArchiveDestinationS3Type type) { + this.type = type; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveDestinationS3 logsArchiveDestinationS3 = (LogsArchiveDestinationS3) o; + return Objects.equals(this.bucket, logsArchiveDestinationS3.bucket) && + Objects.equals(this.integration, logsArchiveDestinationS3.integration) && + Objects.equals(this.path, logsArchiveDestinationS3.path) && + Objects.equals(this.type, logsArchiveDestinationS3.type); + } + + @Override + public int hashCode() { + return Objects.hash(bucket, integration, path, type); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveDestinationS3 {\n"); + sb.append(" bucket: ").append(toIndentedString(bucket)).append("\n"); + sb.append(" integration: ").append(toIndentedString(integration)).append("\n"); + sb.append(" path: ").append(toIndentedString(path)).append("\n"); + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Type.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Type.java new file mode 100644 index 00000000000..db54eea62cd --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveDestinationS3Type.java @@ -0,0 +1,55 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Type of the S3 archive destination. + */ +public enum LogsArchiveDestinationS3Type { + + S3("s3"); + + private String value; + + LogsArchiveDestinationS3Type(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogsArchiveDestinationS3Type fromValue(String value) { + for (LogsArchiveDestinationS3Type b : LogsArchiveDestinationS3Type.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzure.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzure.java new file mode 100644 index 00000000000..a8b4b86d195 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationAzure.java @@ -0,0 +1,130 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The Azure archive's integration destination. + */ +@ApiModel(description = "The Azure archive's integration destination.") +@JsonPropertyOrder({ + LogsArchiveIntegrationAzure.JSON_PROPERTY_CLIENT_ID, + LogsArchiveIntegrationAzure.JSON_PROPERTY_TENANT_ID +}) + +public class LogsArchiveIntegrationAzure { + public static final String JSON_PROPERTY_CLIENT_ID = "client_id"; + private String clientId; + + public static final String JSON_PROPERTY_TENANT_ID = "tenant_id"; + private String tenantId; + + + public LogsArchiveIntegrationAzure clientId(String clientId) { + + this.clientId = clientId; + return this; + } + + /** + * A client ID. + * @return clientId + **/ + @ApiModelProperty(example = "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", required = true, value = "A client ID.") + @JsonProperty(JSON_PROPERTY_CLIENT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientId() { + return clientId; + } + + + public void setClientId(String clientId) { + this.clientId = clientId; + } + + + public LogsArchiveIntegrationAzure tenantId(String tenantId) { + + this.tenantId = tenantId; + return this; + } + + /** + * A tenant ID. + * @return tenantId + **/ + @ApiModelProperty(example = "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa", required = true, value = "A tenant ID.") + @JsonProperty(JSON_PROPERTY_TENANT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getTenantId() { + return tenantId; + } + + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveIntegrationAzure logsArchiveIntegrationAzure = (LogsArchiveIntegrationAzure) o; + return Objects.equals(this.clientId, logsArchiveIntegrationAzure.clientId) && + Objects.equals(this.tenantId, logsArchiveIntegrationAzure.tenantId); + } + + @Override + public int hashCode() { + return Objects.hash(clientId, tenantId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveIntegrationAzure {\n"); + sb.append(" clientId: ").append(toIndentedString(clientId)).append("\n"); + sb.append(" tenantId: ").append(toIndentedString(tenantId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCS.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCS.java new file mode 100644 index 00000000000..ea477de4dc6 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationGCS.java @@ -0,0 +1,130 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The GCS archive's integration destination. + */ +@ApiModel(description = "The GCS archive's integration destination.") +@JsonPropertyOrder({ + LogsArchiveIntegrationGCS.JSON_PROPERTY_CLIENT_EMAIL, + LogsArchiveIntegrationGCS.JSON_PROPERTY_PROJECT_ID +}) + +public class LogsArchiveIntegrationGCS { + public static final String JSON_PROPERTY_CLIENT_EMAIL = "client_email"; + private String clientEmail; + + public static final String JSON_PROPERTY_PROJECT_ID = "project_id"; + private String projectId; + + + public LogsArchiveIntegrationGCS clientEmail(String clientEmail) { + + this.clientEmail = clientEmail; + return this; + } + + /** + * A client email. + * @return clientEmail + **/ + @ApiModelProperty(example = "youremail@example.com", required = true, value = "A client email.") + @JsonProperty(JSON_PROPERTY_CLIENT_EMAIL) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getClientEmail() { + return clientEmail; + } + + + public void setClientEmail(String clientEmail) { + this.clientEmail = clientEmail; + } + + + public LogsArchiveIntegrationGCS projectId(String projectId) { + + this.projectId = projectId; + return this; + } + + /** + * A project ID. + * @return projectId + **/ + @ApiModelProperty(example = "project-id", required = true, value = "A project ID.") + @JsonProperty(JSON_PROPERTY_PROJECT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getProjectId() { + return projectId; + } + + + public void setProjectId(String projectId) { + this.projectId = projectId; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveIntegrationGCS logsArchiveIntegrationGCS = (LogsArchiveIntegrationGCS) o; + return Objects.equals(this.clientEmail, logsArchiveIntegrationGCS.clientEmail) && + Objects.equals(this.projectId, logsArchiveIntegrationGCS.projectId); + } + + @Override + public int hashCode() { + return Objects.hash(clientEmail, projectId); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveIntegrationGCS {\n"); + sb.append(" clientEmail: ").append(toIndentedString(clientEmail)).append("\n"); + sb.append(" projectId: ").append(toIndentedString(projectId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3.java new file mode 100644 index 00000000000..95b11b910a5 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveIntegrationS3.java @@ -0,0 +1,130 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The S3 Archive's integration destination. + */ +@ApiModel(description = "The S3 Archive's integration destination.") +@JsonPropertyOrder({ + LogsArchiveIntegrationS3.JSON_PROPERTY_ACCOUNT_ID, + LogsArchiveIntegrationS3.JSON_PROPERTY_ROLE_NAME +}) + +public class LogsArchiveIntegrationS3 { + public static final String JSON_PROPERTY_ACCOUNT_ID = "account_id"; + private String accountId; + + public static final String JSON_PROPERTY_ROLE_NAME = "role_name"; + private String roleName; + + + public LogsArchiveIntegrationS3 accountId(String accountId) { + + this.accountId = accountId; + return this; + } + + /** + * The account ID for the integration. + * @return accountId + **/ + @ApiModelProperty(example = "123456789012", required = true, value = "The account ID for the integration.") + @JsonProperty(JSON_PROPERTY_ACCOUNT_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getAccountId() { + return accountId; + } + + + public void setAccountId(String accountId) { + this.accountId = accountId; + } + + + public LogsArchiveIntegrationS3 roleName(String roleName) { + + this.roleName = roleName; + return this; + } + + /** + * The path of the integration. + * @return roleName + **/ + @ApiModelProperty(example = "role-name", required = true, value = "The path of the integration.") + @JsonProperty(JSON_PROPERTY_ROLE_NAME) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getRoleName() { + return roleName; + } + + + public void setRoleName(String roleName) { + this.roleName = roleName; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchiveIntegrationS3 logsArchiveIntegrationS3 = (LogsArchiveIntegrationS3) o; + return Objects.equals(this.accountId, logsArchiveIntegrationS3.accountId) && + Objects.equals(this.roleName, logsArchiveIntegrationS3.roleName); + } + + @Override + public int hashCode() { + return Objects.hash(accountId, roleName); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchiveIntegrationS3 {\n"); + sb.append(" accountId: ").append(toIndentedString(accountId)).append("\n"); + sb.append(" roleName: ").append(toIndentedString(roleName)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchiveState.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveState.java new file mode 100644 index 00000000000..b4b3c31026d --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchiveState.java @@ -0,0 +1,61 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * The state of the archive. + */ +public enum LogsArchiveState { + + UNKNOWN("UNKNOWN"), + + WORKING("WORKING"), + + FAILING("FAILING"), + + WORKING_AUTH_LEGACY("WORKING_AUTH_LEGACY"); + + private String value; + + LogsArchiveState(String value) { + this.value = value; + } + + @JsonValue + public String getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static LogsArchiveState fromValue(String value) { + for (LogsArchiveState b : LogsArchiveState.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/LogsArchives.java b/src/main/java/com/datadog/api/v2/client/model/LogsArchives.java new file mode 100644 index 00000000000..94247ec386b --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/LogsArchives.java @@ -0,0 +1,112 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.LogsArchiveDefinition; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * The available archives. + */ +@ApiModel(description = "The available archives.") +@JsonPropertyOrder({ + LogsArchives.JSON_PROPERTY_DATA +}) + +public class LogsArchives { + public static final String JSON_PROPERTY_DATA = "data"; + private List data = null; + + + public LogsArchives data(List data) { + + this.data = data; + return this; + } + + public LogsArchives addDataItem(LogsArchiveDefinition dataItem) { + if (this.data == null) { + this.data = new ArrayList<>(); + } + this.data.add(dataItem); + return this; + } + + /** + * A list of archives. + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "A list of archives.") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public List getData() { + return data; + } + + + public void setData(List data) { + this.data = data; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + LogsArchives logsArchives = (LogsArchives) o; + return Objects.equals(this.data, logsArchives.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class LogsArchives {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/client/model/RelationshipToRole.java b/src/main/java/com/datadog/api/v2/client/model/RelationshipToRole.java new file mode 100644 index 00000000000..50744a209d3 --- /dev/null +++ b/src/main/java/com/datadog/api/v2/client/model/RelationshipToRole.java @@ -0,0 +1,102 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +package com.datadog.api.v2.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.datadog.api.v2.client.model.RelationshipToRoleData; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +/** + * Relationship to role. + */ +@ApiModel(description = "Relationship to role.") +@JsonPropertyOrder({ + RelationshipToRole.JSON_PROPERTY_DATA +}) + +public class RelationshipToRole { + public static final String JSON_PROPERTY_DATA = "data"; + private RelationshipToRoleData data; + + + public RelationshipToRole data(RelationshipToRoleData data) { + + this.data = data; + return this; + } + + /** + * Get data + * @return data + **/ + @javax.annotation.Nullable + @ApiModelProperty(value = "") + @JsonProperty(JSON_PROPERTY_DATA) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + + public RelationshipToRoleData getData() { + return data; + } + + + public void setData(RelationshipToRoleData data) { + this.data = data; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelationshipToRole relationshipToRole = (RelationshipToRole) o; + return Objects.equals(this.data, relationshipToRole.data); + } + + @Override + public int hashCode() { + return Objects.hash(data); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelationshipToRole {\n"); + sb.append(" data: ").append(toIndentedString(data)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/src/main/java/com/datadog/api/v2/openapi.yaml b/src/main/java/com/datadog/api/v2/openapi.yaml index 039971079b1..8fa05928b08 100644 --- a/src/main/java/com/datadog/api/v2/openapi.yaml +++ b/src/main/java/com/datadog/api/v2/openapi.yaml @@ -4,6 +4,13 @@ components: headers: {} links: {} parameters: + ArchiveID: + description: The ID of the archive. + in: path + name: archive_id + required: true + schema: + type: string PageNumber: description: Specific page number to return. in: query @@ -264,6 +271,271 @@ components: - INTEGRATION_SCREENBOARD - INTEGRATION_TIMEBOARD - HOST_TIMEBOARD + LogsArchive: + description: The logs archive. + properties: + data: + $ref: '#/components/schemas/LogsArchiveDefinition' + type: object + LogsArchiveAttributes: + description: The attributes associated with the archive. + properties: + destination: + $ref: '#/components/schemas/LogsArchiveDestination' + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + state: + $ref: '#/components/schemas/LogsArchiveState' + required: + - name + - query + - destination + type: object + LogsArchiveCreateRequest: + description: The logs archive. + properties: + data: + $ref: '#/components/schemas/LogsArchiveCreateRequestDefinition' + type: object + LogsArchiveCreateRequestAttributes: + description: The attributes associated with the archive. + properties: + destination: + $ref: '#/components/schemas/LogsArchiveCreateRequestDestination' + name: + description: The archive name. + example: Nginx Archive + type: string + query: + description: The archive query/filter. Logs matching this query are included + in the archive. + example: source:nginx + type: string + required: + - name + - query + - destination + type: object + LogsArchiveCreateRequestDefinition: + description: The definition of an archive. + properties: + attributes: + $ref: '#/components/schemas/LogsArchiveCreateRequestAttributes' + type: + default: archives + description: The type of the resource. The value should always be archives. + example: archives + type: string + required: + - type + type: object + LogsArchiveCreateRequestDestination: + description: An archive's destination. + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - type + - integration + type: object + LogsArchiveDefinition: + description: The definition of an archive. + properties: + attributes: + $ref: '#/components/schemas/LogsArchiveAttributes' + id: + description: The archive ID. + example: a2zcMylnM4OCHpYusxIi3g + readOnly: true + type: string + type: + default: archives + description: The type of the resource. The value should always be archives. + example: archives + readOnly: true + type: string + required: + - type + type: object + LogsArchiveDestination: + description: An archive's destination. + nullable: true + oneOf: + - $ref: '#/components/schemas/LogsArchiveDestinationAzure' + - $ref: '#/components/schemas/LogsArchiveDestinationGCS' + - $ref: '#/components/schemas/LogsArchiveDestinationS3' + required: + - type + - integration + type: object + LogsArchiveDestinationAzure: + description: The Azure archive destination. + properties: + container: + description: The container where the archive will be stored. + example: container-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationAzure' + path: + description: The archive path. + type: string + region: + description: The region where the archive will be stored. + type: string + storage_account: + description: The associated storage account. + example: account-name + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationAzureType' + required: + - storage_account + - container + - integration + - type + type: object + LogsArchiveDestinationAzureType: + default: azure + description: Type of the Azure archive destination. + enum: + - azure + example: azure + type: string + x-enum-varnames: + - AZURE + LogsArchiveDestinationGCS: + description: The GCS archive destination. + properties: + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationGCS' + path: + description: The archive path. + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationGCSType' + required: + - bucket + - integration + - type + type: object + LogsArchiveDestinationGCSType: + default: gcs + description: Type of the GCS archive destination. + enum: + - gcs + example: gcs + type: string + x-enum-varnames: + - GCS + LogsArchiveDestinationS3: + description: The S3 archive destination. + properties: + bucket: + description: The bucket where the archive will be stored. + example: bucket-name + type: string + integration: + $ref: '#/components/schemas/LogsArchiveIntegrationS3' + path: + description: The archive path. + type: string + type: + $ref: '#/components/schemas/LogsArchiveDestinationS3Type' + required: + - bucket + - integration + - type + type: object + LogsArchiveDestinationS3Type: + default: s3 + description: Type of the S3 archive destination. + enum: + - s3 + example: s3 + type: string + x-enum-varnames: + - S3 + LogsArchiveIntegrationAzure: + description: The Azure archive's integration destination. + properties: + client_id: + description: A client ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + tenant_id: + description: A tenant ID. + example: aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa + type: string + required: + - tenant_id + - client_id + type: object + LogsArchiveIntegrationGCS: + description: The GCS archive's integration destination. + properties: + client_email: + description: A client email. + example: youremail@example.com + type: string + project_id: + description: A project ID. + example: project-id + type: string + required: + - project_id + - client_email + type: object + LogsArchiveIntegrationS3: + description: The S3 Archive's integration destination. + properties: + account_id: + description: The account ID for the integration. + example: '123456789012' + type: string + role_name: + description: The path of the integration. + example: role-name + type: string + required: + - role_name + - account_id + type: object + LogsArchiveState: + description: The state of the archive. + enum: + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + example: WORKING + type: string + x-enum-varnames: + - UNKNOWN + - WORKING + - FAILING + - WORKING_AUTH_LEGACY + LogsArchives: + description: The available archives. + properties: + data: + description: A list of archives. + items: + $ref: '#/components/schemas/LogsArchiveDefinition' + type: array + type: object Organization: description: Organization object. properties: @@ -443,6 +715,12 @@ components: $ref: '#/components/schemas/RelationshipToPermissionData' type: array type: object + RelationshipToRole: + description: Relationship to role. + properties: + data: + $ref: '#/components/schemas/RelationshipToRoleData' + type: object RelationshipToRoleData: description: Relationship to role object. properties: @@ -1357,6 +1635,282 @@ paths: tags: - Dashboard Lists x-codegen-request-body-name: body + /api/v2/logs/config/archives: + get: + description: Get the list of configured logs archives with their definitions. + operationId: ListLogsArchives + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchives' + description: OK + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Get all archives + tags: + - Logs Archives + post: + description: Create an archive in your organization. + operationId: CreateLogsArchive + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchiveCreateRequest' + description: The definition of the new archive. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + summary: Create an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + /api/v2/logs/config/archives/{archive_id}: + delete: + description: Delete a given archive from your organization. + operationId: DeleteLogsArchive + parameters: + - $ref: '#/components/parameters/ArchiveID' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Delete an archive + tags: + - Logs Archives + get: + description: Get a specific archive from your organization. + operationId: GetLogsArchive + parameters: + - $ref: '#/components/parameters/ArchiveID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Get an archive + tags: + - Logs Archives + put: + description: '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.' + operationId: UpdateLogsArchive + parameters: + - $ref: '#/components/parameters/ArchiveID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchiveCreateRequest' + description: New definition of the archive. + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LogsArchive' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Update an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + /api/v2/logs/config/archives/{archive_id}/readers: + delete: + description: Removes a role from an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + operationId: RemoveRoleFromArchive + parameters: + - $ref: '#/components/parameters/ArchiveID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Revoke role from an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + get: + description: Returns all read roles a given archive is restricted to. + operationId: ListArchiveReadRoles + parameters: + - $ref: '#/components/parameters/ArchiveID' + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RolesResponse' + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: List read roles for an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' + post: + description: Adds a read role to an archive. ([Roles API](https://docs.datadoghq.com/api/v2/roles/)) + operationId: AddReadRoleToArchive + parameters: + - $ref: '#/components/parameters/ArchiveID' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/RelationshipToRole' + responses: + '204': + description: OK + '400': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Bad Request + '403': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Forbidden + '404': + content: + application/json: + schema: + $ref: '#/components/schemas/APIErrorResponse' + description: Not found + summary: Grant role to an archive + tags: + - Logs Archives + x-codegen-request-body-name: body + x-unstable: '**Note**: This endpoint is in public beta. + + If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).' /api/v2/permissions: get: description: Returns a list of all permissions, including name, description, @@ -2244,6 +2798,16 @@ tags: organization.' name: Dashboard Lists +- description: 'Archives forward all the logs ingested to a cloud storage system. + + + See the [Archives Page](https://app.datadoghq.com/logs/pipelines/archives) + + for a list of the archives currently configured in our UI.' + externalDocs: + description: Find out more at + url: https://docs.datadoghq.com/logs/archives/ + name: Logs Archives - description: 'The Roles API is used to create and manage Datadog roles, what [global permissions](https://docs.datadoghq.com/account_management/rbac/)