-
Notifications
You must be signed in to change notification settings - Fork 38
/
update_udbinstance_slave_backup_switch.go
62 lines (46 loc) · 2.3 KB
/
update_udbinstance_slave_backup_switch.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
//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 UpdateUDBInstanceSlaveBackupSwitch
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UpdateUDBInstanceSlaveBackupSwitchRequest is request schema for UpdateUDBInstanceSlaveBackupSwitch action
type UpdateUDBInstanceSlaveBackupSwitchRequest 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"`
// 主库的Id
MasterDBId *string `required:"true"`
// 从库的备份开关,范围[0,1],0表示从库备份功能关闭,1 表示从库备份开关打开。
BackupSwitch *int `required:"true"`
// 从库的Id,如果从库备份开关设定为打开,则必须赋值。
SlaveDBId *string `required:"false"`
}
// UpdateUDBInstanceSlaveBackupSwitchResponse is response schema for UpdateUDBInstanceSlaveBackupSwitch action
type UpdateUDBInstanceSlaveBackupSwitchResponse struct {
response.CommonBase
}
// NewUpdateUDBInstanceSlaveBackupSwitchRequest will create request of UpdateUDBInstanceSlaveBackupSwitch action.
func (c *UDBClient) NewUpdateUDBInstanceSlaveBackupSwitchRequest() *UpdateUDBInstanceSlaveBackupSwitchRequest {
req := &UpdateUDBInstanceSlaveBackupSwitchRequest{}
// 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
}
// UpdateUDBInstanceSlaveBackupSwitch - 开启或者关闭UDB从库备份
func (c *UDBClient) UpdateUDBInstanceSlaveBackupSwitch(req *UpdateUDBInstanceSlaveBackupSwitchRequest) (*UpdateUDBInstanceSlaveBackupSwitchResponse, error) {
var err error
var res UpdateUDBInstanceSlaveBackupSwitchResponse
err = c.client.InvokeAction("UpdateUDBInstanceSlaveBackupSwitch", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}