github.com/morlay/goqcloud@v0.0.0-20181123023149-b00e0b0b9afc/clients/postgres/describe_db_slowlogs.go (about) 1 package postgres 2 3 import ( 4 github_com_morlay_goqcloud "github.com/morlay/goqcloud" 5 time "time" 6 ) 7 8 // 获取慢查询日志 9 // https://cloud.tencent.com/document/api/409/18092 10 11 type DescribeDbSlowlogsRequest struct { 12 // 实例ID,形如postgres-lnp6j617 13 DBInstanceId string `name:"DBInstanceId"` 14 // 数据库名字 15 DatabaseName *string `name:"DatabaseName,omitempty"` 16 // 查询结束时间,形如2018-06-10 17:06:38 17 EndTime time.Time `name:"EndTime"` 18 // 分页返回结果,每页最大返回数量,取值为1-100,默认20 19 Limit *int64 `name:"Limit,omitempty"` 20 // 分页返回结果,返回结果的第几页,从0开始计数 21 Offset *int64 `name:"Offset,omitempty"` 22 // 按照何种指标排序,取值为sum_calls或者sum_cost_time。sum_calls-总调用次数;sum_cost_time-总的花费时间 23 OrderBy *string `name:"OrderBy,omitempty"` 24 // 排序规则。desc-降序;asc-升序 25 OrderByType *string `name:"OrderByType,omitempty"` 26 // 区域 27 Region string `name:"Region"` 28 // 查询起始时间,形如2018-06-10 17:06:38,起始时间不得小于7天以前 29 StartTime time.Time `name:"StartTime"` 30 } 31 32 func (req *DescribeDbSlowlogsRequest) Invoke(client github_com_morlay_goqcloud.Client) (*DescribeDbSlowlogsResponse, error) { 33 resp := &DescribeDbSlowlogsResponse{} 34 err := client.Request("postgres", "DescribeDBSlowlogs", "2017-03-12").Do(req, resp) 35 return resp, err 36 } 37 38 type DescribeDbSlowlogsResponse struct { 39 github_com_morlay_goqcloud.TencentCloudBaseResponse 40 // 慢查询日志详情 41 Detail SlowlogDetail `json:"Detail"` 42 // 本次返回多少条数据 43 TotalCount int64 `json:"TotalCount"` 44 }