-
Notifications
You must be signed in to change notification settings - Fork 38
/
apis.go
193 lines (140 loc) · 5.1 KB
/
apis.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
// Code is generated by ucloud-model, DO NOT EDIT IT.
package urocketmq
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// URocketMQ API Schema
// CreateURocketMQGroupRequest is request schema for CreateURocketMQGroup action
type CreateURocketMQGroupRequest struct {
request.CommonBase
// [公共参数] 项目ID。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"true"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// Group 名称,支持大小写字母、数字及-, _ ,长度1~36
Name *string `required:"true"`
// Group 描述.
Remark *string `required:"false"`
// Service ID
ServiceId *string `required:"true"`
}
// CreateURocketMQGroupResponse is response schema for CreateURocketMQGroup action
type CreateURocketMQGroupResponse struct {
response.CommonBase
// 新建 Group 的 ID
GroupId string
// 返回信息
Message string
}
// NewCreateURocketMQGroupRequest will create request of CreateURocketMQGroup action.
func (c *URocketMQClient) NewCreateURocketMQGroupRequest() *CreateURocketMQGroupRequest {
req := &CreateURocketMQGroupRequest{}
// 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
}
/*
API: CreateURocketMQGroup
创建一个 Group, 如果同名 Group 在当前 Service 中已存在, 则会失败.
*/
func (c *URocketMQClient) CreateURocketMQGroup(req *CreateURocketMQGroupRequest) (*CreateURocketMQGroupResponse, error) {
var err error
var res CreateURocketMQGroupResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateURocketMQGroup", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DeleteURocketMQGroupRequest is request schema for DeleteURocketMQGroup action
type DeleteURocketMQGroupRequest struct {
request.CommonBase
// [公共参数] 项目ID。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"true"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// Group名称
GroupName *string `required:"true"`
// Service ID
ServiceId *string `required:"true"`
}
// DeleteURocketMQGroupResponse is response schema for DeleteURocketMQGroup action
type DeleteURocketMQGroupResponse struct {
response.CommonBase
// 返回信息
Message string
}
// NewDeleteURocketMQGroupRequest will create request of DeleteURocketMQGroup action.
func (c *URocketMQClient) NewDeleteURocketMQGroupRequest() *DeleteURocketMQGroupRequest {
req := &DeleteURocketMQGroupRequest{}
// 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
}
/*
API: DeleteURocketMQGroup
删除一个已存在的 Group
*/
func (c *URocketMQClient) DeleteURocketMQGroup(req *DeleteURocketMQGroupRequest) (*DeleteURocketMQGroupResponse, error) {
var err error
var res DeleteURocketMQGroupResponse
reqCopier := *req
err = c.Client.InvokeAction("DeleteURocketMQGroup", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// ListURocketMQGroupRequest is request schema for ListURocketMQGroup action
type ListURocketMQGroupRequest struct {
request.CommonBase
// [公共参数] 项目ID。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"true"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// 最多返回的条目数量, (0, 1000], 默认 50 条
Limit *int `required:"false"`
// 查询起始位置, [0, ∞)
Offset *int `required:"false"`
// Service ID
ServiceId *string `required:"true"`
}
// ListURocketMQGroupResponse is response schema for ListURocketMQGroup action
type ListURocketMQGroupResponse struct {
response.CommonBase
// Group列表信息
GroupList []GroupBaseInfo
// 返回信息
Message string
// 记录总数
TotalCount int
}
// NewListURocketMQGroupRequest will create request of ListURocketMQGroup action.
func (c *URocketMQClient) NewListURocketMQGroupRequest() *ListURocketMQGroupRequest {
req := &ListURocketMQGroupRequest{}
// 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
}
/*
API: ListURocketMQGroup
获取一个 RocketMQ 服务下的所有 Group
*/
func (c *URocketMQClient) ListURocketMQGroup(req *ListURocketMQGroupRequest) (*ListURocketMQGroupResponse, error) {
var err error
var res ListURocketMQGroupResponse
reqCopier := *req
err = c.Client.InvokeAction("ListURocketMQGroup", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}