Todos os produtos
Search
Central de documentação

Tablestore:Consultar informações de uma tabela de séries temporais

Última atualização: Jul 03, 2026

Chame a operação DescribeTimeseriesTable para consultar informações de uma tabela de séries temporais, como a configuração de tempo de vida (TTL).

Pré-requisitos

Parâmetros

Parâmetro

Descrição

timeseriesTableName

Nome da tabela de séries temporais.

Exemplo

O exemplo a seguir chama DescribeTimeseriesTable para recuperar os metadados da tabela de séries temporais, incluindo nome da tabela, tempo de vida (TTL) e informações do analytical store.

func DescribeTimeseriesTableSample(client *tablestore.TimeseriesClient, timeseriesTableName string) {
    fmt.Println("[Info]: Begin to require timeseries table description!")
    describeTimeseriesTableRequest := tablestore.NewDescribeTimeseriesTableRequset(timeseriesTableName) // Construct a request and specify the name of the time series table.

    describeTimeseriesTableResponse, err := client.DescribeTimeseriesTable(describeTimeseriesTableRequest)
    if err != nil {
        fmt.Println("[Error]: Failed to require timeseries table description!")
        return
    }
    fmt.Println("[Info]: DescribeTimeseriesTableSample finished. Timeseries table meta: ")
    fmt.Println("[Info]: TimeseriesTableName: ", describeTimeseriesTableResponse.GetTimeseriesTableMeta().GetTimeseriesTableName())
    fmt.Println("[Info]: TimeseriesTable TTL: ", describeTimeseriesTableResponse.GetTimeseriesTableMeta().GetTimeseriesTableOPtions().GetTimeToLive())
    //If you have created an analytical store for the time series table, you can use the following code to obtain the analytical store information.
    analyticalStores := describeTimeseriesTableResponse.GetAnalyticalStores()
    for _, analyticalStore := range analyticalStores {
        fmt.Println("[Info]: AnalyticalStoreName: ", analyticalStore.StoreName)
        if analyticalStore.TimeToLive != nil {
            fmt.Println("[Info]: TimeToLive: ", *analyticalStore.TimeToLive)
        }
        if analyticalStore.SyncOption != nil {
            fmt.Println("[Info]: SyncOption: ", *analyticalStore.SyncOption)
        }
    }
}

Referências