-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathUpdateReferenceTable.ts
More file actions
55 lines (51 loc) · 1.32 KB
/
UpdateReferenceTable.ts
File metadata and controls
55 lines (51 loc) · 1.32 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
43
44
45
46
47
48
49
50
51
52
53
54
55
/**
* Update reference table returns "OK" response
*/
import { client, v2 } from "@datadog/datadog-api-client";
const configuration = client.createConfiguration();
const apiInstance = new v2.ReferenceTablesApi(configuration);
const params: v2.ReferenceTablesApiUpdateReferenceTableRequest = {
body: {
data: {
attributes: {
description: "this is a cloud table generated via a cloud bucket sync",
fileMetadata: {
accessDetails: {
awsDetail: {
awsAccountId: "test-account-id",
awsBucketName: "test-bucket",
filePath: "test_rt.csv",
},
},
syncEnabled: true,
},
schema: {
fields: [
{
name: "id",
type: "INT32",
},
{
name: "name",
type: "STRING",
},
],
primaryKeys: ["id"],
},
syncEnabled: false,
tags: ["test_tag"],
},
id: "00000000-0000-0000-0000-000000000000",
type: "reference_table",
},
},
id: "id",
};
apiInstance
.updateReferenceTable(params)
.then((data: any) => {
console.log(
"API called successfully. Returned data: " + JSON.stringify(data)
);
})
.catch((error: any) => console.error(error));