Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Test:

➜  noobaa-operator git:(6f571fd) ✗ ./build/_output/bin/noobaa-operator-local -n noobaa api events_api export_activity_log '{}'
INFO[0000] ✅ Exists: NooBaa "noobaa"
INFO[0000] ✅ Exists: Service "noobaa-mgmt"
INFO[0000] ✅ Exists: Secret "noobaa-operator"
INFO[0000] ✅ Exists: Secret "noobaa-admin"
INFO[0000] ✈️  RPC: events.export_activity_log() Request: map[]
WARN[0000] RPC: GetConnection creating connection to wss://localhost:63468/rpc/ 0xc000b9fc20
INFO[0000] RPC: Connecting websocket (0xc000b9fc20) &{RPC:0xc0003659a0 Address:wss://localhost:63468/rpc/ State:init WS:<nil> PendingRequests:map[] NextRequestID:0 Lock:{state:1 sema:0} ReconnectDelay:0s cancelPings:<nil>}
INFO[0000] RPC: Connected websocket (0xc000b9fc20) &{RPC:0xc0003659a0 Address:wss://localhost:63468/rpc/ State:init WS:<nil> PendingRequests:map[] NextRequestID:0 Lock:{state:1 sema:0} ReconnectDelay:0s cancelPings:<nil>}
ERRO[0001] RPC: HandleResponse for OP res API  raw bytes {"op":"res","reqid":"wss://localhost:63468/rpc/-0","took":898.633090000134,"reply":{"out_path":"/public/audit.csv"}}
INFO[0001] ✅ RPC: events.export_activity_log() Response OK: took 898.6ms
out_path: /public/audit.csv

Signed-off-by: Alexander Indenbaum <aindenba@redhat.com>
  • Loading branch information
Alexander Indenbaum authored and baum committed Nov 7, 2022
1 parent fe26435 commit 14dcce8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/api/events_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,13 @@ module.exports = {
}
},
reply: {
type: 'string',
type: 'object',
required: ['out_path'],
properties: {
out_path: {
type: 'string'
}
}
},
auth: {
system: 'admin',
Expand Down
2 changes: 1 addition & 1 deletion src/server/notifications/event_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function export_activity_log(req) {

return fs.promises.writeFile(inner_path, out_lines.join('\n'), 'utf8');
})
.then(() => out_path)
.then(() => ({out_path}))
.catch(err => {
dbg.error('received error when writing to audit csv file:', inner_path, err);
throw err;
Expand Down

0 comments on commit 14dcce8

Please sign in to comment.