-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathCreateLogsArchive.ts
More file actions
42 lines (38 loc) · 1.1 KB
/
CreateLogsArchive.ts
File metadata and controls
42 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Create an archive returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.LogsArchivesApi(configuration);
const params: v2.LogsArchivesApiCreateLogsArchiveRequest = {
body: {
data: {
attributes: {
compressionMethod: "GZIP",
destination: {
container: "container-name",
integration: {
clientId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
tenantId: "aaaaaaaa-1a1a-1a1a-1a1a-aaaaaaaaaaaa",
},
storageAccount: "account-name",
type: "azure",
},
includeTags: false,
name: "Nginx Archive",
query: "source:nginx",
rehydrationMaxScanSizeInGb: 100,
rehydrationTags: ["team:intake", "team:app"],
},
type: "archives",
},
},
};
apiInstance
.createLogsArchive(params)
.then((data: v2.LogsArchive) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));