-
Notifications
You must be signed in to change notification settings - Fork 38
/
apis.go
1439 lines (1040 loc) · 42.4 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 uphost
import (
"github.com/ucloud/ucloud-sdk-go/ucloud/request"
"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)
// UPHost API Schema
/*
CreatePHostParamNetworkInterfaceEIP is request schema for complex param
*/
type CreatePHostParamNetworkInterfaceEIP struct {
// 【若绑定EIP,此参数必填】弹性IP的外网带宽, 单位为Mbps. 共享带宽模式必须指定0M带宽, 非共享带宽模式必须指定非0Mbps带宽. 各地域非共享带宽的带宽范围如下: 流量计费[1-300],带宽计费[1-800]
Bandwidth *string `required:"false"`
// 当前EIP代金券id。请通过DescribeCoupon接口查询,或登录用户中心查看。
CouponId *string `required:"false"`
// 【若绑定EIP,此参数必填】弹性IP的线路。枚举值: 国际: International BGP: Bgp 各地域允许的线路参数如下: cn-sh1: Bgp cn-sh2: Bgp cn-gd: Bgp cn-bj1: Bgp cn-bj2: Bgp hk: International us-ca: International th-bkk: International kr-seoul:International us-ws:International ge-fra:International sg:International tw-kh:International.其他海外线路均为 International
OperatorName *string `required:"false"`
// 弹性IP的计费模式. 枚举值: "Traffic", 流量计费; "Bandwidth", 带宽计费; "ShareBandwidth",共享带宽模式. "Free":免费带宽模式,默认为 "Bandwidth"
PayMode *string `required:"false"`
// 绑定的共享带宽Id,仅当PayMode为ShareBandwidth时有效
ShareBandwidthId *string `required:"false"`
}
/*
CreatePHostParamDisks is request schema for complex param
*/
type CreatePHostParamDisks struct {
// 裸金属机型参数->云盘代金券id。不适用于系统盘。请通过DescribeCoupon接口查询,或登录用户中心查看
CouponId *string `required:"false"`
// 裸金属机型参数->是否是系统盘。枚举值: True,是系统盘。 False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
IsBoot *string `required:"false"`
// 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
Size *int `required:"false"`
// 裸金属机型参数->磁盘类型:枚举值:CLOUD_RSSD
Type *string `required:"false"`
}
/*
CreatePHostParamNetworkInterface is request schema for complex param
*/
type CreatePHostParamNetworkInterface struct {
//
EIP *CreatePHostParamNetworkInterfaceEIP `required:"false"`
}
// CreatePHostRequest is request schema for CreatePHost action
type CreatePHostRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 短期促销活动时所需参数
ActivityId *int `required:"false"`
// 计费模式,枚举值为:Year, 按年付费; Month,按月付费;默认按月付费
ChargeType *string `required:"false"`
// 网络环境,可选千兆:1G ,万兆:10G, 默认1G。智能网卡可以选择25G。
Cluster *string `required:"false"`
// 【该字段已废弃,请谨慎使用】
Count *int `required:"false" deprecated:"true"`
// 代金券
CouponId *string `required:"false"`
//
Disks []CreatePHostParamDisks `required:"false"`
// ImageId,可以通过接口 [DescribePHostImage](api/uphost-api/describe_phost_image.html)获取
ImageId *string `required:"true"`
// 物理机名称,默认为phost
Name *string `required:"false"`
//
NetworkInterface []CreatePHostParamNetworkInterface `required:"false"`
// 密码(密码需使用base64进行编码)
Password *string `required:"true"`
// 购买时长,1-10个月或1-10年;默认值为1。月付时,此参数传0,代表购买至月末,1代表整月。
Quantity *string `required:"false"`
// 本地盘和裸金属1.0需要的参数。Raid配置,默认Raid10 支持:Raid0、Raid1、Raid5、Raid10,NoRaid
Raid *string `required:"false"`
// 物理机备注,默认为空
Remark *string `required:"false"`
// 短期促销活动时所需参数
RuleId *int `required:"false"`
// 防火墙ID,默认:Web推荐防火墙。如何查询SecurityGroupId请参见 [DescribeFirewall](api/unet-api/describe_firewall.html)。
SecurityGroupId *string `required:"false"`
// 子网ID,不填为默认,VPC2.0下需要填写此字段。
SubnetId *string `required:"false"`
// 业务组,默认为default
Tag *string `required:"false"`
// 物理机类型,默认为:db-2(基础型-SAS-V3)
Type *string `required:"false"`
// VPC ID,不填为默认,VPC2.0下需要填写此字段。
VPCId *string `required:"false"`
// 指定内网ip创建
VpcIp *string `required:"false"`
}
// CreatePHostResponse is response schema for CreatePHost action
type CreatePHostResponse struct {
response.CommonBase
// PHost的资源ID数组
PHostId []string
}
// NewCreatePHostRequest will create request of CreatePHost action.
func (c *UPHostClient) NewCreatePHostRequest() *CreatePHostRequest {
req := &CreatePHostRequest{}
// 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: CreatePHost
指定数据中心,根据资源使用量创建指定数量的UPHost物理云主机实例。
*/
func (c *UPHostClient) CreatePHost(req *CreatePHostRequest) (*CreatePHostResponse, error) {
var err error
var res CreatePHostResponse
reqCopier := *req
err = c.Client.InvokeAction("CreatePHost", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// CreatePHostImageRequest is request schema for CreatePHostImage action
type CreatePHostImageRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 镜像描述
ImageDescription *string `required:"false"`
// 镜像名称
ImageName *string `required:"true"`
// UPHost实例ID
PHostId *string `required:"true"`
}
// CreatePHostImageResponse is response schema for CreatePHostImage action
type CreatePHostImageResponse struct {
response.CommonBase
// 镜像ID
ImageId string
}
// NewCreatePHostImageRequest will create request of CreatePHostImage action.
func (c *UPHostClient) NewCreatePHostImageRequest() *CreatePHostImageRequest {
req := &CreatePHostImageRequest{}
// 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: CreatePHostImage
创建裸金属2.0用户自定义镜像
*/
func (c *UPHostClient) CreatePHostImage(req *CreatePHostImageRequest) (*CreatePHostImageResponse, error) {
var err error
var res CreatePHostImageResponse
reqCopier := *req
err = c.Client.InvokeAction("CreatePHostImage", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribeBaremetalMachineTypeRequest is request schema for DescribeBaremetalMachineType action
type DescribeBaremetalMachineTypeRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 请求版本。仅支持v2,不传或传其他值表示请求旧版本
APIVersion *string `required:"false"`
// 具体机型。若不填写,则返回全部机型
Type *string `required:"false"`
}
// DescribeBaremetalMachineTypeResponse is response schema for DescribeBaremetalMachineType action
type DescribeBaremetalMachineTypeResponse struct {
response.CommonBase
// 机型列表,模型:PHostCloudMachineTypeSetV2,仅在入参Version=v2时返回
MachineTypes []PHostCloudMachineTypeSetV2
}
// NewDescribeBaremetalMachineTypeRequest will create request of DescribeBaremetalMachineType action.
func (c *UPHostClient) NewDescribeBaremetalMachineTypeRequest() *DescribeBaremetalMachineTypeRequest {
req := &DescribeBaremetalMachineTypeRequest{}
// 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: DescribeBaremetalMachineType
获取裸金属机型的详细描述信息
*/
func (c *UPHostClient) DescribeBaremetalMachineType(req *DescribeBaremetalMachineTypeRequest) (*DescribeBaremetalMachineTypeResponse, error) {
var err error
var res DescribeBaremetalMachineTypeResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribeBaremetalMachineType", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribePHostRequest is request schema for DescribePHost action
type DescribePHostRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"false"`
// 返回数据长度,默认为20
Limit *int `required:"false"`
// 数据偏移量,默认为0
Offset *int `required:"false"`
// PHost资源ID,若为空,则返回当前Region所有PHost。
PHostId []string `required:"false"`
// 要挂载的云盘id,过滤返回能被UDiskId挂载的云主机。目前主要针对rssd云盘使用
UDiskIdForAttachment *string `required:"false"`
// ULB使用参数,获取同VPC下机器信息。
VPCId *string `required:"false"`
}
// DescribePHostResponse is response schema for DescribePHost action
type DescribePHostResponse struct {
response.CommonBase
// PHost资源列表,参见 PHostSet
PHostSet []PHostSet
// 满足条件的PHost总数
TotalCount int
}
// NewDescribePHostRequest will create request of DescribePHost action.
func (c *UPHostClient) NewDescribePHostRequest() *DescribePHostRequest {
req := &DescribePHostRequest{}
// 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: DescribePHost
获取物理机详细信息
*/
func (c *UPHostClient) DescribePHost(req *DescribePHostRequest) (*DescribePHostResponse, error) {
var err error
var res DescribePHostResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribePHost", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribePHostImageRequest is request schema for DescribePHostImage action
type DescribePHostImageRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 机器的网络集群,MachineType传是必须传,默认25G
Cluster *string `required:"false"`
// 镜像ID
ImageId []string `required:"false"`
// 镜像类别,枚举值,Base是基础镜像;Custom是自制镜像。
ImageType *string `required:"false"`
// 返回数据长度,默认为20
Limit *int `required:"false"`
// 机器型号,只支持当前zone的展示机型
MachineType *string `required:"false"`
// 数据偏移量,默认为0
Offset *int `required:"false"`
}
// DescribePHostImageResponse is response schema for DescribePHostImage action
type DescribePHostImageResponse struct {
response.CommonBase
// 镜像列表 PHostImageSet
ImageSet []PHostImageSet
// 满足条件的镜像总数
TotalCount int
}
// NewDescribePHostImageRequest will create request of DescribePHostImage action.
func (c *UPHostClient) NewDescribePHostImageRequest() *DescribePHostImageRequest {
req := &DescribePHostImageRequest{}
// 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: DescribePHostImage
获取物理云主机镜像列表
*/
func (c *UPHostClient) DescribePHostImage(req *DescribePHostImageRequest) (*DescribePHostImageResponse, error) {
var err error
var res DescribePHostImageResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribePHostImage", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribePHostMachineTypeRequest is request schema for DescribePHostMachineType action
type DescribePHostMachineTypeRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"false"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"false"`
// 请求版本。仅支持v2,不传或传其他值表示请求旧版本
APIVersion *string `required:"false"`
// 具体机型。若不填写,则返回全部机型
Type *string `required:"false"`
}
// DescribePHostMachineTypeResponse is response schema for DescribePHostMachineType action
type DescribePHostMachineTypeResponse struct {
response.CommonBase
// 机型列表,模型:PHostCloudMachineTypeSetV2,仅在入参Version=v2时返回
MachineTypes []PHostCloudMachineTypeSetV2
}
// NewDescribePHostMachineTypeRequest will create request of DescribePHostMachineType action.
func (c *UPHostClient) NewDescribePHostMachineTypeRequest() *DescribePHostMachineTypeRequest {
req := &DescribePHostMachineTypeRequest{}
// 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: DescribePHostMachineType
获取物理云机型的详细描述信息
*/
func (c *UPHostClient) DescribePHostMachineType(req *DescribePHostMachineTypeRequest) (*DescribePHostMachineTypeResponse, error) {
var err error
var res DescribePHostMachineTypeResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribePHostMachineType", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// DescribePHostTagsRequest is request schema for DescribePHostTags action
type DescribePHostTagsRequest 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"`
}
// DescribePHostTagsResponse is response schema for DescribePHostTags action
type DescribePHostTagsResponse struct {
response.CommonBase
// 具体参见 PHostTagSet
TagSet []PHostTagSet
// Tag的个数
TotalCount int
}
// NewDescribePHostTagsRequest will create request of DescribePHostTags action.
func (c *UPHostClient) NewDescribePHostTagsRequest() *DescribePHostTagsRequest {
req := &DescribePHostTagsRequest{}
// 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: DescribePHostTags
获取物理机tag列表(业务组)
*/
func (c *UPHostClient) DescribePHostTags(req *DescribePHostTagsRequest) (*DescribePHostTagsResponse, error) {
var err error
var res DescribePHostTagsResponse
reqCopier := *req
err = c.Client.InvokeAction("DescribePHostTags", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// GetPHostDiskUpgradePriceRequest is request schema for GetPHostDiskUpgradePrice action
type GetPHostDiskUpgradePriceRequest 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"`
// 磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
DiskSpace *int `required:"true"`
// UPHost实例ID。
PHostId *string `required:"true"`
// 是否重装价格获取。复用此接口。扩容只能增加云盘大小。重装不限制。枚举值:true/false
ReinstallTag *bool `required:"false"`
// 磁盘 ID。获取扩容价格必填(只能扩不能减);重装时候不需要填(根据所选盘大小决定)
UDiskId *string `required:"false"`
}
// GetPHostDiskUpgradePriceResponse is response schema for GetPHostDiskUpgradePrice action
type GetPHostDiskUpgradePriceResponse struct {
response.CommonBase
// 升价差价原价。精度为小数点后2位。
OriginalPrice float64
// 升级差价。精度为小数点后2位。
Price float64
}
// NewGetPHostDiskUpgradePriceRequest will create request of GetPHostDiskUpgradePrice action.
func (c *UPHostClient) NewGetPHostDiskUpgradePriceRequest() *GetPHostDiskUpgradePriceRequest {
req := &GetPHostDiskUpgradePriceRequest{}
// 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: GetPHostDiskUpgradePrice
获取物理云裸金属挂载磁盘的升级价格
*/
func (c *UPHostClient) GetPHostDiskUpgradePrice(req *GetPHostDiskUpgradePriceRequest) (*GetPHostDiskUpgradePriceResponse, error) {
var err error
var res GetPHostDiskUpgradePriceResponse
reqCopier := *req
err = c.Client.InvokeAction("GetPHostDiskUpgradePrice", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
/*
GetPHostPriceParamDisks is request schema for complex param
*/
type GetPHostPriceParamDisks struct {
// 裸金属机型参数->枚举值:\\ > True,是系统盘 \\ > False,是数据盘(默认)。Disks数组中有且只能有一块盘是系统盘。
IsBoot *string `required:"false"`
// 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB。数据盘是20-32000G。
Size *string `required:"false"`
// 裸金属机型参数->磁盘类型:枚举值:CLOUD_RSSD
Type *string `required:"false"`
}
// GetPHostPriceRequest is request schema for GetPHostPrice action
type GetPHostPriceRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"false"`
// 计费模式,枚举值为: Year/Month
ChargeType *string `required:"true"`
// 网络环境,可选千兆:1G ;万兆:10G;25G网络:25G。
Cluster *string `required:"false"`
// 购买数量,范围[1-5]
Count *int `required:"true"`
//
Disks []GetPHostPriceParamDisks `required:"false"`
// 购买时长,1-10个月或1-10年;默认值为1。月付时,此参数传0,代表购买至月末,1代表整月。
Quantity *int `required:"true"`
// 默认为:DB(数据库型),可以通过接口 [DescribePHostMachineType](api/uphost-api/describe_phost_machine_type.html)获取
Type *string `required:"false"`
}
// GetPHostPriceResponse is response schema for GetPHostPrice action
type GetPHostPriceResponse struct {
response.CommonBase
// 价格列表 见 PHostPriceSet
PriceSet []PHostPriceSet
}
// NewGetPHostPriceRequest will create request of GetPHostPrice action.
func (c *UPHostClient) NewGetPHostPriceRequest() *GetPHostPriceRequest {
req := &GetPHostPriceRequest{}
// 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: GetPHostPrice
获取物理机价格列表
*/
func (c *UPHostClient) GetPHostPrice(req *GetPHostPriceRequest) (*GetPHostPriceResponse, error) {
var err error
var res GetPHostPriceResponse
reqCopier := *req
err = c.Client.InvokeAction("GetPHostPrice", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// GetPhostDiskUpgradePriceRequest is request schema for GetPhostDiskUpgradePrice action
type GetPhostDiskUpgradePriceRequest 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"`
// 磁盘ID。
DiskId *string `required:"true"`
// 裸金属机型参数->磁盘大小,单位GB,必须是10GB的整数倍。系统盘20-500GB,数据盘单块盘20-32000GB。
DiskSpace *int `required:"true"`
// UPHost实例ID。
PHostId *string `required:"true"`
}
// GetPhostDiskUpgradePriceResponse is response schema for GetPhostDiskUpgradePrice action
type GetPhostDiskUpgradePriceResponse struct {
response.CommonBase
// 升级差价。精度为小数点后2位。
Price float64
}
// NewGetPhostDiskUpgradePriceRequest will create request of GetPhostDiskUpgradePrice action.
func (c *UPHostClient) NewGetPhostDiskUpgradePriceRequest() *GetPhostDiskUpgradePriceRequest {
req := &GetPhostDiskUpgradePriceRequest{}
// 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: GetPhostDiskUpgradePrice
获取物理云裸金属挂载磁盘的升级价格
*/
func (c *UPHostClient) GetPhostDiskUpgradePrice(req *GetPhostDiskUpgradePriceRequest) (*GetPhostDiskUpgradePriceResponse, error) {
var err error
var res GetPhostDiskUpgradePriceResponse
reqCopier := *req
err = c.Client.InvokeAction("GetPhostDiskUpgradePrice", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// ModifyPHostImageInfoRequest is request schema for ModifyPHostImageInfo action
type ModifyPHostImageInfoRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
// ProjectId *string `required:"false"`
// [公共参数] 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
// Zone *string `required:"true"`
// 镜像ID
ImageId *string `required:"true"`
// 镜像名称
Name *string `required:"false"`
// 备注
Remark *string `required:"false"`
}
// ModifyPHostImageInfoResponse is response schema for ModifyPHostImageInfo action
type ModifyPHostImageInfoResponse struct {
response.CommonBase
// 镜像ID
ImageId string
}
// NewModifyPHostImageInfoRequest will create request of ModifyPHostImageInfo action.
func (c *UPHostClient) NewModifyPHostImageInfoRequest() *ModifyPHostImageInfoRequest {
req := &ModifyPHostImageInfoRequest{}
// 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: ModifyPHostImageInfo
修改自定义镜像名称和备注
*/
func (c *UPHostClient) ModifyPHostImageInfo(req *ModifyPHostImageInfoRequest) (*ModifyPHostImageInfoResponse, error) {
var err error
var res ModifyPHostImageInfoResponse
reqCopier := *req
err = c.Client.InvokeAction("ModifyPHostImageInfo", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// ModifyPHostInfoRequest is request schema for ModifyPHostInfo action
type ModifyPHostInfoRequest 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"`
// 物理机名称,默认不更改
Name *string `required:"false"`
// 物理机资源ID
PHostId *string `required:"true"`
// 物理机备注,默认不更改
Remark *string `required:"false"`
// 业务组,默认不更改
Tag *string `required:"false"`
}
// ModifyPHostInfoResponse is response schema for ModifyPHostInfo action
type ModifyPHostInfoResponse struct {
response.CommonBase
// PHost 的资源ID
PHostId string
}
// NewModifyPHostInfoRequest will create request of ModifyPHostInfo action.
func (c *UPHostClient) NewModifyPHostInfoRequest() *ModifyPHostInfoRequest {
req := &ModifyPHostInfoRequest{}
// 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: ModifyPHostInfo
更改物理机信息
*/
func (c *UPHostClient) ModifyPHostInfo(req *ModifyPHostInfoRequest) (*ModifyPHostInfoResponse, error) {
var err error
var res ModifyPHostInfoResponse
reqCopier := *req
err = c.Client.InvokeAction("ModifyPHostInfo", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// PoweroffPHostRequest is request schema for PoweroffPHost action
type PoweroffPHostRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"true"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// PHost资源ID
PHostId *string `required:"true"`
}
// PoweroffPHostResponse is response schema for PoweroffPHost action
type PoweroffPHostResponse struct {
response.CommonBase
// PHost 的资源ID
PHostId string
}
// NewPoweroffPHostRequest will create request of PoweroffPHost action.
func (c *UPHostClient) NewPoweroffPHostRequest() *PoweroffPHostRequest {
req := &PoweroffPHostRequest{}
// 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: PoweroffPHost
断电物理云主机
*/
func (c *UPHostClient) PoweroffPHost(req *PoweroffPHostRequest) (*PoweroffPHostResponse, error) {
var err error
var res PoweroffPHostResponse
reqCopier := *req
err = c.Client.InvokeAction("PoweroffPHost", &reqCopier, &res)
if err != nil {
return &res, err
}
return &res, nil
}
// RebootPHostRequest is request schema for RebootPHost action
type RebootPHostRequest struct {
request.CommonBase
// [公共参数] 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
// ProjectId *string `required:"true"`
// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
// Region *string `required:"true"`
// [公共参数] 可用区。参见 [可用区列表](../summary/regionlist.html)
// Zone *string `required:"false"`
// PHost资源ID
PHostId *string `required:"true"`
}
// RebootPHostResponse is response schema for RebootPHost action
type RebootPHostResponse struct {
response.CommonBase
// PHost 的资源ID
PHostId string
}
// NewRebootPHostRequest will create request of RebootPHost action.
func (c *UPHostClient) NewRebootPHostRequest() *RebootPHostRequest {
req := &RebootPHostRequest{}
// 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: RebootPHost
重启物理机
*/
func (c *UPHostClient) RebootPHost(req *RebootPHostRequest) (*RebootPHostResponse, error) {
var err error
var res RebootPHostResponse
reqCopier := *req