@@ -15,15 +15,15 @@ import (
1515
1616type cmdDeviceLogs struct {
1717 cmdDevice
18- deviceID string
19- follow bool
20- from cli.Timestamp
21- to cli.Timestamp
22- offset int
23- limit int
24- severity string
25- order string
26- showFilter string
18+ deviceID string
19+ follow bool
20+ receivedAtGte cli.Timestamp
21+ receivedAtLt cli.Timestamp
22+ offset int
23+ limit int
24+ severity string
25+ order string
26+ retention string
2727}
2828
2929func buildCmdDeviceLogs () * cli.Command {
@@ -54,14 +54,14 @@ func (c *cmdDeviceLogs) Flags() []cli.Flag {
5454 Usage : "Follow the log output" ,
5555 Destination : & c .follow ,
5656 }, & cli.TimestampFlag {
57- Name : "from " ,
57+ Name : "received-at-gte " ,
5858 Usage : "From timestamp in RFC 3339 format (e.g. 2006-01-02T15:04:05Z)" ,
59- Destination : & c .from ,
59+ Destination : & c .receivedAtGte ,
6060 Layout : time .RFC3339 ,
6161 }, & cli.TimestampFlag {
62- Name : "to " ,
62+ Name : "received-at-lt " ,
6363 Usage : "To timestamp in RFC 3339 format (e.g. 2006-01-02T15:04:05Z)" ,
64- Destination : & c .to ,
64+ Destination : & c .receivedAtLt ,
6565 Layout : time .RFC3339 ,
6666 }, & cli.IntFlag {
6767 Name : "limit" ,
@@ -89,12 +89,12 @@ func (c *cmdDeviceLogs) Flags() []cli.Flag {
8989 return nil
9090 },
9191 }, & cli.StringFlag {
92- Name : "show " ,
93- Usage : "Filter logs by criteria (ALL[default], PERSISTED_ONLY, TEMPORARY_ONLY )" ,
94- Destination : & c .showFilter ,
92+ Name : "retention " ,
93+ Usage : "Filter logs by retention (ALL[default], PERSISTENT, EPHEMERAL )" ,
94+ Destination : & c .retention ,
9595 Action : func (_ * cli.Context , v string ) error {
96- if v != "ALL" && v != "PERSISTED_ONLY " && v != "TEMPORARY_ONLY " {
97- return fmt .Errorf ("%w: should be one of [ALL, PERSISTED_ONLY, TEMPORARY_ONLY ]" , errUnsupportedFlagValue )
96+ if v != "ALL" && v != "PERSISTENT " && v != "EPHEMERAL " {
97+ return fmt .Errorf ("%w: should be one of [ALL, PERSISTENT, EPHEMERAL ]" , errUnsupportedFlagValue )
9898 }
9999 return nil
100100 },
@@ -109,28 +109,28 @@ func (c *cmdDeviceLogs) do(ctx context.Context) error {
109109}
110110
111111func (c * cmdDeviceLogs ) doFollow (ctx context.Context ) error {
112- if c .from .Value () != nil {
113- return cli .Exit ("Option received_at_from is unsupported in follow mode." , 1 )
112+ if c .receivedAtGte .Value () != nil {
113+ return cli .Exit ("Option --received-at-gte is unsupported in follow mode." , 1 )
114114 }
115- if c .to .Value () != nil {
116- return cli .Exit ("Option received_at_to is unsupported in follow mode." , 1 )
115+ if c .receivedAtLt .Value () != nil {
116+ return cli .Exit ("Option --received-at-lt is unsupported in follow mode." , 1 )
117117 }
118118 if c .offset > 0 {
119- return cli .Exit ("Option offset is unsupported in follow mode." , 1 )
119+ return cli .Exit ("Option -- offset is unsupported in follow mode." , 1 )
120120 }
121121 if c .limit > 0 {
122- return cli .Exit ("Option limit is unsupported in follow mode." , 1 )
122+ return cli .Exit ("Option -- limit is unsupported in follow mode." , 1 )
123123 }
124124 if c .order != "" {
125- return cli .Exit ("Option order is unsupported in follow mode." , 1 )
125+ return cli .Exit ("Option -- order is unsupported in follow mode." , 1 )
126126 }
127127
128128 query := url.Values {}
129129 if c .severity != "" {
130130 query .Add ("severity" , c .severity )
131131 }
132- if c .showFilter != "" {
133- query .Add ("show " , c .showFilter )
132+ if c .retention != "" {
133+ query .Add ("retention " , c .retention )
134134 }
135135
136136 return c .runWebSocket (ctx , runWebSocketParams {
@@ -164,11 +164,11 @@ func (c *cmdDeviceLogs) doFollow(ctx context.Context) error {
164164
165165func (c * cmdDeviceLogs ) doList (ctx context.Context ) error {
166166 query := url.Values {}
167- if c .from .Value () != nil {
168- query .Add ("received_at_from " , c .from .Value ().Format (time .RFC3339 ))
167+ if c .receivedAtGte .Value () != nil {
168+ query .Add ("received_at.gte " , c .receivedAtGte .Value ().Format (time .RFC3339 ))
169169 }
170- if c .to .Value () != nil {
171- query .Add ("received_at_to " , c .to .Value ().Format (time .RFC3339 ))
170+ if c .receivedAtLt .Value () != nil {
171+ query .Add ("received_at.lt " , c .receivedAtLt .Value ().Format (time .RFC3339 ))
172172 }
173173 if c .offset > 0 {
174174 query .Add ("offset" , strconv .Itoa (c .offset ))
@@ -182,8 +182,8 @@ func (c *cmdDeviceLogs) doList(ctx context.Context) error {
182182 if c .order != "" {
183183 query .Add ("order" , c .order )
184184 }
185- if c .showFilter != "" {
186- query .Add ("show " , c .showFilter )
185+ if c .retention != "" {
186+ query .Add ("retention " , c .retention )
187187 }
188188
189189 return c .doHTTPRequest (ctx , doHTTPRequestParams {
0 commit comments