Skip to content

Commit

Permalink
use a different schema in root on logsink get
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla committed Oct 9, 2024
1 parent 4c9d2f5 commit 0f32c4e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
14 changes: 6 additions & 8 deletions databases_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}`

Expand Down

0 comments on commit 0f32c4e

Please sign in to comment.