-
Notifications
You must be signed in to change notification settings - Fork 38
/
apis.go
3736 lines (2699 loc) · 115 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
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
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code is generated by ucloud-model, DO NOT EDIT IT.
package udb
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UDB API Schema
// BackupUDBInstanceRequest is request schema for BackupUDBInstance action
type BackupUDBInstanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 使用的备份方式。(快照备份即物理备份。注意只有SSD版本的mysql实例支持设置为snapshot)
BackupMethod *string `required:"false"`
// 备份名称
BackupName *string `required:"true"`
// 备份黑名单列表,以 ; 分隔。注意:只有逻辑备份下备份黑名单才生效,快照备份备份黑名单下无效
Blacklist *string `required:"false"`
// DB实例Id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
// true表示逻辑备份时是使用 --force 参数,false表示不使用 --force 参数。物理备份此参数无效。
ForceBackup *bool `required:"false"`
// 是否使用黑名单备份,默认false
UseBlacklist *bool `required:"false"`
}
// BackupUDBInstanceResponse is response schema for BackupUDBInstance action
type BackupUDBInstanceResponse struct {
response.CommonBase
}
// NewBackupUDBInstanceRequest will create request of BackupUDBInstance action.
func (c *UDBClient) NewBackupUDBInstanceRequest() *BackupUDBInstanceRequest {
req := &BackupUDBInstanceRequest{}
// 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: BackupUDBInstance
备份UDB实例
*/
func (c *UDBClient) BackupUDBInstance(req *BackupUDBInstanceRequest) (*BackupUDBInstanceResponse, error) {
var err error
var res BackupUDBInstanceResponse
reqCopier := *req
err = c.Client.InvokeAction("BackupUDBInstance", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// BackupUDBInstanceBinlogRequest is request schema for BackupUDBInstanceBinlog action
type BackupUDBInstanceBinlogRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 需要备份文件,可通过DescribeUDBInstanceBinlog获得 如果要传入多个文件名,以空格键分割,用单引号包含.
BackupFile *string `required:"true"`
// DB备份文件名称
BackupName *string `required:"false"`
// DB实例Id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
}
// BackupUDBInstanceBinlogResponse is response schema for BackupUDBInstanceBinlog action
type BackupUDBInstanceBinlogResponse struct {
response.CommonBase
}
// NewBackupUDBInstanceBinlogRequest will create request of BackupUDBInstanceBinlog action.
func (c *UDBClient) NewBackupUDBInstanceBinlogRequest() *BackupUDBInstanceBinlogRequest {
req := &BackupUDBInstanceBinlogRequest{}
// 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: BackupUDBInstanceBinlog
备份UDB指定时间段的binlog列表
*/
func (c *UDBClient) BackupUDBInstanceBinlog(req *BackupUDBInstanceBinlogRequest) (*BackupUDBInstanceBinlogResponse, error) {
var err error
var res BackupUDBInstanceBinlogResponse
reqCopier := *req
err = c.Client.InvokeAction("BackupUDBInstanceBinlog", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// BackupUDBInstanceErrorLogRequest is request schema for BackupUDBInstanceErrorLog action
type BackupUDBInstanceErrorLogRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 备份名称
BackupName *string `required:"true"`
// DB实例Id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
}
// BackupUDBInstanceErrorLogResponse is response schema for BackupUDBInstanceErrorLog action
type BackupUDBInstanceErrorLogResponse struct {
response.CommonBase
}
// NewBackupUDBInstanceErrorLogRequest will create request of BackupUDBInstanceErrorLog action.
func (c *UDBClient) NewBackupUDBInstanceErrorLogRequest() *BackupUDBInstanceErrorLogRequest {
req := &BackupUDBInstanceErrorLogRequest{}
// 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: BackupUDBInstanceErrorLog
备份UDB指定时间段的errorlog
*/
func (c *UDBClient) BackupUDBInstanceErrorLog(req *BackupUDBInstanceErrorLogRequest) (*BackupUDBInstanceErrorLogResponse, error) {
var err error
var res BackupUDBInstanceErrorLogResponse
reqCopier := *req
err = c.Client.InvokeAction("BackupUDBInstanceErrorLog", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// BackupUDBInstanceSlowLogRequest is request schema for BackupUDBInstanceSlowLog action
type BackupUDBInstanceSlowLogRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// 备份文件名称
BackupName *string `required:"true"`
// 过滤条件:起始时间(时间戳)
BeginTime *int `required:"true"`
// DB实例Id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
// 过滤条件:结束时间(时间戳)
EndTime *int `required:"true"`
}
// BackupUDBInstanceSlowLogResponse is response schema for BackupUDBInstanceSlowLog action
type BackupUDBInstanceSlowLogResponse struct {
response.CommonBase
}
// NewBackupUDBInstanceSlowLogRequest will create request of BackupUDBInstanceSlowLog action.
func (c *UDBClient) NewBackupUDBInstanceSlowLogRequest() *BackupUDBInstanceSlowLogRequest {
req := &BackupUDBInstanceSlowLogRequest{}
// 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: BackupUDBInstanceSlowLog
备份UDB指定时间段的slowlog分析结果
*/
func (c *UDBClient) BackupUDBInstanceSlowLog(req *BackupUDBInstanceSlowLogRequest) (*BackupUDBInstanceSlowLogResponse, error) {
var err error
var res BackupUDBInstanceSlowLogResponse
reqCopier := *req
err = c.Client.InvokeAction("BackupUDBInstanceSlowLog", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// ChangeUDBParamGroupRequest is request schema for ChangeUDBParamGroup action
type ChangeUDBParamGroupRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// DB实例Id
DBId *string `required:"true"`
// 参数组Id
GroupId *string `required:"true"`
}
// ChangeUDBParamGroupResponse is response schema for ChangeUDBParamGroup action
type ChangeUDBParamGroupResponse struct {
response.CommonBase
}
// NewChangeUDBParamGroupRequest will create request of ChangeUDBParamGroup action.
func (c *UDBClient) NewChangeUDBParamGroupRequest() *ChangeUDBParamGroupRequest {
req := &ChangeUDBParamGroupRequest{}
// 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: ChangeUDBParamGroup
修改配置文件
*/
func (c *UDBClient) ChangeUDBParamGroup(req *ChangeUDBParamGroupRequest) (*ChangeUDBParamGroupResponse, error) {
var err error
var res ChangeUDBParamGroupResponse
reqCopier := *req
err = c.Client.InvokeAction("ChangeUDBParamGroup", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CheckRecoverUDBInstanceRequest is request schema for CheckRecoverUDBInstance action
type CheckRecoverUDBInstanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 源实例的Id
SrcDBId *string `required:"true"`
}
// CheckRecoverUDBInstanceResponse is response schema for CheckRecoverUDBInstance action
type CheckRecoverUDBInstanceResponse struct {
response.CommonBase
// 核查成功返回值为可以回档到的最近时刻,核查失败不返回
LastestTime int
}
// NewCheckRecoverUDBInstanceRequest will create request of CheckRecoverUDBInstance action.
func (c *UDBClient) NewCheckRecoverUDBInstanceRequest() *CheckRecoverUDBInstanceRequest {
req := &CheckRecoverUDBInstanceRequest{}
// 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: CheckRecoverUDBInstance
核查db是否可以使用回档功能
*/
func (c *UDBClient) CheckRecoverUDBInstance(req *CheckRecoverUDBInstanceRequest) (*CheckRecoverUDBInstanceResponse, error) {
var err error
var res CheckRecoverUDBInstanceResponse
reqCopier := *req
err = c.Client.InvokeAction("CheckRecoverUDBInstance", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CheckUDBInstanceToHAAllowanceRequest is request schema for CheckUDBInstanceToHAAllowance action
type CheckUDBInstanceToHAAllowanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// 实例的Id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
}
// CheckUDBInstanceToHAAllowanceResponse is response schema for CheckUDBInstanceToHAAllowance action
type CheckUDBInstanceToHAAllowanceResponse struct {
response.CommonBase
// Yes ,No ,Yes即可以升级,No为不可以升级
Allowance string
}
// NewCheckUDBInstanceToHAAllowanceRequest will create request of CheckUDBInstanceToHAAllowance action.
func (c *UDBClient) NewCheckUDBInstanceToHAAllowanceRequest() *CheckUDBInstanceToHAAllowanceRequest {
req := &CheckUDBInstanceToHAAllowanceRequest{}
// 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: CheckUDBInstanceToHAAllowance
核查db是否可以升级为高可用
*/
func (c *UDBClient) CheckUDBInstanceToHAAllowance(req *CheckUDBInstanceToHAAllowanceRequest) (*CheckUDBInstanceToHAAllowanceResponse, error) {
var err error
var res CheckUDBInstanceToHAAllowanceResponse
reqCopier := *req
err = c.Client.InvokeAction("CheckUDBInstanceToHAAllowance", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// ClearUDBLogRequest is request schema for ClearUDBLog action
type ClearUDBLogRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 删除时间点(至少前一天)之前log,采用时间戳(秒),默认当 前时间点前一天
BeforeTime *int `required:"false"`
// DB实例的id,该值可以通过DescribeUDBInstance获取
DBId *string `required:"true"`
// 日志类型,10-error(暂不支持)、20-slow(暂不支持 )、30-binlog
LogType *int `required:"true"`
}
// ClearUDBLogResponse is response schema for ClearUDBLog action
type ClearUDBLogResponse struct {
response.CommonBase
}
// NewClearUDBLogRequest will create request of ClearUDBLog action.
func (c *UDBClient) NewClearUDBLogRequest() *ClearUDBLogRequest {
req := &ClearUDBLogRequest{}
// 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: ClearUDBLog
清除UDB实例的log
*/
func (c *UDBClient) ClearUDBLog(req *ClearUDBLogRequest) (*ClearUDBLogResponse, error) {
var err error
var res ClearUDBLogResponse
reqCopier := *req
err = c.Client.InvokeAction("ClearUDBLog", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateMongoDBReplicaSetRequest is request schema for CreateMongoDBReplicaSet action
type CreateMongoDBReplicaSetRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"true"`
// 管理员密码
AdminPassword *string `required:"true"`
// 管理员帐户名,默认root
AdminUser *string `required:"false"`
// 备份策略,每周备份数量,默认7次
BackupCount *int `required:"false"`
// 备份策略,备份时间间隔,单位小时计,默认24小时
BackupDuration *int `required:"false"`
// 备份策略,备份开始时间,单位小时计,默认1点
BackupTime *int `required:"false"`
// cpu核数
CPU *int `required:"false"`
// Year, Month, Dynamic,Trial,默认: Month
ChargeType *string `required:"false"`
// 所属分片集群的ID
ClusterId *string `required:"false"`
// CouponId.0 代表第一个代金券id,对于传入多个代金券id,后面为 CouponId.1, CouponId.2 以此类推
CouponId []string `required:"false"`
// DB类型id对应的字符串形式(例如:mongodb-2.6)注意:当前仅支持mongodb
DBTypeId *string `required:"true"`
// 磁盘空间(GB), 暂时支持20G - 3000G
DiskSpace *int `required:"true"`
// UDB数据库机型
InstanceType *string `required:"false"`
// 内存限制(MB),目前支持以下几档 1000M/2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M
MemoryLimit *int `required:"true"`
// PrimaryDB实例名称,至少6位
Name *string `required:"true"`
// DB实例使用的配置参数组id
ParamGroupId *int `required:"true"`
// 端口号
Port *int `required:"true"`
// 购买时长(N个月),默认值1个月。如果为0,代表购买到月底。
Quantity *int `required:"false"`
// SSD类型,可选值为"SATA"、"PCI-E",如果UseSSD为true ,则必选
SSDType *string `required:"false"`
// 子网ID
SubnetId *string `required:"false"`
// 是否使用SSD,默认为true
UseSSD *bool `required:"false"`
// VPC的ID
VPCId *string `required:"false"`
}
// CreateMongoDBReplicaSetResponse is response schema for CreateMongoDBReplicaSet action
type CreateMongoDBReplicaSetResponse struct {
response.CommonBase
// 操作名称
Action string
// 返回所有副本集成员的Id
DBIds []string
// 返回码
RetCode int
}
// NewCreateMongoDBReplicaSetRequest will create request of CreateMongoDBReplicaSet action.
func (c *UDBClient) NewCreateMongoDBReplicaSetRequest() *CreateMongoDBReplicaSetRequest {
req := &CreateMongoDBReplicaSetRequest{}
// 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: CreateMongoDBReplicaSet
一键创建DB副本集
*/
func (c *UDBClient) CreateMongoDBReplicaSet(req *CreateMongoDBReplicaSetRequest) (*CreateMongoDBReplicaSetResponse, error) {
var err error
var res CreateMongoDBReplicaSetResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateMongoDBReplicaSet", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateUDBInstanceRequest is request schema for CreateUDBInstance action
type CreateUDBInstanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"true"`
// 管理员密码
AdminPassword *string `required:"true"`
// 管理员帐户名,默认root
AdminUser *string `required:"false"`
// 备份策略,每周备份数量,默认7次
BackupCount *int `required:"false"`
// 备份策略,备份时间间隔,单位小时计,默认24小时
BackupDuration *int `required:"false"`
// 备份id,如果指定,则表明从备份恢复实例
BackupId *int `required:"false"`
// 备份策略,备份开始时间,单位小时计,默认1点
BackupTime *int `required:"false"`
// 跨可用区高可用备库所在可用区,参见 [可用区列表](../summary/regionlist.html)
BackupZone *string `required:"false"`
// cpu核数
CPU *int `required:"false"`
// Year, Month, Dynamic,Trial,默认: Month
ChargeType *string `required:"false"`
// 当DB类型(DBTypeId)为mongodb时,需要指定mongo的角色,可选值为configsrv (配置节点),shardsrv (数据节点)
ClusterRole *string `required:"false"`
// 使用的代金券id
CouponId *string `required:"false"`
// 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,14:postgresql-10.4
DBTypeId *string `required:"true"`
// 是否开启异步高可用,默认不填,可置为true
DisableSemisync *bool `required:"false"`
// 磁盘空间(GB), 暂时支持20G - 32T
DiskSpace *int `required:"true"`
// 是否创建使用ipv6 资源, 默认为false, 或者不填, 创建ipv6为true
EnableIpV6 *bool `required:"false"`
// 高可用架构:1) haproxy(默认): 当前仅支持mysql。2) sentinel: 基于vip和哨兵节点的架构,当前支持mysql和pg。
HAArch *string `required:"false"`
// UDB实例模式类型, 可选值如下: "Normal": 普通版UDB实例 "HA": 高可用版UDB实例 默认是"Normal"
InstanceMode *string `required:"false"`
// 【该字段已废弃,请谨慎使用】
InstanceType *string `required:"false" deprecated:"true"`
// 内存限制(MB),目前支持以下几档 1000M/2000M/4000M/ 6000M/8000M/12000M/16000M/ 24000M/32000M/48000M/ 64000M/96000M/128000M/192000M/256000M/320000M
MemoryLimit *int `required:"true"`
// 实例名称,至少6位
Name *string `required:"true"`
// DB实例使用的配置参数组id
ParamGroupId *int `required:"true"`
// 端口号,mysql默认3306,mongodb默认27017,postgresql默认5432
Port *int `required:"true"`
// 购买时长,默认值1
Quantity *int `required:"false"`
// SSD类型,可选值为"SATA"、“NVMe”,如果UseSSD为true ,则必选
SSDType *string `required:"false"`
// 子网ID
SubnetId *string `required:"false"`
// 实例所在的业务组名称
Tag *string `required:"false"`
// 专区ID信息(如果这个参数存在这说明是在专区中创建DB)
UDBCId *string `required:"false"`
// 是否使用SSD,默认为true。目前主要可用区、海外机房、新机房只提供SSD资源,非SSD资源不再提供。
UseSSD *bool `required:"false"`
// VPC的ID
VPCId *string `required:"false"`
}
// CreateUDBInstanceResponse is response schema for CreateUDBInstance action
type CreateUDBInstanceResponse struct {
response.CommonBase
// BD实例id
DBId string
}
// NewCreateUDBInstanceRequest will create request of CreateUDBInstance action.
func (c *UDBClient) NewCreateUDBInstanceRequest() *CreateUDBInstanceRequest {
req := &CreateUDBInstanceRequest{}
// 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: CreateUDBInstance
创建UDB实例(包括创建mysql master节点、mongodb primary/configsvr节点和从备份恢复实例)
*/
func (c *UDBClient) CreateUDBInstance(req *CreateUDBInstanceRequest) (*CreateUDBInstanceResponse, error) {
var err error
var res CreateUDBInstanceResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateUDBInstance", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateUDBInstanceByRecoveryRequest is request schema for CreateUDBInstanceByRecovery action
type CreateUDBInstanceByRecoveryRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// Year, Month, Dynamic,Trial,默认: Dynamic
ChargeType *string `required:"false"`
// 使用的代金券id
CouponId *string `required:"false"`
// 是否创建使用ipv6 资源, 默认为false, 或者不填, 创建ipv6为true
EnableIpV6 *bool `required:"false"`
// 实例名称,至少6位
Name *string `required:"true"`
// 购买时长,默认值1
Quantity *int `required:"false"`
// 恢复到某个时间点的时间戳(UTC时间格式,默认单位秒)
RecoveryTime *int `required:"true"`
// 源实例的Id
SrcDBId *string `required:"true"`
// 子网ID
SubnetId *string `required:"false"`
// 专区的Id
UDBCId *string `required:"false"`
// 指定是否是否使用SSD,默认使用主库的配置
UseSSD *bool `required:"false"`
// VPC的ID
VPCId *string `required:"false"`
}
// CreateUDBInstanceByRecoveryResponse is response schema for CreateUDBInstanceByRecovery action
type CreateUDBInstanceByRecoveryResponse struct {
response.CommonBase
// db实例id
DBId string
}
// NewCreateUDBInstanceByRecoveryRequest will create request of CreateUDBInstanceByRecovery action.
func (c *UDBClient) NewCreateUDBInstanceByRecoveryRequest() *CreateUDBInstanceByRecoveryRequest {
req := &CreateUDBInstanceByRecoveryRequest{}
// 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: CreateUDBInstanceByRecovery
创建db,将新创建的db恢复到指定db某个指定时间点
*/
func (c *UDBClient) CreateUDBInstanceByRecovery(req *CreateUDBInstanceByRecoveryRequest) (*CreateUDBInstanceByRecoveryResponse, error) {
var err error
var res CreateUDBInstanceByRecoveryResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateUDBInstanceByRecovery", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateUDBParamGroupRequest is request schema for CreateUDBParamGroup action
type CreateUDBParamGroupRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `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"`
// 参数组描述
Description *string `required:"true"`
// 新配置参数组名称
GroupName *string `required:"true"`
// 是否是地域级别的配置文件,默认是false
RegionFlag *bool `required:"false"`
// 源参数组id
SrcGroupId *int `required:"true"`
}
// 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
}
/*
API: CreateUDBParamGroup
从已有配置文件创建新配置文件
*/
func (c *UDBClient) CreateUDBParamGroup(req *CreateUDBParamGroupRequest) (*CreateUDBParamGroupResponse, error) {
var err error
var res CreateUDBParamGroupResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateUDBParamGroup", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateUDBReplicationInstanceRequest is request schema for CreateUDBReplicationInstance action
type CreateUDBReplicationInstanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// 使用的代金券id
CouponId *string `required:"false"`
// 是否是仲裁节点,默认false,仲裁节点按最小机型创建
IsArbiter *bool `required:"false"`
// 实例名称,至少6位
Name *string `required:"true"`
// 端口号,默认27017,取值范围3306至65535。
Port *int `required:"false"`
// primary节点的DBId,该值可以通过DescribeUDBInstance获取
SrcId *string `required:"true"`
// 是否使用SSD,默认 为 true
UseSSD *bool `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
}
/*
API: CreateUDBReplicationInstance
创建MongoDB的副本节点(包括仲裁)
*/
func (c *UDBClient) CreateUDBReplicationInstance(req *CreateUDBReplicationInstanceRequest) (*CreateUDBReplicationInstanceResponse, error) {
var err error
var res CreateUDBReplicationInstanceResponse
reqCopier := *req
err = c.Client.InvokeAction("CreateUDBReplicationInstance", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreateUDBRouteInstanceRequest is request schema for CreateUDBRouteInstance action
type CreateUDBRouteInstanceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// Year, Month, Dynamic,Trial,默认: Month
ChargeType *string `required:"false"`
// 配置服务器的dbid,允许一个或者三个。
ConfigsvrId []string `required:"true"`
// 使用的代金券id
CouponId *string `required:"false"`
// DB类型id,mongodb按版本细分有1:mongodb-2.4,2:mongodb-2.6,3:mongodb-3.0,4:mongodb-3.2
DBTypeId *string `required:"true"`
// 磁盘空间(GB), 暂时支持20G - 500G
DiskSpace *int `required:"true"`
// 内存限制(MB),目前支持以下几档 600M/1500M/3000M /6000M/15000M/30000M
MemoryLimit *int `required:"true"`
// 实例名称,至少6位
Name *string `required:"true"`
// DB实例使用的配置参数组id
ParamGroupId *int `required:"true"`