-
Notifications
You must be signed in to change notification settings - Fork 38
/
create_udbparam_group.go
71 lines (52 loc) · 2.38 KB
/
create_udbparam_group.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
//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 CreateUDBParamGroup
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// CreateUDBParamGroupRequest is request schema for CreateUDBParamGroup action
type CreateUDBParamGroupRequest 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"`
// 新配置参数组名称
GroupName *string `required:"true"`
// 参数组描述
Description *string `required:"true"`
// 源参数组id
SrcGroupId *int `required:"true"`
// DB类型id,mysql/mongodb/postgesql按版本细分 1:mysql-5.1,2:mysql-5.5,3:percona-5.5,4:mysql-5.6,5:percona-5.6,6:mysql-5.7,7:percona-5.7,8:mariadb-10.0,9:mongodb-2.4,10:mongodb-2.6,11:mongodb-3.0,12:mongodb-3.2,13:postgresql-9.4,14:postgresql-9.6
DBTypeId *string `required:"true"`
// 是否是地域级别的配置文件,默认是false
RegionFlag *bool `required:"false"`
}
// CreateUDBParamGroupResponse is response schema for CreateUDBParamGroup action
type CreateUDBParamGroupResponse struct {
response.CommonBase
// 新配置参数组id
GroupId int
}
// NewCreateUDBParamGroupRequest will create request of CreateUDBParamGroup action.
func (c *UDBClient) NewCreateUDBParamGroupRequest() *CreateUDBParamGroupRequest {
req := &CreateUDBParamGroupRequest{}
// 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
}
// CreateUDBParamGroup - 从已有配置文件创建新配置文件
func (c *UDBClient) CreateUDBParamGroup(req *CreateUDBParamGroupRequest) (*CreateUDBParamGroupResponse, error) {
var err error
var res CreateUDBParamGroupResponse
err = c.client.InvokeAction("CreateUDBParamGroup", req, &res)
if err != nil {
return &res, err
}
return &res, nil
}