@@ -21,6 +21,7 @@ import (
21
21
"encoding/json"
22
22
"fmt"
23
23
"io"
24
+ "math"
24
25
"os/exec"
25
26
"strings"
26
27
"testing"
@@ -33,6 +34,13 @@ const (
33
34
sleepDuration = 2 * time .Second
34
35
)
35
36
37
+ type StreamHotTier struct {
38
+ Size string `json:"size"`
39
+ UsedSize * string `json:"used_size,omitempty"`
40
+ AvailableSize * string `json:"available_size,omitempty"`
41
+ OldestDateTimeEntry * string `json:"oldest_date_time_entry,omitempty"`
42
+ }
43
+
36
44
func flogStreamFields () []string {
37
45
return []string {
38
46
"p_timestamp" ,
@@ -564,7 +572,13 @@ func checkAPIAccess(t *testing.T, client HTTPClient, stream string, role string)
564
572
}
565
573
566
574
func activateHotTier (t * testing.T ) {
567
- req , _ := NewGlob .QueryClient .NewRequest ("PUT" , "logstream/" + NewGlob .Stream + "/hottier" , nil )
575
+ payload := StreamHotTier {
576
+ Size : fmt .Sprintf ("%d" , int64 (20 * math .Pow (1024 , 3 ))), // set hot tier size to be 20 GB
577
+ }
578
+ json , _ := json .Marshal (payload )
579
+
580
+ req , _ := NewGlob .QueryClient .NewRequest ("PUT" , "logstream/" + NewGlob .Stream + "/hottier" , bytes .NewBuffer (json ))
581
+ req .Header .Set ("Content-Type" , "application/json" )
568
582
response , err := NewGlob .QueryClient .Do (req )
569
583
body := readAsString (response .Body )
570
584
0 commit comments