-
Notifications
You must be signed in to change notification settings - Fork 38
/
create_udbreplication_instance.go
68 lines (50 loc) · 2.1 KB
/
create_udbreplication_instance.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 CreateUDBReplicationInstance
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// CreateUDBReplicationInstanceRequest is request schema for CreateUDBReplicationInstance action
type CreateUDBReplicationInstanceRequest struct {
request.CommonBase
// 可用区。参见 [可用区列表](../summary/regionlist.html)
Zone *string `required:"false"`
// primary节点的DBId,该值可以通过DescribeUDBInstance获取
SrcId *string `required:"true"`
// 实例名称,至少6位
Name *string `required:"true"`
// 端口号,默认27017,取值范围3306至65535。
Port *int `required:"false"`
// 是否是仲裁节点,默认false,仲裁节点按最小机型创建
IsArbiter *bool `required:"false"`
// 是否使用SSD,默认不使用
UseSSD *bool `required:"false"`
// 使用的代金券id
CouponId *string `required:"false"`
}
// CreateUDBReplicationInstanceResponse is response schema for CreateUDBReplicationInstance action
type CreateUDBReplicationInstanceResponse struct {
response.CommonBase
// 创建从节点的DBId
DBId string
}
// NewCreateUDBReplicationInstanceRequest will create request of CreateUDBReplicationInstance action.
func (c *UDBClient) NewCreateUDBReplicationInstanceRequest() *CreateUDBReplicationInstanceRequest {
req := &CreateUDBReplicationInstanceRequest{}
// 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
}
// CreateUDBReplicationInstance - 创建MongoDB的副本节点(包括仲裁)
func (c *UDBClient) CreateUDBReplicationInstance(req *CreateUDBReplicationInstanceRequest) (*CreateUDBReplicationInstanceResponse, error) {
var err error
var res CreateUDBReplicationInstanceResponse
err = c.client.InvokeAction("CreateUDBReplicationInstance", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}