Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[databases]: test logsink #736

Closed
wants to merge 7 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions databases.go
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,10 @@ type databaseTopicsRoot struct {
Topics []DatabaseTopic `json:"topics"`
}

type databaseLogsinkRoot struct {
Sink *DatabaseLogsink `json:"sink"`
}

type databaseLogsinksRoot struct {
Sinks []DatabaseLogsink `json:"sinks"`
}
Expand Down Expand Up @@ -1886,12 +1890,13 @@ func (svc *DatabasesServiceOp) CreateLogsink(ctx context.Context, databaseID str
return nil, nil, err
}

root := new(DatabaseLogsink)
root := new(databaseLogsinkRoot)

resp, err := svc.client.Do(ctx, req, root)
if err != nil {
return nil, resp, err
}
return root, resp, nil
return root.Sink, resp, nil
}

// GetLogsink gets a logsink for a database
Expand All @@ -1902,7 +1907,9 @@ func (svc *DatabasesServiceOp) GetLogsink(ctx context.Context, databaseID string
return nil, nil, err
}

// root := new(databaseLogsinkRoot)
root := new(DatabaseLogsink)

resp, err := svc.client.Do(ctx, req, root)
if err != nil {
return nil, resp, err
Expand Down Expand Up @@ -1937,7 +1944,8 @@ func (svc *DatabasesServiceOp) UpdateLogsink(ctx context.Context, databaseID str
return nil, err
}

resp, err := svc.client.Do(ctx, req, nil)
root := new(databaseLogsinkRoot)
resp, err := svc.client.Do(ctx, req, root)
if err != nil {
return resp, err
}
Expand Down
Loading