Prérequis
Vous avez créé une instance pour le modèle TimeSeries dans une région qui prend en charge la fonctionnalité de magasin analytique. Pour plus d'informations, consultez la rubrique Créer une instance pour le modèle TimeSeries.
Vous avez initialisé un client. Pour plus d'informations, consultez la rubrique Initialiser un client Tablestore.
Exemple
func CreateTimeseriesAnalyticalStore(client *tablestore.TimeseriesClient) {
//Specify the name of the analytical store.
analyticalStore := tablestore.NewTimeseriesAnalyticalStore("test_analytical_store")
//Specify the TTL of the analytical store in seconds.
analyticalStore.SetTimeToLive(2592000)
//Specify the mode in which the data in the time series table is synchronized to the analytical store.
analyticalStore.SetSyncOption(tablestore.SYNC_TYPE_INCR)
//Specify the name of the time series table.
request := tablestore.NewCreateTimeseriesAnalyticalStoreRequest("test_timeseries_table", analyticalStore)
_, err := client.CreateTimeseriesAnalyticalStore(request)
if err != nil {
log.Fatal(err)
}
}