12345678910111213141516171819202122232425262728293031323334353637383940 |
- package client
- import (
- "fmt"
- "net/url"
- "strconv"
- )
- const (
- getExecuteSqlLogsUrl = "/ds/api/v1/sql/exec/log/query"
- )
- func (c *Client) GetExecuteSqlLogs(token string, baseUrl string, namespace string, dataSource string,
- executor string, startExecuteTime string, endExecuteTime string, pageNo int, pageSize int) ([]ExecuteSqlLogInfo, error) {
- fullUrl, err := url.JoinPath(baseUrl, getExecuteSqlLogsUrl)
- if err != nil {
- return nil, err
- }
- resp := new(InfosResponse[ExecuteSqlLogInfo])
- err = c.get(token, fullUrl, map[string]string{
- "namespace": namespace,
- "dataSource": dataSource,
- "executor": executor,
- "startExecuteTime": startExecuteTime,
- "endExecuteTime": endExecuteTime,
- "pageNo": strconv.Itoa(pageNo),
- "pageSize": strconv.Itoa(pageSize),
- }, resp)
- if err != nil {
- return nil, err
- }
- if !resp.Success {
- return nil, fmt.Errorf(resp.Msg)
- }
- return resp.Infos, nil
- }
|