Skip to content

Commit d3f4588

Browse files
do-joeDO-rrao
andauthored
GetLogsink updated to handled unwrapped API response (#928)
Co-authored-by: DO-rrao <[email protected]>
1 parent 4cd6435 commit d3f4588

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

databases.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,12 +2107,12 @@ func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string
21072107
return nil, nil, err
21082108
}
21092109

2110-
root := new(databaseLogsinkRoot)
2110+
root := new(DatabaseLogsink)
21112111
resp, err := svc.client.Do(ctx, req, root)
21122112
if err != nil {
21132113
return nil, resp, err
21142114
}
2115-
return root.Sink, resp, nil
2115+
return root, resp, nil
21162116
}
21172117

21182118
// ListTopics returns all topics for a given kafka cluster

databases_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4196,15 +4196,13 @@ func TestDatabases_GetLogsink(t *testing.T) {
41964196
}
41974197

41984198
body := `{
4199-
"sink": {
42004199
"sink_id":"deadbeef-dead-4aa5-beef-deadbeef347d",
42014200
"sink_name": "logs-sink",
42024201
"sink_type": "opensearch",
42034202
"config": {
42044203
"url": "https://user:[email protected]:25060",
42054204
"index_prefix": "opensearch-logs"
42064205
}
4207-
}
42084206
}`
42094207

42104208
path := fmt.Sprintf("/v2/databases/%s/logsink/%s", dbID, logsinkID)

0 commit comments

Comments
 (0)