-
Notifications
You must be signed in to change notification settings - Fork 38
/
describe_udbinstance_backup_state.go
68 lines (50 loc) · 2.3 KB
/
describe_udbinstance_backup_state.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
//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 DescribeUDBInstanceBackupState
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// DescribeUDBInstanceBackupStateRequest is request schema for DescribeUDBInstanceBackupState action
type DescribeUDBInstanceBackupStateRequest struct {
request.CommonBase
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"true"`
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// 备份记录ID
BackupId *int `required:"true"`
// 跨可用区高可用备库所在可用区,参见[可用区列表]
BackupZone *string `required:"false"`
}
// DescribeUDBInstanceBackupStateResponse is response schema for DescribeUDBInstanceBackupState action
type DescribeUDBInstanceBackupStateResponse struct {
response.CommonBase
// 备份状态 0 Backuping // 备份中 1 Success // 备份成功 2 Failed // 备份失败 3 Expired // 备份过期
State string
// 备份所占空间大小
BackupSize int
// 备份截止时间
BackupEndTime int
}
// NewDescribeUDBInstanceBackupStateRequest will create request of DescribeUDBInstanceBackupState action.
func (c *UDBClient) NewDescribeUDBInstanceBackupStateRequest() *DescribeUDBInstanceBackupStateRequest {
req := &DescribeUDBInstanceBackupStateRequest{}
// 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
}
// DescribeUDBInstanceBackupState - 获取UDB实例备份状态
func (c *UDBClient) DescribeUDBInstanceBackupState(req *DescribeUDBInstanceBackupStateRequest) (*DescribeUDBInstanceBackupStateResponse, error) {
var err error
var res DescribeUDBInstanceBackupStateResponse
err = c.Client.InvokeAction("DescribeUDBInstanceBackupState", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}