From 0f32c4e3c663a0ad49a44dae1694b9cbceda1007 Mon Sep 17 00:00:00 2001 From: Anna Lushnikova Date: Wed, 9 Oct 2024 12:20:50 -0400 Subject: [PATCH] use a different schema in root on logsink get --- databases.go | 6 +++--- databases_test.go | 14 ++++++-------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/databases.go b/databases.go index c21b6209..ec9fb5b0 100644 --- a/databases.go +++ b/databases.go @@ -1921,12 +1921,12 @@ func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string return nil, nil, err } - root := new(databaseLogsinkRoot) - resp, err := svc.client.Do(ctx, req, root.Sink) + root := new(DatabaseLogsink) + resp, err := svc.client.Do(ctx, req, root) if err != nil { return nil, resp, err } - return &root.Sink, resp, nil + return root, resp, nil } // ListTopics returns all logsinks for a given database cluster. diff --git a/databases_test.go b/databases_test.go index 26247bd4..7806b11a 100644 --- a/databases_test.go +++ b/databases_test.go @@ -3919,14 +3919,12 @@ func TestDatabases_GetLogsink(t *testing.T) { } body := `{ - "sink":{ - "sink_id":"deadbeef-dead-4aa5-beef-deadbeef347d", - "sink_name":"logs-sink", - "sink_type":"opensearch", - "config":{ - "url":"https://user:passwd@192.168.0.1:25060", - "index_prefix":"opensearch-logs" - } + "sink_id":"deadbeef-dead-4aa5-beef-deadbeef347d", + "sink_name":"logs-sink", + "sink_type":"opensearch", + "config":{ + "url":"https://user:passwd@192.168.0.1:25060", + "index_prefix":"opensearch-logs" } }`