diff --git a/log_store.go b/log_store.go index 039578b1..e09e56d1 100644 --- a/log_store.go +++ b/log_store.go @@ -28,7 +28,7 @@ type LogStore struct { MaxSplitShard int `json:"maxSplitShard"` AppendMeta bool `json:"appendMeta"` TelemetryType string `json:"telemetryType"` - HotTTL int `json:"hot_ttl"` + HotTTL uint32 `json:"hot_ttl,omitempty"` CreateTime uint32 `json:"createTime,omitempty"` LastModifyTime uint32 `json:"lastModifyTime,omitempty"` diff --git a/logstore_test.go b/logstore_test.go index d3167b49..e9f5f949 100644 --- a/logstore_test.go +++ b/logstore_test.go @@ -61,6 +61,39 @@ func createLogStore(s *LogstoreTestSuite) *LogStore { return store } +func (s *LogstoreTestSuite) TestCreateLogStoreWithNewRequestBody() { + client := CreateNormalInterface(s.endpoint, s.accessKeyID, s.accessKeySecret, "") + exist, ce := client.CheckProjectExist(s.projectName) + s.Nil(ce) + if !exist { + _, cpe := client.CreateProject(s.projectName, "go sdk test") + s.Nil(cpe) + } + defer client.DeleteProject(s.projectName) + logStore := &LogStore{ + Name: s.logstoreName, + TTL: 7, + ShardCount: 2, + WebTracking: false, + AutoSplit: true, + MaxSplitShard: 16, + AppendMeta: false, + } + err := s.Project.CreateLogStoreV2(logStore) + s.Nil(err) + time.Sleep(time.Second * 10) + store, err := s.Project.GetLogStore(s.logstoreName) + s.Nil(err) + s.Equal(s.logstoreName, store.Name) + s.Equal(7, store.TTL) + s.Equal(2, store.ShardCount) + s.Equal(false, store.WebTracking) + s.Equal(true, store.AutoSplit) + s.Equal(16, store.MaxSplitShard) + s.Equal(false, store.AppendMeta) + s.Equal(uint32(0), store.HotTTL) +} + func (s *LogstoreTestSuite) TestCheckLogStore() { store, err := s.Project.GetLogStore(s.logstoreName) s.Nil(err)