-
Notifications
You must be signed in to change notification settings - Fork 38
/
create_udbinstance_by_recovery.go
74 lines (54 loc) · 2.19 KB
/
create_udbinstance_by_recovery.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
//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 CreateUDBInstanceByRecovery
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// CreateUDBInstanceByRecoveryRequest is request schema for CreateUDBInstanceByRecovery action
type CreateUDBInstanceByRecoveryRequest struct {
request.CommonBase
// 可用区。参见 [可用区列表](../summary/regionlist.html)
Zone *string `required:"false"`
// 实例名称,至少6位
Name *string `required:"true"`
// 源实例的Id
SrcDBId *string `required:"true"`
// 恢复到某个时间点的时间戳(UTC时间格式,默认单位秒)
RecoveryTime *int `required:"true"`
// 指定是否是否使用SSD,默认使用主库的配置
UseSSD *bool `required:"false"`
// Year, Month, Dynamic,Trial,默认: Dynamic
ChargeType *string `required:"false"`
// 购买时长,默认值1
Quantity *int `required:"false"`
// 专区的Id
UDBCId *string `required:"false"`
// 使用的代金券id
CouponId *string `required:"false"`
}
// CreateUDBInstanceByRecoveryResponse is response schema for CreateUDBInstanceByRecovery action
type CreateUDBInstanceByRecoveryResponse struct {
response.CommonBase
// db实例id
DBId string
}
// NewCreateUDBInstanceByRecoveryRequest will create request of CreateUDBInstanceByRecovery action.
func (c *UDBClient) NewCreateUDBInstanceByRecoveryRequest() *CreateUDBInstanceByRecoveryRequest {
req := &CreateUDBInstanceByRecoveryRequest{}
// 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(false)
return req
}
// CreateUDBInstanceByRecovery - 创建db,将新创建的db恢复到指定db某个指定时间点
func (c *UDBClient) CreateUDBInstanceByRecovery(req *CreateUDBInstanceByRecoveryRequest) (*CreateUDBInstanceByRecoveryResponse, error) {
var err error
var res CreateUDBInstanceByRecoveryResponse
err = c.client.InvokeAction("CreateUDBInstanceByRecovery", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}