Repository navigation
Expand file tree
/
Copy pathULBClient.php
More file actions
2549 lines (2499 loc) · 162 KB
/
Copy pathULBClient.php
File metadata and controls
2549 lines (2499 loc) · 162 KB
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
<?php
/**
* Copyright 2026 UCloud Technology Co., Ltd.
*
* 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.
*/
namespace UCloud\ULB;
use UCloud\Core\Client;
use UCloud\Core\Exception\UCloudException;
use UCloud\ULB\Apis\AddSSLBindingRequest;
use UCloud\ULB\Apis\AddSSLBindingResponse;
use UCloud\ULB\Apis\AddTargetsRequest;
use UCloud\ULB\Apis\AddTargetsResponse;
use UCloud\ULB\Apis\AllocateBackendRequest;
use UCloud\ULB\Apis\AllocateBackendResponse;
use UCloud\ULB\Apis\BindSSLRequest;
use UCloud\ULB\Apis\BindSSLResponse;
use UCloud\ULB\Apis\CreateListenerRequest;
use UCloud\ULB\Apis\CreateListenerResponse;
use UCloud\ULB\Apis\CreateLoadBalancerRequest;
use UCloud\ULB\Apis\CreateLoadBalancerResponse;
use UCloud\ULB\Apis\CreatePolicyRequest;
use UCloud\ULB\Apis\CreatePolicyResponse;
use UCloud\ULB\Apis\CreateRuleRequest;
use UCloud\ULB\Apis\CreateRuleResponse;
use UCloud\ULB\Apis\CreateSSLRequest;
use UCloud\ULB\Apis\CreateSSLResponse;
use UCloud\ULB\Apis\CreateSecurityPolicyRequest;
use UCloud\ULB\Apis\CreateSecurityPolicyResponse;
use UCloud\ULB\Apis\CreateULBRequest;
use UCloud\ULB\Apis\CreateULBResponse;
use UCloud\ULB\Apis\CreateVServerRequest;
use UCloud\ULB\Apis\CreateVServerResponse;
use UCloud\ULB\Apis\DeleteListenerRequest;
use UCloud\ULB\Apis\DeleteListenerResponse;
use UCloud\ULB\Apis\DeleteLoadBalancerRequest;
use UCloud\ULB\Apis\DeleteLoadBalancerResponse;
use UCloud\ULB\Apis\DeletePolicyRequest;
use UCloud\ULB\Apis\DeletePolicyResponse;
use UCloud\ULB\Apis\DeleteRuleRequest;
use UCloud\ULB\Apis\DeleteRuleResponse;
use UCloud\ULB\Apis\DeleteSSLRequest;
use UCloud\ULB\Apis\DeleteSSLResponse;
use UCloud\ULB\Apis\DeleteSSLBindingRequest;
use UCloud\ULB\Apis\DeleteSSLBindingResponse;
use UCloud\ULB\Apis\DeleteSecurityPolicyRequest;
use UCloud\ULB\Apis\DeleteSecurityPolicyResponse;
use UCloud\ULB\Apis\DeleteULBRequest;
use UCloud\ULB\Apis\DeleteULBResponse;
use UCloud\ULB\Apis\DeleteVServerRequest;
use UCloud\ULB\Apis\DeleteVServerResponse;
use UCloud\ULB\Apis\DescribeListenersRequest;
use UCloud\ULB\Apis\DescribeListenersResponse;
use UCloud\ULB\Apis\DescribeLoadBalancersRequest;
use UCloud\ULB\Apis\DescribeLoadBalancersResponse;
use UCloud\ULB\Apis\DescribeRulesRequest;
use UCloud\ULB\Apis\DescribeRulesResponse;
use UCloud\ULB\Apis\DescribeSSLRequest;
use UCloud\ULB\Apis\DescribeSSLResponse;
use UCloud\ULB\Apis\DescribeSSLV2Request;
use UCloud\ULB\Apis\DescribeSSLV2Response;
use UCloud\ULB\Apis\DescribeSecurityPoliciesRequest;
use UCloud\ULB\Apis\DescribeSecurityPoliciesResponse;
use UCloud\ULB\Apis\DescribeSecurityPoliciesV2Request;
use UCloud\ULB\Apis\DescribeSecurityPoliciesV2Response;
use UCloud\ULB\Apis\DescribeSupportCiphersRequest;
use UCloud\ULB\Apis\DescribeSupportCiphersResponse;
use UCloud\ULB\Apis\DescribeULBRequest;
use UCloud\ULB\Apis\DescribeULBResponse;
use UCloud\ULB\Apis\DescribeULBSimpleRequest;
use UCloud\ULB\Apis\DescribeULBSimpleResponse;
use UCloud\ULB\Apis\DescribeVServerRequest;
use UCloud\ULB\Apis\DescribeVServerResponse;
use UCloud\ULB\Apis\ReleaseBackendRequest;
use UCloud\ULB\Apis\ReleaseBackendResponse;
use UCloud\ULB\Apis\RemoveTargetsRequest;
use UCloud\ULB\Apis\RemoveTargetsResponse;
use UCloud\ULB\Apis\UnBindSecurityPolicyRequest;
use UCloud\ULB\Apis\UnBindSecurityPolicyResponse;
use UCloud\ULB\Apis\UnbindSSLRequest;
use UCloud\ULB\Apis\UnbindSSLResponse;
use UCloud\ULB\Apis\UpdateBackendAttributeRequest;
use UCloud\ULB\Apis\UpdateBackendAttributeResponse;
use UCloud\ULB\Apis\UpdateBackendBatchRequest;
use UCloud\ULB\Apis\UpdateBackendBatchResponse;
use UCloud\ULB\Apis\UpdateListenerAttributeRequest;
use UCloud\ULB\Apis\UpdateListenerAttributeResponse;
use UCloud\ULB\Apis\UpdateLoadBalancerAttributeRequest;
use UCloud\ULB\Apis\UpdateLoadBalancerAttributeResponse;
use UCloud\ULB\Apis\UpdatePolicyRequest;
use UCloud\ULB\Apis\UpdatePolicyResponse;
use UCloud\ULB\Apis\UpdateRuleAttributeRequest;
use UCloud\ULB\Apis\UpdateRuleAttributeResponse;
use UCloud\ULB\Apis\UpdateSSLAttributeRequest;
use UCloud\ULB\Apis\UpdateSSLAttributeResponse;
use UCloud\ULB\Apis\UpdateSSLBindingRequest;
use UCloud\ULB\Apis\UpdateSSLBindingResponse;
use UCloud\ULB\Apis\UpdateSecurityPolicyRequest;
use UCloud\ULB\Apis\UpdateSecurityPolicyResponse;
use UCloud\ULB\Apis\UpdateTargetsAttributeRequest;
use UCloud\ULB\Apis\UpdateTargetsAttributeResponse;
use UCloud\ULB\Apis\UpdateULBAttributeRequest;
use UCloud\ULB\Apis\UpdateULBAttributeResponse;
use UCloud\ULB\Apis\UpdateVServerAttributeRequest;
use UCloud\ULB\Apis\UpdateVServerAttributeResponse;
/**
* This client is used to call actions of **ULB** service
*/
class ULBClient extends Client
{
/**
* AddSSLBinding - ALB的监听器绑定SSL证书
*
* See also: https://docs.ucloud.cn/api/ulb-api/add_ssl_binding
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 负载均衡实例的ID
* "ListenerId" => (string) 监听器的ID
* "SSLIds" => (array<string>) SSLId的数组
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return AddSSLBindingResponse
* @throws UCloudException
*/
public function addSSLBinding(AddSSLBindingRequest $request = null)
{
$resp = $this->invoke($request);
return new AddSSLBindingResponse($resp->toArray(), $resp->getRequestId());
}
/**
* AddTargets - 给应用型负载均衡监听器添加后端服务节点
*
* See also: https://docs.ucloud.cn/api/ulb-api/add_targets
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 负载均衡实例的ID
* "ListenerId" => (string) 监听器的ID
* "Targets" => (array<object>) [
* [
* "ResourceType" => (string) 服务节点的类型。限定枚举值:"UHost" / "UNI"/"UPM"/"IP",默认值:"UHost";非IP类型,如果该资源有多个IP,将只能添加主IP;非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
* "ResourceId" => (string) 服务节点的资源ID。在非IP类型时,必传
* "VPCId" => (string) 服务节点的VPC资源ID。在IP类型时,必传
* "SubnetId" => (string) 服务节点的子网资源ID。在IP类型时,必传
* "ResourceIP" => (string) 服务节点的IP。在IP类型时,必传
* "Port" => (integer) 服务节点的端口。限定取值:[1-65535],默认值80
* "Weight" => (integer) 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效
* "Enabled" => (boolean) 服务节点是否启用。默认值true
* "IsBackup" => (boolean) 服务节点是否为备节点。默认值false
* ]
* ]
* ]
*
* Outputs:
*
* $outputs = [
* "Targets" => (array<object>) 服务节点信息[
* [
* "ResourceType" => (string) 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
* "ResourceId" => (string) 服务节点的资源ID。在非IP类型时,必传
* "VPCId" => (string) 服务节点的VPC资源ID。在IP类型时,必传
* "SubnetId" => (string) 服务节点的子网资源ID。在IP类型时,必传
* "ResourceIP" => (string) 服务节点的IP。在IP类型时,必传
* "Port" => (integer) 服务节点的端口。限定取值:[1-65535]; 默认值:80
* "Weight" => (integer) 服务节点的权重。限定取值:[1-100]; 仅在加权轮询算法时有效; 默认值:1
* "Enabled" => (boolean) 服务节点是否启用。 默认值:true
* "IsBackup" => (boolean) 服务节点是否为备节点。 默认值:false
* "Id" => (string) 服务节点的标识ID。
* "State" => (string) 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康
* ]
* ]
* ]
*
* @return AddTargetsResponse
* @throws UCloudException
*/
public function addTargets(AddTargetsRequest $request = null)
{
$resp = $this->invoke($request);
return new AddTargetsResponse($resp->toArray(), $resp->getRequestId());
}
/**
* AllocateBackend - 添加CLB后端资源实例
*
* See also: https://docs.ucloud.cn/api/ulb-api/allocate_backend
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 传统型负载均衡实例的ID
* "VServerId" => (string) VServer实例的ID
* "ResourceType" => (string) 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机;UHybrid->混合云主机;CUBE->Cube, IP->IP类型;默认值为UHost。报文转发模式不支持UHybrid、CUBE、IP
* "ResourceId" => (string) 所添加的后端资源的资源ID;与ResourceIP二选一必填
* "ResourceIP" => (string) 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 或 IP时有效,且必填;与ResourceId二选一必填
* "VPCId" => (string) 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 或 IP 时有效,且必填
* "SubnetId" => (string) 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 或 IP 时有效,且必填
* "Port" => (integer) 所添加的后端资源服务端口,取值范围[1-65535],默认80
* "Weight" => (integer) 所添加的后端RS权重(在加权轮询算法下有效),取值范围[1-100],默认为1
* "Enabled" => (integer) 后端实例状态开关,枚举值: 1:启用; 0:禁用 默认为启用
* "IsBackup" => (integer) rs是否为backup,默认为00:普通rs1:backup的rs
* ]
*
* Outputs:
*
* $outputs = [
* "BackendId" => (string) 所添加的后端资源在CLB中的对象ID,(为CLB系统中使用,与资源自身ID无关),可用于 UpdateBackendAttribute/UpdateBackendAttributeBatch/ReleaseBackend
* ]
*
* @return AllocateBackendResponse
* @throws UCloudException
*/
public function allocateBackend(AllocateBackendRequest $request = null)
{
$resp = $this->invoke($request);
return new AllocateBackendResponse($resp->toArray(), $resp->getRequestId());
}
/**
* BindSSL - 将SSL证书绑定到传统型负载均衡VServer
*
* See also: https://docs.ucloud.cn/api/ulb-api/bind_ssl
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 所绑定CLB实例ID
* "VServerId" => (string) 所绑定VServer实例ID
* "SSLId" => (string) SSL证书的Id
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return BindSSLResponse
* @throws UCloudException
*/
public function bindSSL(BindSSLRequest $request = null)
{
$resp = $this->invoke($request);
return new BindSSLResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateListener - 创建一个应用型负载均衡的监听器
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_listener
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 负载均衡实例的ID
* "Name" => (string) 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:“-”,“_”,“.”;默认值:listener
* "Remark" => (string) 监听器的备注信息。限定字符长度:[0-255]
* "ListenerPort" => (integer) 监听器的监听端口。应用型限定取值:[1-65535],默认值80
* "ListenerProtocol" => (string) 监听协议。应用型限定取值:“HTTP”/"HTTPS",默认值“HTTP”
* "Certificates" => (array<string>) (应用型专用)服务器默认证书ID。仅HTTPS监听支持,且必填;暂时只支持最大长度为1
* "SecurityPolicyId" => (string) (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;默认值“Default”,表示绑定原生策略
* "IdleTimeout" => (integer) 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400];默认值60
* "Scheduler" => (string) 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup",默认值"Roundrobin"
* "StickinessConfig" => (object) [
* "Enabled" => (boolean) 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现;默认值为:false
* "Type" => (string) (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert”
* "CookieName" => (string) (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255]
* ]
* "HealthCheckConfig" => (object) [
* "Enabled" => (boolean) 是否开启健康检查功能。默认值为:true
* "Type" => (string) 健康检查方式。应用型限定取值:“Port”/"HTTP/GRPC",默认值:“Port”
* "Domain" => (string) (应用型专用)HTTP/GRPC检查域名
* "Path" => (string) (应用型专用)HTTP/GRPC检查路径
* "Method" => (string) (应用型专用)HTTP检查方法。只支持GET和HEAD。
* "ResponseCode" => (string) (应用型专用)HTTP时为2xx,3xx格式(逗号分隔),GRPC时为数字码(逗号分隔)
* "Port" => (integer) (应用型专用)端口
* "HTTPVersion" => (string) (应用型专用)检查协议
* "TimeOut" => (integer) (应用型专用)超时时间,秒,必须小于Interval
* "Interval" => (integer) (应用型专用)间隔时间,秒,必须大于TimeOut
* "UpCounts" => (integer) (应用型专用)判定成功的连续次数
* "DownCounts" => (integer) (应用型专用)判定失败的连续次数
* ]
* "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩。默认值为:false
* "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启;默认值为:false
* "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启;默认值为:false
* "RedirectPort" => (integer) (应用型专用)重定向端口。限定取值:[1-65535],默认值443
* "TargetProtocol" => (string) 后端协议。应用型限定取值:“HTTP,HTTPS,GRPC",默认值“HTTP”
* ]
*
* Outputs:
*
* $outputs = [
* "ListenerId" => (string) 监听器的ID
* ]
*
* @return CreateListenerResponse
* @throws UCloudException
*/
public function createListener(CreateListenerRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateListenerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateLoadBalancer - 创建一个应用型负载均衡实例
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_load_balancer
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "VPCId" => (string) 负载均衡实例所属的VPC资源ID
* "SubnetId" => (string) 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源
* "Type" => (string) 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application"
* "Name" => (string) 负载均衡实例的名称。默认值:lb;特殊字符仅支持:“-”,“_”,“.”;限定字符长度:[1-255]
* "Tag" => (string) 负载均衡实例所属的业务组ID。默认值为“Default”; 传空则为Default业务组
* "Remark" => (string) 负载均衡实例的备注信息。限定字符长度:[0-255]
* "IPVersion" => (string) 负载均衡实例的IP协议。限定枚举值:"IPv4" / "IPv6"/"DualStack",默认值为:“IPv4”
* "ChargeType" => (string) 付费模式。限定枚举值:"Year" / "Month"/"Day"/"Dynamic",默认值为:“Month”
* "Quantity" => (integer) 购买的时长, 默认: 1; 0-> 购买至月末(0只在月付费有效,其余付费模式传0,实际收费按一个周期计费)
* "SecGroups" => (array<object>) [
* [
* "SecGroupId" => (string) 安全组id
* "Priority" => (integer) 安全组优先级
* ]
* ]
* "LabelInfos" => (array<object>) [
* [
* "Key" => (string) 标签键
* "Value" => (string) 标签值
* ]
* ]
* "CouponId" => (string) 代金券code
* ]
*
* Outputs:
*
* $outputs = [
* "LoadBalancerId" => (string) 负载均衡实例的ID
* ]
*
* @return CreateLoadBalancerResponse
* @throws UCloudException
*/
public function createLoadBalancer(CreateLoadBalancerRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateLoadBalancerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreatePolicy - 传统型负载均衡创建VServer内容转发策略
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_policy
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 需要添加内容转发策略的传统型负载均衡实例ID
* "VServerId" => (string) 需要添加内容转发策略的传统型负载均衡VServer实例ID
* "BackendId" => (array<string>) 内容转发策略应用的传统型负载均衡后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId
* "Match" => (string) 内容转发匹配字段
* "DomainMatchMode" => (string) 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名
* "Type" => (string) 内容转发匹配字段的类型
* "PolicyPriority" => (integer) 策略优先级,1-9999;只针对路径规则生效
* ]
*
* Outputs:
*
* $outputs = [
* "PolicyId" => (string) 内容转发策略ID
* ]
*
* @return CreatePolicyResponse
* @throws UCloudException
*/
public function createPolicy(CreatePolicyRequest $request = null)
{
$resp = $this->invoke($request);
return new CreatePolicyResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateRule - 给应用型负载均衡监听器创建一条转发规则
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_rule
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 负载均衡实例的ID
* "ListenerId" => (string) 监听器的ID
* "RuleConditions" => (array<object>) [
* [
* "Type" => (string) 匹配条件类型。限定枚举值:"Host"/"Path"
* "HostConfig" => (object) [
* "MatchMode" => (string) 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular"
* "Values" => (array<string>) 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填
* ]
* "PathConfig" => (object) [
* "Values" => (array<string>) 取值。暂时只支持数组长度为1;取值需符合相关条件;路径匹配时必填
* ]
* ]
* ]
* "RuleActions" => (array<object>) [
* [
* "Type" => (string) 动作类型。限定枚举值:"Forward"、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader"。只会处理 Type 对应的结构体。
* "ForwardConfig" => (object) [
* "Targets" => (array<object>) [
* [
* "Id" => (string) 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填
* "Weight" => (integer) 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效
* ]
* ]
* ]
* "Order" => (integer) 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行
* "InsertHeaderConfig" => (object) [
* "Key" => (string) 插入的 header 字段名称,长度为 1~40 个字符,支持大小写字母 a~z、数字、下划线(_)和短划线(-)。头字段名称不能重复用于InsertHeader中。header 字段不能使用以下(此处判断大小写不敏感)x-real-ip、x-forwarded-for、x-forwarded-proto、x-forwarded-srcport、ucloud-alb-trace、connection、upgrade、content-length、transfer-encoding、keep-alive、te、host、cookie、remoteip、authority
* "ValueType" => (string) 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。
* "Value" => (string) 插入的 header 字段内容。ValueType 取值为 SystemDefined 时取值如下:ClientSrcPort:客户端端口。ClientSrcIp:客户端 IP 地址。Protocol:客户端请求的协议(HTTP 或 HTTPS)。RuleID:客户端请求命中的转发规则ID。ALBID:ALB ID。ALBPort:ALB 端口。ValueType 取值为 UserDefined 时:可以自定义头字段内容,限制长度为 1~128 个字符,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。ValueType 取值为 ReferenceHeader 时:可以引用请求头字段中的某一个字段,限制长度限制为 1~128 个字符,支持小写字母 a~z、数字、短划线(-)和下划线(_)。
* ]
* "RemoveHeaderConfig" => (object) [
* "Key" => (string) 删除的 header 字段名称,目前只能删除以下几个默认配置的字段X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort
* ]
* "CorsConfig" => (object) [
* "AllowOrigin" => (array<string>) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值
* "AllowHeaders" => (array<string>) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值
* "ExposeHeaders" => (array<string>) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值
* "AllowMethods" => (array<string>) 选择跨域访问时允许的 HTTP 方法。取值:GET。POST。PUT。DELETE。HEAD。OPTIONS。PATCH。
* "AllowCredentials" => (string) 是否允许携带凭证信息。取值:on:是。off:否。
* "MaxAge" => (integer) 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。
* ]
* "FixedResponseConfig" => (object) [
* "HttpCode" => (integer) 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。
* "Content" => (string) 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。
* ]
* "ProxyBufferingConfig" => (object) [
* "CloseProxyBuffering" => (boolean) 关闭缓存
* ]
* "BackendConnectionConfig" => (object) [
* "EnablePersistentConnection" => (boolean) 开启长连接
* ]
* ]
* ]
* "Pass" => (boolean) 当转发的服务节点为空时,规则是否忽略。默认值true
* ]
*
* Outputs:
*
* $outputs = [
* "RuleId" => (string) 转发规则的ID
* ]
*
* @return CreateRuleResponse
* @throws UCloudException
*/
public function createRule(CreateRuleRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateRuleResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateSSL - 创建SSL证书,可以把整个 Pem 证书内容传过来,或者把证书、私钥、CA证书分别传过来
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_ssl
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "SSLName" => (string) SSL证书的名字,默认值不为空
* "SSLType" => (string) 所添加的SSL证书类型,目前只支持Pem格式
* "SSLContent" => (string) SSL证书的完整内容,包括用户证书、加密证书的私钥、CA证书
* "UserCert" => (string) 用户的证书
* "PrivateKey" => (string) 加密证书的私钥
* "CaCert" => (string) CA证书
* "USSLId" => (string) USSL证书的ID
* ]
*
* Outputs:
*
* $outputs = [
* "SSLId" => (string) SSL证书的Id
* ]
*
* @return CreateSSLResponse
* @throws UCloudException
*/
public function createSSL(CreateSSLRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateSSLResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateSecurityPolicy - 创建安全策略
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_security_policy
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "TLSVersion" => (string) TLS版本
* "SSLCiphers" => (array<string>) 加密套件
* "SecurityPolicyName" => (string) 安全策略名称
* ]
*
* Outputs:
*
* $outputs = [
* "SecurityPolicyId" => (string) 安全策略ID
* ]
*
* @return CreateSecurityPolicyResponse
* @throws UCloudException
*/
public function createSecurityPolicy(CreateSecurityPolicyRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateSecurityPolicyResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateULB - 创建传统型负载均衡负载均衡实例,可以选择内网或者外网
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_ulb
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBName" => (string) 负载均衡的名字,默认值为“ULB”
* "Tag" => (string) 业务组
* "Remark" => (string) 备注
* "OuterMode" => (string) 创建的CLB是否为外网模式,默认即为外网模式
* "InnerMode" => (string) 创建的CLB是否为内网模式
* "ChargeType" => (string) 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费
* "VPCId" => (string) CLB所在的VPC的ID。 如果不传则使用默认的VPC,若不传且无默认VPC则接口报错
* "SubnetId" => (string) CLB 所属的子网ID,如果不传则随机选择一个。
* "BusinessId" => (string) CLB 所属的业务组ID,如果不传则使用默认的业务组
* "FirewallId" => (string) 防火墙ID,如果不传,则默认不绑定防火墙
* "ListenType" => (string) CLB 监听器类型,外网CLB默认RequestProxy,内网ULB默认PacketsTransmit。枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发。
* ]
*
* Outputs:
*
* $outputs = [
* "ULBId" => (string) 传统型负载均衡实例的Id
* "IPv6AddressId" => (string) IPv6地址Id
* ]
*
* @return CreateULBResponse
* @throws UCloudException
*/
public function createULB(CreateULBRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateULBResponse($resp->toArray(), $resp->getRequestId());
}
/**
* CreateVServer - 创建CLB的VServer实例,定义监听的协议和端口以及负载均衡算法
*
* See also: https://docs.ucloud.cn/api/ulb-api/create_vserver
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 传统型负载均衡实例ID
* "VServerName" => (string) VServer实例名称,默认为"VServer"
* "ListenType" => (string) 监听器类型,枚举值,RequestProxy ,请求代理;PacketsTransmit ,报文转发。默认为RequestProxy
* "Protocol" => (string) VServer实例的协议,请求代理模式下有 HTTP、HTTPS、TCP,报文转发下有 TCP,UDP。默认为“HTTP"
* "FrontendPort" => (integer) VServer后端端口,取值范围[1-65535];默认值为80
* "Method" => (string) VServer负载均衡模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口); WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式。ConsistentHash,SourcePort,ConsistentHashPort 只在报文转发中使用;Leastconn只在请求代理中使用;Roundrobin、Source和WeightRoundrobin,Backup在请求代理和报文转发中使用。默认为:"Roundrobin"
* "PersistenceType" => (string) VServer会话保持方式,默认关闭会话保持。枚举值:None -> 关闭;ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY。
* "PersistenceInfo" => (string) 根据PersistenceType确认; None和ServerInsert: 此字段无意义; UserDefined:此字段传入自定义会话保持String
* "ClientTimeout" => (integer) ListenType为RequestProxy时表示空闲连接的回收时间,单位:秒,取值范围:时(0,86400],默认值为60;ListenType为PacketsTransmit时表示连接保持的时间,单位:秒,取值范围:[60,900],0 表示禁用连接保持
* "MonitorType" => (string) 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测;Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path;报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize,默认值为Ping
* "Domain" => (string) 根据MonitorType确认; 当MonitorType为Path时,此字段有意义,代表HTTP检查域名
* "Path" => (string) 根据MonitorType确认; 当MonitorType为Path时,此字段有意义,代表HTTP检查路径
* "RequestMsg" => (string) 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文
* "ResponseMsg" => (string) 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文
* "SecurityPolicyId" => (string) 安全策略组ID,默认值'Default'
* "EnableCompression" => (integer) 0:关闭 1:开启,用于数据压缩功能
* "ForwardPort" => (integer) 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能
* "EnableHTTP2" => (integer) 0:关闭 1:开启,用于开启http2功能;默认值为0
* ]
*
* Outputs:
*
* $outputs = [
* "VServerId" => (string) VServer实例的Id
* ]
*
* @return CreateVServerResponse
* @throws UCloudException
*/
public function createVServer(CreateVServerRequest $request = null)
{
$resp = $this->invoke($request);
return new CreateVServerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteListener - 删除一个应用型负载均衡监听器
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_listener
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 应用型负载均衡实例的ID
* "ListenerId" => (string) 应用型负载均衡监听器的ID
* "RelatedRedirectDisabled" => (boolean) 是否关闭相关监听器的重定向功能。默认为false,即有其他监听器重定向到本监听器,则删除失败。为true时,会先关闭相关监听器的重定向功能,再删除本监听器。默认值为:false
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteListenerResponse
* @throws UCloudException
*/
public function deleteListener(DeleteListenerRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteListenerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteLoadBalancer - 删除一个应用型负载均衡实例
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_load_balancer
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 应用型负载均衡实例的ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteLoadBalancerResponse
* @throws UCloudException
*/
public function deleteLoadBalancer(DeleteLoadBalancerRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteLoadBalancerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeletePolicy - 删除传统型负载均衡的内容转发策略
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_policy
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "PolicyId" => (string) CLB的内容转发策略ID
* "VServerId" => (string) CLB的VServer 资源ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeletePolicyResponse
* @throws UCloudException
*/
public function deletePolicy(DeletePolicyRequest $request = null)
{
$resp = $this->invoke($request);
return new DeletePolicyResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteRule - 删除应用型负载均衡监听器的一条转发规则
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_rule
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 应用型负载均衡实例的ID
* "ListenerId" => (string) 应用型负载均衡监听器的ID
* "RuleId" => (string) 应用型负载均衡的转发规则的ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteRuleResponse
* @throws UCloudException
*/
public function deleteRule(DeleteRuleRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteRuleResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteSSL - 删除SSL证书
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_ssl
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
* "SSLId" => (string) SSL证书的ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteSSLResponse
* @throws UCloudException
*/
public function deleteSSL(DeleteSSLRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteSSLResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteSSLBinding - 删除监听器绑定的扩展证书
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_ssl_binding
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "LoadBalancerId" => (string) 负载均衡实例的ID
* "ListenerId" => (string) 监听器的ID
* "SSLIds" => (array<string>) SSLId的数组
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteSSLBindingResponse
* @throws UCloudException
*/
public function deleteSSLBinding(DeleteSSLBindingRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteSSLBindingResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteSecurityPolicy - 删除安全策略
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_security_policy
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "SecurityPolicyId" => (string) 安全策略ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteSecurityPolicyResponse
* @throws UCloudException
*/
public function deleteSecurityPolicy(DeleteSecurityPolicyRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteSecurityPolicyResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteULB - 删除传统型负载均衡实例
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_ulb
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 传统型负载均衡实例的ID
* "ReleaseEip" => (boolean) 删除clb时是否释放绑定的EIP,false标识只解绑EIP,true表示会释放绑定的EIP,默认是false。Anycast IP 此参数无效
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteULBResponse
* @throws UCloudException
*/
public function deleteULB(DeleteULBRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteULBResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DeleteVServer - 删除CLB的VServer实例
*
* See also: https://docs.ucloud.cn/api/ulb-api/delete_vserver
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ULBId" => (string) 传统型负载均衡实例的ID
* "VServerId" => (string) CLB下的VServer实例的ID
* ]
*
* Outputs:
*
* $outputs = [
* ]
*
* @return DeleteVServerResponse
* @throws UCloudException
*/
public function deleteVServer(DeleteVServerRequest $request = null)
{
$resp = $this->invoke($request);
return new DeleteVServerResponse($resp->toArray(), $resp->getRequestId());
}
/**
* DescribeListeners - 描述一个指定的监听器或者一个应用型负载均衡实例下的所有监听器
*
* See also: https://docs.ucloud.cn/api/ulb-api/describe_listeners
*
* Arguments:
*
* $args = [
* "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist)
* "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list)
* "ListenerId" => (string) 应用型负载均衡监听器的ID。若指定ListenerId,则忽略LoadBalancerId。ListenId和LoadBalancerId必选其一
* "LoadBalancerId" => (string) 应用型负载均衡实例的ID。未指定ListenId,则描述指定的LoadBalancerId下的所有监听器。
* "Offset" => (integer) 数据偏移量,默认为0
* "Limit" => (integer) 数据分页值,默认为100
* ]
*
* Outputs:
*
* $outputs = [
* "TotalCount" => (integer) 满足条件的负载均衡监听器总数
* "Listeners" => (array<object>) 负载均衡监听器信息[
* [
* "ListenerId" => (string) 监听器的ID
* "Name" => (string) 监听器的名称
* "Remark" => (string) 监听器的备注信息
* "ListenerPort" => (integer) 监听器的监听端口
* "ListenerProtocol" => (string) 监听协议。应用型限定取值: HTTP、HTTPS
* "Certificates" => (array<object>) (应用型专用)服务器默认证书ID。仅HTTPS监听支持。具体接口详见 Certificate[
* [
* "SSLId" => (string) 证书ID
* "IsDefault" => (boolean) 是否为默认证书
* ]
* ]
* "SecurityPolicyId" => (string) (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略
* "IdleTimeout" => (integer) 连接空闲超时时间。单位:秒
* "Scheduler" => (string) 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式
* "StickinessConfig" => (object) 会话保持相关配置。具体结构详见 StickinessConfigSet[
* "Enabled" => (boolean) 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现
* "Type" => (string) (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY
* "CookieName" => (string) (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效
* ]
* "HealthCheckConfig" => (object) 健康检查相关配置。具体结构详见 HealthCheckConfigSet[
* "Enabled" => (boolean) 是否开启健康检查功能。 默认值为:true
* "Type" => (string) 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查;GRPC -> GRPC检测; 默认值:Port
* "Domain" => (string) (应用型专用)HTTP检查域名。 当Type为HTTP/GRPC时,此字段有意义,代表HTTP检查域名
* "Path" => (string) (应用型专用)HTTP检查路径。当Type为HTTP/GRPC时,此字段有意义,代表HTTP检查路径
* "Method" => (string) (应用型专用)HTTP检查方法。当Type为HTTP/GRPC时,此字段有意义,代表HTTP检查方法
* "ResponseCode" => (string) (应用型专用)检查预期状态码。HTTP时为2xx,3xx格式(逗号分隔),GRPC时为数字码(逗号分隔)。
* "HTTPVersion" => (string) (应用型专用)检查协议
* "Port" => (integer) (应用型专用)端口
* "TimeOut" => (integer) (应用型专用)超时时间,秒,必须小于Interval
* "Interval" => (integer) (应用型专用)间隔时间,秒,必须大于TimeOut
* "UpCounts" => (integer) (应用型专用)判定成功的连续次数
* "DownCounts" => (integer) (应用型专用)判定失败的连续次数
* ]
* "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩
* "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启
* "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启
* "RedirectPort" => (integer) (应用型专用)重定向端口
* "Targets" => (array<object>) 添加的服务节点信息。具体结构详见 Target[
* [
* "ResourceType" => (string) 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑
* "ResourceId" => (string) 服务节点的资源ID
* "ResourceName" => (string) 服务节点的资源名称
* "VPCId" => (string) 服务节点的VPC资源ID
* "SubnetId" => (string) 服务节点的子网资源ID
* "ResourceIP" => (string) 服务节点的IP
* "Port" => (integer) 服务节点的端口
* "Weight" => (integer) 服务节点的权重。仅在加权轮询算法时有效
* "Enabled" => (boolean) 服务节点是否启用
* "IsBackup" => (boolean) 服务节点是否为备节点
* "Id" => (string) 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets
* "State" => (string) 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康
* ]
* ]
* "Rules" => (array<object>) (应用型专用)转发规则信息[
* [
* "RuleId" => (string) 转发规则的ID
* "RuleConditions" => (array<object>) 转发规则匹配条件。具体结构详见 RuleCondition[
* [
* "Type" => (string) 匹配条件类型。限定枚举值:Host,Path
* "HostConfig" => (object) 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet[
* "Values" => (array<string>) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
* "MatchMode" => (string) 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular
* ]
* "PathConfig" => (object) 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet[
* "Values" => (array<string>) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件
* ]
* ]
* ]
* "RuleActions" => (array<object>) 转发动作。具体规则详见RuleAction[
* [
* "Type" => (string) 动作类型。限定枚举值:Forward、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader"
* "ForwardConfig" => (object) 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet[
* "Targets" => (array<object>) 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet[
* [
* "Id" => (string) 服务节点的标识ID
* "Weight" => (integer) 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1
* ]
* ]