-
Notifications
You must be signed in to change notification settings - Fork 38
/
describe_udbbackup.go
83 lines (60 loc) · 2.69 KB
/
describe_udbbackup.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api UDB DescribeUDBBackup
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// DescribeUDBBackupRequest is request schema for DescribeUDBBackup action
type DescribeUDBBackupRequest struct {
request.CommonBase
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// 分页显示的起始偏移,列表操作则指定
Offset *int `required:"true"`
// 分页显示的条目数,列表操作则指定
Limit *int `required:"true"`
// DB实例Id,如果指定,则只获取该db的备份信息 该值可以通过DescribeUDBInstance获取
DBId *string `required:"false"`
// 备份类型,取值为0或1,0表示自动,1表示手动
BackupType *int `required:"false"`
// 过滤条件:起始时间(Unix时间戳)
BeginTime *int `required:"false"`
// 过滤条件:结束时间(Unix时间戳)
EndTime *int `required:"false"`
// 如果未指定GroupId,则可选是否选取特定DB类型的配置(sql, nosql, postgresql, sqlserver)
ClassType *string `required:"false"`
// 如果填了BackupId, 那么只拉取这个备份的记录
BackupId *int `required:"false"`
}
// DescribeUDBBackupResponse is response schema for DescribeUDBBackup action
type DescribeUDBBackupResponse struct {
response.CommonBase
// 备份信息 参照UDBBackupSet
DataSet []UDBBackupSet
// 满足条件备份总数,如果指定dbid,则是该db备份总数
TotalCount int
}
// NewDescribeUDBBackupRequest will create request of DescribeUDBBackup action.
func (c *UDBClient) NewDescribeUDBBackupRequest() *DescribeUDBBackupRequest {
req := &DescribeUDBBackupRequest{}
// setup request with client config
c.Client.SetupRequest(req)
// setup retryable with default retry policy (retry for non-create action and common error)
req.SetRetryable(true)
return req
}
// DescribeUDBBackup - 列表UDB实例备份信息.Zone不填表示多可用区,填代表单可用区
func (c *UDBClient) DescribeUDBBackup(req *DescribeUDBBackupRequest) (*DescribeUDBBackupResponse, error) {
var err error
var res DescribeUDBBackupResponse
err = c.Client.InvokeAction("DescribeUDBBackup", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}