@@ -61,20 +61,20 @@ func (c *Client) ProvisionerDaemonClient(ctx context.Context) (proto.DRPCProvisi
61
61
62
62
// ProvisionerJobLogs returns all logs for workspace history.
63
63
// To stream logs, use the FollowProvisionerJobLogs function.
64
- func (c * Client ) ProvisionerJobLogs (ctx context.Context , jobID uuid.UUID ) ([]coderd.ProvisionerJobLog , error ) {
65
- return c .ProvisionerJobLogsBetween (ctx , jobID , time.Time {}, time.Time {})
64
+ func (c * Client ) ProvisionerJobLogs (ctx context.Context , organization string , jobID uuid.UUID ) ([]coderd.ProvisionerJobLog , error ) {
65
+ return c .ProvisionerJobLogsBetween (ctx , organization , jobID , time.Time {}, time.Time {})
66
66
}
67
67
68
68
// ProvisionerJobLogsBetween returns logs between a specific time.
69
- func (c * Client ) ProvisionerJobLogsBetween (ctx context.Context , jobID uuid.UUID , after , before time.Time ) ([]coderd.ProvisionerJobLog , error ) {
69
+ func (c * Client ) ProvisionerJobLogsBetween (ctx context.Context , organization string , jobID uuid.UUID , after , before time.Time ) ([]coderd.ProvisionerJobLog , error ) {
70
70
values := url.Values {}
71
71
if ! after .IsZero () {
72
72
values ["after" ] = []string {strconv .FormatInt (after .UTC ().UnixMilli (), 10 )}
73
73
}
74
74
if ! before .IsZero () {
75
75
values ["before" ] = []string {strconv .FormatInt (before .UTC ().UnixMilli (), 10 )}
76
76
}
77
- res , err := c .request (ctx , http .MethodGet , fmt .Sprintf ("/api/v2/provisioners/jobs/%s/logs?%s" , jobID , values .Encode ()), nil )
77
+ res , err := c .request (ctx , http .MethodGet , fmt .Sprintf ("/api/v2/provisioners/jobs/%s/%s/ logs?%s" , organization , jobID , values .Encode ()), nil )
78
78
if err != nil {
79
79
return nil , err
80
80
}
@@ -89,12 +89,12 @@ func (c *Client) ProvisionerJobLogsBetween(ctx context.Context, jobID uuid.UUID,
89
89
90
90
// FollowProvisionerJobLogsAfter returns a stream of workspace history logs.
91
91
// The channel will close when the workspace history job is no longer active.
92
- func (c * Client ) FollowProvisionerJobLogsAfter (ctx context.Context , jobID uuid.UUID , after time.Time ) (<- chan coderd.ProvisionerJobLog , error ) {
92
+ func (c * Client ) FollowProvisionerJobLogsAfter (ctx context.Context , organization string , jobID uuid.UUID , after time.Time ) (<- chan coderd.ProvisionerJobLog , error ) {
93
93
afterQuery := ""
94
94
if ! after .IsZero () {
95
95
afterQuery = fmt .Sprintf ("&after=%d" , after .UTC ().UnixMilli ())
96
96
}
97
- res , err := c .request (ctx , http .MethodGet , fmt .Sprintf ("/api/v2/provisioners/jobs/%s/logs?follow%s" , jobID , afterQuery ), nil )
97
+ res , err := c .request (ctx , http .MethodGet , fmt .Sprintf ("/api/v2/provisioners/jobs/%s/%s/ logs?follow%s" , organization , jobID , afterQuery ), nil )
98
98
if err != nil {
99
99
return nil , err
100
100
}
0 commit comments