forked from TencentCloud/tencentcloud-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.go
494 lines (433 loc) · 15.1 KB
/
client.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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
// Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package v20190718
import (
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common"
tchttp "github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/http"
"github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common/profile"
)
const APIVersion = "2019-07-18"
type Client struct {
common.Client
}
// Deprecated
func NewClientWithSecretId(secretId, secretKey, region string) (client *Client, err error) {
cpf := profile.NewClientProfile()
client = &Client{}
client.Init(region).WithSecretId(secretId, secretKey).WithProfile(cpf)
return
}
func NewClient(credential *common.Credential, region string, clientProfile *profile.ClientProfile) (client *Client, err error) {
client = &Client{}
client.Init(region).
WithCredential(credential).
WithProfile(clientProfile)
return
}
func NewCreateAccessGroupRequest() (request *CreateAccessGroupRequest) {
request = &CreateAccessGroupRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "CreateAccessGroup")
return
}
func NewCreateAccessGroupResponse() (response *CreateAccessGroupResponse) {
response = &CreateAccessGroupResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 创建权限组。
func (c *Client) CreateAccessGroup(request *CreateAccessGroupRequest) (response *CreateAccessGroupResponse, err error) {
if request == nil {
request = NewCreateAccessGroupRequest()
}
response = NewCreateAccessGroupResponse()
err = c.Send(request, response)
return
}
func NewCreateAccessRulesRequest() (request *CreateAccessRulesRequest) {
request = &CreateAccessRulesRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "CreateAccessRules")
return
}
func NewCreateAccessRulesResponse() (response *CreateAccessRulesResponse) {
response = &CreateAccessRulesResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 批量创建权限规则,权限规则ID和创建时间无需填写。
func (c *Client) CreateAccessRules(request *CreateAccessRulesRequest) (response *CreateAccessRulesResponse, err error) {
if request == nil {
request = NewCreateAccessRulesRequest()
}
response = NewCreateAccessRulesResponse()
err = c.Send(request, response)
return
}
func NewCreateFileSystemRequest() (request *CreateFileSystemRequest) {
request = &CreateFileSystemRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "CreateFileSystem")
return
}
func NewCreateFileSystemResponse() (response *CreateFileSystemResponse) {
response = &CreateFileSystemResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 创建文件系统(异步)。
func (c *Client) CreateFileSystem(request *CreateFileSystemRequest) (response *CreateFileSystemResponse, err error) {
if request == nil {
request = NewCreateFileSystemRequest()
}
response = NewCreateFileSystemResponse()
err = c.Send(request, response)
return
}
func NewCreateMountPointRequest() (request *CreateMountPointRequest) {
request = &CreateMountPointRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "CreateMountPoint")
return
}
func NewCreateMountPointResponse() (response *CreateMountPointResponse) {
response = &CreateMountPointResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 创建文件系统挂载点,仅限于创建成功的文件系统。
func (c *Client) CreateMountPoint(request *CreateMountPointRequest) (response *CreateMountPointResponse, err error) {
if request == nil {
request = NewCreateMountPointRequest()
}
response = NewCreateMountPointResponse()
err = c.Send(request, response)
return
}
func NewDeleteAccessGroupRequest() (request *DeleteAccessGroupRequest) {
request = &DeleteAccessGroupRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DeleteAccessGroup")
return
}
func NewDeleteAccessGroupResponse() (response *DeleteAccessGroupResponse) {
response = &DeleteAccessGroupResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 删除权限组。
func (c *Client) DeleteAccessGroup(request *DeleteAccessGroupRequest) (response *DeleteAccessGroupResponse, err error) {
if request == nil {
request = NewDeleteAccessGroupRequest()
}
response = NewDeleteAccessGroupResponse()
err = c.Send(request, response)
return
}
func NewDeleteAccessRulesRequest() (request *DeleteAccessRulesRequest) {
request = &DeleteAccessRulesRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DeleteAccessRules")
return
}
func NewDeleteAccessRulesResponse() (response *DeleteAccessRulesResponse) {
response = &DeleteAccessRulesResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 批量删除权限规则。
func (c *Client) DeleteAccessRules(request *DeleteAccessRulesRequest) (response *DeleteAccessRulesResponse, err error) {
if request == nil {
request = NewDeleteAccessRulesRequest()
}
response = NewDeleteAccessRulesResponse()
err = c.Send(request, response)
return
}
func NewDeleteFileSystemRequest() (request *DeleteFileSystemRequest) {
request = &DeleteFileSystemRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DeleteFileSystem")
return
}
func NewDeleteFileSystemResponse() (response *DeleteFileSystemResponse) {
response = &DeleteFileSystemResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 删除文件系统,不允许删除非空文件系统。
func (c *Client) DeleteFileSystem(request *DeleteFileSystemRequest) (response *DeleteFileSystemResponse, err error) {
if request == nil {
request = NewDeleteFileSystemRequest()
}
response = NewDeleteFileSystemResponse()
err = c.Send(request, response)
return
}
func NewDeleteMountPointRequest() (request *DeleteMountPointRequest) {
request = &DeleteMountPointRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DeleteMountPoint")
return
}
func NewDeleteMountPointResponse() (response *DeleteMountPointResponse) {
response = &DeleteMountPointResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 删除挂载点。
func (c *Client) DeleteMountPoint(request *DeleteMountPointRequest) (response *DeleteMountPointResponse, err error) {
if request == nil {
request = NewDeleteMountPointRequest()
}
response = NewDeleteMountPointResponse()
err = c.Send(request, response)
return
}
func NewDescribeAccessGroupsRequest() (request *DescribeAccessGroupsRequest) {
request = &DescribeAccessGroupsRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeAccessGroups")
return
}
func NewDescribeAccessGroupsResponse() (response *DescribeAccessGroupsResponse) {
response = &DescribeAccessGroupsResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 查看权限组列表。
func (c *Client) DescribeAccessGroups(request *DescribeAccessGroupsRequest) (response *DescribeAccessGroupsResponse, err error) {
if request == nil {
request = NewDescribeAccessGroupsRequest()
}
response = NewDescribeAccessGroupsResponse()
err = c.Send(request, response)
return
}
func NewDescribeAccessRulesRequest() (request *DescribeAccessRulesRequest) {
request = &DescribeAccessRulesRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeAccessRules")
return
}
func NewDescribeAccessRulesResponse() (response *DescribeAccessRulesResponse) {
response = &DescribeAccessRulesResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 通过权限组ID查看权限规则列表。
func (c *Client) DescribeAccessRules(request *DescribeAccessRulesRequest) (response *DescribeAccessRulesResponse, err error) {
if request == nil {
request = NewDescribeAccessRulesRequest()
}
response = NewDescribeAccessRulesResponse()
err = c.Send(request, response)
return
}
func NewDescribeFileSystemRequest() (request *DescribeFileSystemRequest) {
request = &DescribeFileSystemRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeFileSystem")
return
}
func NewDescribeFileSystemResponse() (response *DescribeFileSystemResponse) {
response = &DescribeFileSystemResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 查看文件系统详细信息。
func (c *Client) DescribeFileSystem(request *DescribeFileSystemRequest) (response *DescribeFileSystemResponse, err error) {
if request == nil {
request = NewDescribeFileSystemRequest()
}
response = NewDescribeFileSystemResponse()
err = c.Send(request, response)
return
}
func NewDescribeFileSystemsRequest() (request *DescribeFileSystemsRequest) {
request = &DescribeFileSystemsRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeFileSystems")
return
}
func NewDescribeFileSystemsResponse() (response *DescribeFileSystemsResponse) {
response = &DescribeFileSystemsResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 查看文件系统列表。
func (c *Client) DescribeFileSystems(request *DescribeFileSystemsRequest) (response *DescribeFileSystemsResponse, err error) {
if request == nil {
request = NewDescribeFileSystemsRequest()
}
response = NewDescribeFileSystemsResponse()
err = c.Send(request, response)
return
}
func NewDescribeMountPointRequest() (request *DescribeMountPointRequest) {
request = &DescribeMountPointRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeMountPoint")
return
}
func NewDescribeMountPointResponse() (response *DescribeMountPointResponse) {
response = &DescribeMountPointResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 查看挂载点详细信息。
func (c *Client) DescribeMountPoint(request *DescribeMountPointRequest) (response *DescribeMountPointResponse, err error) {
if request == nil {
request = NewDescribeMountPointRequest()
}
response = NewDescribeMountPointResponse()
err = c.Send(request, response)
return
}
func NewDescribeMountPointsRequest() (request *DescribeMountPointsRequest) {
request = &DescribeMountPointsRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "DescribeMountPoints")
return
}
func NewDescribeMountPointsResponse() (response *DescribeMountPointsResponse) {
response = &DescribeMountPointsResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 通过文件系统ID或者权限组ID查看挂载点列表。
func (c *Client) DescribeMountPoints(request *DescribeMountPointsRequest) (response *DescribeMountPointsResponse, err error) {
if request == nil {
request = NewDescribeMountPointsRequest()
}
response = NewDescribeMountPointsResponse()
err = c.Send(request, response)
return
}
func NewModifyAccessGroupRequest() (request *ModifyAccessGroupRequest) {
request = &ModifyAccessGroupRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "ModifyAccessGroup")
return
}
func NewModifyAccessGroupResponse() (response *ModifyAccessGroupResponse) {
response = &ModifyAccessGroupResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 修改权限组属性。
func (c *Client) ModifyAccessGroup(request *ModifyAccessGroupRequest) (response *ModifyAccessGroupResponse, err error) {
if request == nil {
request = NewModifyAccessGroupRequest()
}
response = NewModifyAccessGroupResponse()
err = c.Send(request, response)
return
}
func NewModifyAccessRulesRequest() (request *ModifyAccessRulesRequest) {
request = &ModifyAccessRulesRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "ModifyAccessRules")
return
}
func NewModifyAccessRulesResponse() (response *ModifyAccessRulesResponse) {
response = &ModifyAccessRulesResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 批量修改权限规则属性,需要指定权限规则ID。
func (c *Client) ModifyAccessRules(request *ModifyAccessRulesRequest) (response *ModifyAccessRulesResponse, err error) {
if request == nil {
request = NewModifyAccessRulesRequest()
}
response = NewModifyAccessRulesResponse()
err = c.Send(request, response)
return
}
func NewModifyFileSystemRequest() (request *ModifyFileSystemRequest) {
request = &ModifyFileSystemRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "ModifyFileSystem")
return
}
func NewModifyFileSystemResponse() (response *ModifyFileSystemResponse) {
response = &ModifyFileSystemResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 修改文件系统属性,仅限于创建成功的文件系统。
func (c *Client) ModifyFileSystem(request *ModifyFileSystemRequest) (response *ModifyFileSystemResponse, err error) {
if request == nil {
request = NewModifyFileSystemRequest()
}
response = NewModifyFileSystemResponse()
err = c.Send(request, response)
return
}
func NewModifyMountPointRequest() (request *ModifyMountPointRequest) {
request = &ModifyMountPointRequest{
BaseRequest: &tchttp.BaseRequest{},
}
request.Init().WithApiInfo("chdfs", APIVersion, "ModifyMountPoint")
return
}
func NewModifyMountPointResponse() (response *ModifyMountPointResponse) {
response = &ModifyMountPointResponse{
BaseResponse: &tchttp.BaseResponse{},
}
return
}
// 修改挂载点属性。
func (c *Client) ModifyMountPoint(request *ModifyMountPointRequest) (response *ModifyMountPointResponse, err error) {
if request == nil {
request = NewModifyMountPointRequest()
}
response = NewModifyMountPointResponse()
err = c.Send(request, response)
return
}