diff --git a/VERSION b/VERSION index 940ac09a..5503126d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.9 +0.3.10 diff --git a/src/ULB/Apis/AddSSLBindingRequest.php b/src/ULB/Apis/AddSSLBindingRequest.php new file mode 100644 index 00000000..d6a2765a --- /dev/null +++ b/src/ULB/Apis/AddSSLBindingRequest.php @@ -0,0 +1,134 @@ + "AddSSLBinding"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("SSLIds"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * SSLIds: SSLId的数组 + * + * @return string[]|null + */ + public function getSSLIds() + { + return $this->get("SSLIds"); + } + + /** + * SSLIds: SSLId的数组 + * + * @param string[] $sslIds + */ + public function setSSLIds(array $sslIds) + { + $this->set("SSLIds", $sslIds); + } +} diff --git a/src/ULB/Apis/AddSSLBindingResponse.php b/src/ULB/Apis/AddSSLBindingResponse.php new file mode 100644 index 00000000..742d9952 --- /dev/null +++ b/src/ULB/Apis/AddSSLBindingResponse.php @@ -0,0 +1,26 @@ + "AddTargets"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * Targets: + * + * @return AddTargetsParamTargets[]|null + */ + public function getTargets() + { + $items = $this->get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new AddTargetsParamTargets($item)); + } + return $result; + } + + /** + * Targets: + * + * @param AddTargetsParamTargets[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/AddTargetsResponse.php b/src/ULB/Apis/AddTargetsResponse.php new file mode 100644 index 00000000..e7ab873a --- /dev/null +++ b/src/ULB/Apis/AddTargetsResponse.php @@ -0,0 +1,57 @@ +get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new TargetSet($item)); + } + return $result; + } + + /** + * Targets: 服务节点信息 + * + * @param TargetSet[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/AllocateBackendRequest.php b/src/ULB/Apis/AllocateBackendRequest.php index 300279aa..54894c3f 100644 --- a/src/ULB/Apis/AllocateBackendRequest.php +++ b/src/ULB/Apis/AllocateBackendRequest.php @@ -1,6 +1,6 @@ markRequired("ULBId"); $this->markRequired("VServerId"); $this->markRequired("ResourceType"); - $this->markRequired("ResourceId"); } @@ -74,7 +73,7 @@ public function setProjectId($projectId) } /** - * ULBId: 负载均衡实例的ID + * ULBId: 传统型负载均衡实例的ID * * @return string|null */ @@ -84,7 +83,7 @@ public function getULBId() } /** - * ULBId: 负载均衡实例的ID + * ULBId: 传统型负载均衡实例的ID * * @param string $ulbId */ @@ -114,7 +113,7 @@ public function setVServerId($vServerId) } /** - * ResourceType: 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机; UDHost -> 私有专区主机;UDocker -> 容器;UHybrid->混合云主机;CUBE->Cube,USDP->智能大数据平台;默认值为UHost。报文转发模式不支持UDocker、UHybrid、CUBE + * ResourceType: 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机;UHybrid->混合云主机;CUBE->Cube, IP->IP类型;默认值为UHost。报文转发模式不支持UHybrid、CUBE、IP * * @return string|null */ @@ -124,7 +123,7 @@ public function getResourceType() } /** - * ResourceType: 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机; UDHost -> 私有专区主机;UDocker -> 容器;UHybrid->混合云主机;CUBE->Cube,USDP->智能大数据平台;默认值为UHost。报文转发模式不支持UDocker、UHybrid、CUBE + * ResourceType: 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机;UHybrid->混合云主机;CUBE->Cube, IP->IP类型;默认值为UHost。报文转发模式不支持UHybrid、CUBE、IP * * @param string $resourceType */ @@ -134,7 +133,7 @@ public function setResourceType($resourceType) } /** - * ResourceId: 所添加的后端资源的资源ID + * ResourceId: 所添加的后端资源的资源ID;与ResourceIP二选一必填 * * @return string|null */ @@ -144,7 +143,7 @@ public function getResourceId() } /** - * ResourceId: 所添加的后端资源的资源ID + * ResourceId: 所添加的后端资源的资源ID;与ResourceIP二选一必填 * * @param string $resourceId */ @@ -154,7 +153,7 @@ public function setResourceId($resourceId) } /** - * ResourceIP: 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 时有效,且必填 + * ResourceIP: 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 或 IP时有效,且必填;与ResourceId二选一必填 * * @return string|null */ @@ -164,7 +163,7 @@ public function getResourceIP() } /** - * ResourceIP: 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 时有效,且必填 + * ResourceIP: 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 或 IP时有效,且必填;与ResourceId二选一必填 * * @param string $resourceIP */ @@ -174,7 +173,7 @@ public function setResourceIP($resourceIP) } /** - * VPCId: 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 时有效,且必填 + * VPCId: 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 或 IP 时有效,且必填 * * @return string|null */ @@ -184,7 +183,7 @@ public function getVPCId() } /** - * VPCId: 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 时有效,且必填 + * VPCId: 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 或 IP 时有效,且必填 * * @param string $vpcId */ @@ -194,7 +193,7 @@ public function setVPCId($vpcId) } /** - * SubnetId: 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 时有效,且必填 + * SubnetId: 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 或 IP 时有效,且必填 * * @return string|null */ @@ -204,7 +203,7 @@ public function getSubnetId() } /** - * SubnetId: 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 时有效,且必填 + * SubnetId: 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 或 IP 时有效,且必填 * * @param string $subnetId */ diff --git a/src/ULB/Apis/AllocateBackendResponse.php b/src/ULB/Apis/AllocateBackendResponse.php index a67d9236..97d000cb 100644 --- a/src/ULB/Apis/AllocateBackendResponse.php +++ b/src/ULB/Apis/AllocateBackendResponse.php @@ -1,6 +1,6 @@ "CreateListener"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * Name: 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:“-”,“_”,“.”;默认值:listener + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:“-”,“_”,“.”;默认值:listener + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Remark: 监听器的备注信息。限定字符长度:[0-255] + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 监听器的备注信息。限定字符长度:[0-255] + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * ListenerPort: 监听器的监听端口。应用型限定取值:[1-65535],默认值80 + * + * @return integer|null + */ + public function getListenerPort() + { + return $this->get("ListenerPort"); + } + + /** + * ListenerPort: 监听器的监听端口。应用型限定取值:[1-65535],默认值80 + * + * @param int $listenerPort + */ + public function setListenerPort($listenerPort) + { + $this->set("ListenerPort", $listenerPort); + } + + /** + * ListenerProtocol: 监听协议。应用型限定取值:“HTTP”/"HTTPS",默认值“HTTP” + * + * @return string|null + */ + public function getListenerProtocol() + { + return $this->get("ListenerProtocol"); + } + + /** + * ListenerProtocol: 监听协议。应用型限定取值:“HTTP”/"HTTPS",默认值“HTTP” + * + * @param string $listenerProtocol + */ + public function setListenerProtocol($listenerProtocol) + { + $this->set("ListenerProtocol", $listenerProtocol); + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持,且必填;暂时只支持最大长度为1 + * + * @return string[]|null + */ + public function getCertificates() + { + return $this->get("Certificates"); + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持,且必填;暂时只支持最大长度为1 + * + * @param string[] $certificates + */ + public function setCertificates(array $certificates) + { + $this->set("Certificates", $certificates); + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;默认值“Default”,表示绑定原生策略 + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;默认值“Default”,表示绑定原生策略 + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400];默认值60 + * + * @return integer|null + */ + public function getIdleTimeout() + { + return $this->get("IdleTimeout"); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400];默认值60 + * + * @param int $idleTimeout + */ + public function setIdleTimeout($idleTimeout) + { + $this->set("IdleTimeout", $idleTimeout); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup",默认值"Roundrobin" + * + * @return string|null + */ + public function getScheduler() + { + return $this->get("Scheduler"); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup",默认值"Roundrobin" + * + * @param string $scheduler + */ + public function setScheduler($scheduler) + { + $this->set("Scheduler", $scheduler); + } + + /** + * StickinessConfig: + * + * @return CreateListenerParamStickinessConfig|null + */ + public function getStickinessConfig() + { + return new CreateListenerParamStickinessConfig($this->get("StickinessConfig")); + } + + /** + * StickinessConfig: + * + * @param CreateListenerParamStickinessConfig $stickinessConfig + */ + public function setStickinessConfig(array $stickinessConfig) + { + $this->set("StickinessConfig", $stickinessConfig->getAll()); + } + + /** + * HealthCheckConfig: + * + * @return CreateListenerParamHealthCheckConfig|null + */ + public function getHealthCheckConfig() + { + return new CreateListenerParamHealthCheckConfig($this->get("HealthCheckConfig")); + } + + /** + * HealthCheckConfig: + * + * @param CreateListenerParamHealthCheckConfig $healthCheckConfig + */ + public function setHealthCheckConfig(array $healthCheckConfig) + { + $this->set("HealthCheckConfig", $healthCheckConfig->getAll()); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩。默认值为:false + * + * @return boolean|null + */ + public function getCompressionEnabled() + { + return $this->get("CompressionEnabled"); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩。默认值为:false + * + * @param boolean $compressionEnabled + */ + public function setCompressionEnabled($compressionEnabled) + { + $this->set("CompressionEnabled", $compressionEnabled); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启;默认值为:false + * + * @return boolean|null + */ + public function getHTTP2Enabled() + { + return $this->get("HTTP2Enabled"); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启;默认值为:false + * + * @param boolean $http2Enabled + */ + public function setHTTP2Enabled($http2Enabled) + { + $this->set("HTTP2Enabled", $http2Enabled); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启;默认值为:false + * + * @return boolean|null + */ + public function getRedirectEnabled() + { + return $this->get("RedirectEnabled"); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启;默认值为:false + * + * @param boolean $redirectEnabled + */ + public function setRedirectEnabled($redirectEnabled) + { + $this->set("RedirectEnabled", $redirectEnabled); + } + + /** + * RedirectPort: (应用型专用)重定向端口。限定取值:[1-65535],默认值443 + * + * @return integer|null + */ + public function getRedirectPort() + { + return $this->get("RedirectPort"); + } + + /** + * RedirectPort: (应用型专用)重定向端口。限定取值:[1-65535],默认值443 + * + * @param int $redirectPort + */ + public function setRedirectPort($redirectPort) + { + $this->set("RedirectPort", $redirectPort); + } +} diff --git a/src/ULB/Apis/CreateListenerResponse.php b/src/ULB/Apis/CreateListenerResponse.php new file mode 100644 index 00000000..d0d782f1 --- /dev/null +++ b/src/ULB/Apis/CreateListenerResponse.php @@ -0,0 +1,44 @@ +get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } +} diff --git a/src/ULB/Apis/CreateLoadBalancerRequest.php b/src/ULB/Apis/CreateLoadBalancerRequest.php new file mode 100644 index 00000000..e29b7f79 --- /dev/null +++ b/src/ULB/Apis/CreateLoadBalancerRequest.php @@ -0,0 +1,273 @@ + "CreateLoadBalancer"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("VPCId"); + $this->markRequired("SubnetId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * VPCId: 负载均衡实例所属的VPC资源ID + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 负载均衡实例所属的VPC资源ID + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Name: 负载均衡实例的名称。默认值:lb;特殊字符仅支持:“-”,“_”,“.”;限定字符长度:[1-255] + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 负载均衡实例的名称。默认值:lb;特殊字符仅支持:“-”,“_”,“.”;限定字符长度:[1-255] + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Tag: 负载均衡实例所属的业务组ID。默认值为“Default”; 传空则为Default业务组 + * + * @return string|null + */ + public function getTag() + { + return $this->get("Tag"); + } + + /** + * Tag: 负载均衡实例所属的业务组ID。默认值为“Default”; 传空则为Default业务组 + * + * @param string $tag + */ + public function setTag($tag) + { + $this->set("Tag", $tag); + } + + /** + * Remark: 负载均衡实例的备注信息。限定字符长度:[0-255] + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 负载均衡实例的备注信息。限定字符长度:[0-255] + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * IPVersion: 负载均衡实例的IP协议。限定枚举值:"IPv4" / "IPv6"/"DualStack",默认值为:“IPv4” + * + * @return string|null + */ + public function getIPVersion() + { + return $this->get("IPVersion"); + } + + /** + * IPVersion: 负载均衡实例的IP协议。限定枚举值:"IPv4" / "IPv6"/"DualStack",默认值为:“IPv4” + * + * @param string $ipVersion + */ + public function setIPVersion($ipVersion) + { + $this->set("IPVersion", $ipVersion); + } + + /** + * ChargeType: 付费模式。限定枚举值:"Year" / "Month"/"Day"/"Dynamic",默认值为:“Month” + * + * @return string|null + */ + public function getChargeType() + { + return $this->get("ChargeType"); + } + + /** + * ChargeType: 付费模式。限定枚举值:"Year" / "Month"/"Day"/"Dynamic",默认值为:“Month” + * + * @param string $chargeType + */ + public function setChargeType($chargeType) + { + $this->set("ChargeType", $chargeType); + } + + /** + * Quantity: 购买的时长, 默认: 1; 0-> 购买至月末(0只在月付费有效,其余付费模式传0,实际收费按一个周期计费) + * + * @return integer|null + */ + public function getQuantity() + { + return $this->get("Quantity"); + } + + /** + * Quantity: 购买的时长, 默认: 1; 0-> 购买至月末(0只在月付费有效,其余付费模式传0,实际收费按一个周期计费) + * + * @param int $quantity + */ + public function setQuantity($quantity) + { + $this->set("Quantity", $quantity); + } + + /** + * CouponId: 代金券code + * + * @return string|null + */ + public function getCouponId() + { + return $this->get("CouponId"); + } + + /** + * CouponId: 代金券code + * + * @param string $couponId + */ + public function setCouponId($couponId) + { + $this->set("CouponId", $couponId); + } +} diff --git a/src/ULB/Apis/CreateLoadBalancerResponse.php b/src/ULB/Apis/CreateLoadBalancerResponse.php new file mode 100644 index 00000000..ac546184 --- /dev/null +++ b/src/ULB/Apis/CreateLoadBalancerResponse.php @@ -0,0 +1,44 @@ +get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } +} diff --git a/src/ULB/Apis/CreatePolicyRequest.php b/src/ULB/Apis/CreatePolicyRequest.php index eb162cd0..15f98702 100644 --- a/src/ULB/Apis/CreatePolicyRequest.php +++ b/src/ULB/Apis/CreatePolicyRequest.php @@ -1,6 +1,6 @@ set("Match", $match); } + /** + * DomainMatchMode: 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 + * + * @return string|null + */ + public function getDomainMatchMode() + { + return $this->get("DomainMatchMode"); + } + + /** + * DomainMatchMode: 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 + * + * @param string $domainMatchMode + */ + public function setDomainMatchMode($domainMatchMode) + { + $this->set("DomainMatchMode", $domainMatchMode); + } + /** * Type: 内容转发匹配字段的类型 * @@ -174,7 +194,7 @@ public function setType($type) } /** - * PolicyPriority: 策略优先级,1-9999 + * PolicyPriority: 策略优先级,1-9999;只针对路径规则生效 * * @return integer|null */ @@ -184,7 +204,7 @@ public function getPolicyPriority() } /** - * PolicyPriority: 策略优先级,1-9999 + * PolicyPriority: 策略优先级,1-9999;只针对路径规则生效 * * @param int $policyPriority */ diff --git a/src/ULB/Apis/CreatePolicyResponse.php b/src/ULB/Apis/CreatePolicyResponse.php index 7deb787c..3a025dcb 100644 --- a/src/ULB/Apis/CreatePolicyResponse.php +++ b/src/ULB/Apis/CreatePolicyResponse.php @@ -1,6 +1,6 @@ "CreateRule"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * RuleConditions: + * + * @return CreateRuleParamRuleConditions[]|null + */ + public function getRuleConditions() + { + $items = $this->get("RuleConditions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new CreateRuleParamRuleConditions($item)); + } + return $result; + } + + /** + * RuleConditions: + * + * @param CreateRuleParamRuleConditions[] $ruleConditions + */ + public function setRuleConditions(array $ruleConditions) + { + $result = []; + foreach ($ruleConditions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * RuleActions: + * + * @return CreateRuleParamRuleActions[]|null + */ + public function getRuleActions() + { + $items = $this->get("RuleActions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new CreateRuleParamRuleActions($item)); + } + return $result; + } + + /** + * RuleActions: + * + * @param CreateRuleParamRuleActions[] $ruleActions + */ + public function setRuleActions(array $ruleActions) + { + $result = []; + foreach ($ruleActions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略。默认值true + * + * @return boolean|null + */ + public function getPass() + { + return $this->get("Pass"); + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略。默认值true + * + * @param boolean $pass + */ + public function setPass($pass) + { + $this->set("Pass", $pass); + } +} diff --git a/src/ULB/Apis/CreateRuleResponse.php b/src/ULB/Apis/CreateRuleResponse.php new file mode 100644 index 00000000..faf5f578 --- /dev/null +++ b/src/ULB/Apis/CreateRuleResponse.php @@ -0,0 +1,44 @@ +get("RuleId"); + } + + /** + * RuleId: 转发规则的ID + * + * @param string $ruleId + */ + public function setRuleId($ruleId) + { + $this->set("RuleId", $ruleId); + } +} diff --git a/src/ULB/Apis/CreateSSLRequest.php b/src/ULB/Apis/CreateSSLRequest.php index 3e60befa..12c60cb9 100644 --- a/src/ULB/Apis/CreateSSLRequest.php +++ b/src/ULB/Apis/CreateSSLRequest.php @@ -1,6 +1,6 @@ set("CaCert", $caCert); } + + /** + * USSLId: USSL证书的ID + * + * @return string|null + */ + public function getUSSLId() + { + return $this->get("USSLId"); + } + + /** + * USSLId: USSL证书的ID + * + * @param string $usslId + */ + public function setUSSLId($usslId) + { + $this->set("USSLId", $usslId); + } } diff --git a/src/ULB/Apis/CreateSSLResponse.php b/src/ULB/Apis/CreateSSLResponse.php index 69e2ebd4..93e7005a 100644 --- a/src/ULB/Apis/CreateSSLResponse.php +++ b/src/ULB/Apis/CreateSSLResponse.php @@ -1,6 +1,6 @@ "CreateSecurityPolicy"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("TLSVersion"); + $this->markRequired("SSLCiphers"); + $this->markRequired("SecurityPolicyName"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * TLSVersion: TLS版本 + * + * @return string|null + */ + public function getTLSVersion() + { + return $this->get("TLSVersion"); + } + + /** + * TLSVersion: TLS版本 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SSLCiphers: 加密套件 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @return string|null + */ + public function getSecurityPolicyName() + { + return $this->get("SecurityPolicyName"); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @param string $securityPolicyName + */ + public function setSecurityPolicyName($securityPolicyName) + { + $this->set("SecurityPolicyName", $securityPolicyName); + } +} diff --git a/src/ULB/Apis/CreateSecurityPolicyResponse.php b/src/ULB/Apis/CreateSecurityPolicyResponse.php new file mode 100644 index 00000000..473b2cba --- /dev/null +++ b/src/ULB/Apis/CreateSecurityPolicyResponse.php @@ -0,0 +1,44 @@ +get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } +} diff --git a/src/ULB/Apis/CreateULBRequest.php b/src/ULB/Apis/CreateULBRequest.php index 8c9bdb51..f2f0fbc7 100644 --- a/src/ULB/Apis/CreateULBRequest.php +++ b/src/ULB/Apis/CreateULBRequest.php @@ -1,6 +1,6 @@ set("ResponseMsg", $responseMsg); } + + /** + * SecurityPolicyId: 安全策略组ID,默认值'Default' + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略组ID,默认值'Default' + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * EnableCompression: 0:关闭 1:开启,用于数据压缩功能 + * + * @return integer|null + */ + public function getEnableCompression() + { + return $this->get("EnableCompression"); + } + + /** + * EnableCompression: 0:关闭 1:开启,用于数据压缩功能 + * + * @param int $enableCompression + */ + public function setEnableCompression($enableCompression) + { + $this->set("EnableCompression", $enableCompression); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @return integer|null + */ + public function getForwardPort() + { + return $this->get("ForwardPort"); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @param int $forwardPort + */ + public function setForwardPort($forwardPort) + { + $this->set("ForwardPort", $forwardPort); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @return integer|null + */ + public function getEnableHTTP2() + { + return $this->get("EnableHTTP2"); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @param int $enableHTTP2 + */ + public function setEnableHTTP2($enableHTTP2) + { + $this->set("EnableHTTP2", $enableHTTP2); + } } diff --git a/src/ULB/Apis/CreateVServerResponse.php b/src/ULB/Apis/CreateVServerResponse.php index 685a2a5e..d3e1c064 100644 --- a/src/ULB/Apis/CreateVServerResponse.php +++ b/src/ULB/Apis/CreateVServerResponse.php @@ -1,6 +1,6 @@ "DeleteListener"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("RelatedRedirectDisabled"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * RelatedRedirectDisabled: 是否关闭相关监听器的重定向功能。默认为false,即有其他监听器重定向到本监听器,则删除失败。为true时,会先关闭相关监听器的重定向功能,再删除本监听器。默认值为:false + * + * @return boolean|null + */ + public function getRelatedRedirectDisabled() + { + return $this->get("RelatedRedirectDisabled"); + } + + /** + * RelatedRedirectDisabled: 是否关闭相关监听器的重定向功能。默认为false,即有其他监听器重定向到本监听器,则删除失败。为true时,会先关闭相关监听器的重定向功能,再删除本监听器。默认值为:false + * + * @param boolean $relatedRedirectDisabled + */ + public function setRelatedRedirectDisabled($relatedRedirectDisabled) + { + $this->set("RelatedRedirectDisabled", $relatedRedirectDisabled); + } +} diff --git a/src/ULB/Apis/DeleteListenerResponse.php b/src/ULB/Apis/DeleteListenerResponse.php new file mode 100644 index 00000000..9e577f44 --- /dev/null +++ b/src/ULB/Apis/DeleteListenerResponse.php @@ -0,0 +1,26 @@ + "DeleteLoadBalancer"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } +} diff --git a/src/ULB/Apis/DeleteLoadBalancerResponse.php b/src/ULB/Apis/DeleteLoadBalancerResponse.php new file mode 100644 index 00000000..39dec066 --- /dev/null +++ b/src/ULB/Apis/DeleteLoadBalancerResponse.php @@ -0,0 +1,26 @@ + "DeleteRule"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("RuleId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * RuleId: 应用型负载均衡的转发规则的ID + * + * @return string|null + */ + public function getRuleId() + { + return $this->get("RuleId"); + } + + /** + * RuleId: 应用型负载均衡的转发规则的ID + * + * @param string $ruleId + */ + public function setRuleId($ruleId) + { + $this->set("RuleId", $ruleId); + } +} diff --git a/src/ULB/Apis/DeleteRuleResponse.php b/src/ULB/Apis/DeleteRuleResponse.php new file mode 100644 index 00000000..9d3e8740 --- /dev/null +++ b/src/ULB/Apis/DeleteRuleResponse.php @@ -0,0 +1,26 @@ + "DeleteSSLBinding"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("SSLIds"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * SSLIds: SSLId的数组 + * + * @return string[]|null + */ + public function getSSLIds() + { + return $this->get("SSLIds"); + } + + /** + * SSLIds: SSLId的数组 + * + * @param string[] $sslIds + */ + public function setSSLIds(array $sslIds) + { + $this->set("SSLIds", $sslIds); + } +} diff --git a/src/ULB/Apis/DeleteSSLBindingResponse.php b/src/ULB/Apis/DeleteSSLBindingResponse.php new file mode 100644 index 00000000..0b04c75f --- /dev/null +++ b/src/ULB/Apis/DeleteSSLBindingResponse.php @@ -0,0 +1,26 @@ + "DeleteSecurityPolicy"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("SecurityPolicyId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } +} diff --git a/src/ULB/Apis/DeleteSecurityPolicyResponse.php b/src/ULB/Apis/DeleteSecurityPolicyResponse.php new file mode 100644 index 00000000..9f68bbef --- /dev/null +++ b/src/ULB/Apis/DeleteSecurityPolicyResponse.php @@ -0,0 +1,26 @@ + "DescribeListeners"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID。若指定ListenerId,则忽略LoadBalancerId。ListenId和LoadBalancerId必选其一 + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 应用型负载均衡监听器的ID。若指定ListenerId,则忽略LoadBalancerId。ListenId和LoadBalancerId必选其一 + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID。未指定ListenId,则描述指定的LoadBalancerId下的所有监听器。 + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID。未指定ListenId,则描述指定的LoadBalancerId下的所有监听器。 + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * Offset: 数据偏移量,默认为0 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 数据偏移量,默认为0 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } + + /** + * Limit: 数据分页值,默认为100 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 数据分页值,默认为100 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } +} diff --git a/src/ULB/Apis/DescribeListenersResponse.php b/src/ULB/Apis/DescribeListenersResponse.php new file mode 100644 index 00000000..3ed7d5ea --- /dev/null +++ b/src/ULB/Apis/DescribeListenersResponse.php @@ -0,0 +1,92 @@ +get("TotalCount"); + } + + /** + * TotalCount: 满足条件的负载均衡监听器总数 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } + + /** + * Listeners: 负载均衡监听器信息 + * + * @return Listener[]|null + */ + public function getListeners() + { + $items = $this->get("Listeners"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Listener($item)); + } + return $result; + } + + /** + * Listeners: 负载均衡监听器信息 + * + * @param Listener[] $listeners + */ + public function setListeners(array $listeners) + { + $result = []; + foreach ($listeners as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/DescribeLoadBalancersRequest.php b/src/ULB/Apis/DescribeLoadBalancersRequest.php new file mode 100644 index 00000000..8820eba3 --- /dev/null +++ b/src/ULB/Apis/DescribeLoadBalancersRequest.php @@ -0,0 +1,211 @@ + "DescribeLoadBalancers"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * ShowDetail: 是否获取监听器和后端服务节点的详细信息。默认值:false + * + * @return boolean|null + */ + public function getShowDetail() + { + return $this->get("ShowDetail"); + } + + /** + * ShowDetail: 是否获取监听器和后端服务节点的详细信息。默认值:false + * + * @param boolean $showDetail + */ + public function setShowDetail($showDetail) + { + $this->set("ShowDetail", $showDetail); + } + + /** + * LoadBalancerIds: 负载均衡实例的ID。必须是同一类型的实例,若指定了实例ID,将忽略除Type外的其他过滤条件 + * + * @return string[]|null + */ + public function getLoadBalancerIds() + { + return $this->get("LoadBalancerIds"); + } + + /** + * LoadBalancerIds: 负载均衡实例的ID。必须是同一类型的实例,若指定了实例ID,将忽略除Type外的其他过滤条件 + * + * @param string[] $loadBalancerIds + */ + public function setLoadBalancerIds(array $loadBalancerIds) + { + $this->set("LoadBalancerIds", $loadBalancerIds); + } + + /** + * VPCId: 限定所在的VPC + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 限定所在的VPC + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 限定所在的子网 + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 限定所在的子网 + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * Offset: 数据偏移量,默认为0 + * + * @return string|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 数据偏移量,默认为0 + * + * @param string $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } + + /** + * Limit: 数据分页值,默认为100 + * + * @return string|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 数据分页值,默认为100 + * + * @param string $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } +} diff --git a/src/ULB/Apis/DescribeLoadBalancersResponse.php b/src/ULB/Apis/DescribeLoadBalancersResponse.php new file mode 100644 index 00000000..b85dc2e2 --- /dev/null +++ b/src/ULB/Apis/DescribeLoadBalancersResponse.php @@ -0,0 +1,96 @@ +get("TotalCount"); + } + + /** + * TotalCount: 满足条件的负载均衡实例总数 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } + + /** + * LoadBalancers: 负载均衡实例信息 + * + * @return LoadBalancer[]|null + */ + public function getLoadBalancers() + { + $items = $this->get("LoadBalancers"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new LoadBalancer($item)); + } + return $result; + } + + /** + * LoadBalancers: 负载均衡实例信息 + * + * @param LoadBalancer[] $loadBalancers + */ + public function setLoadBalancers(array $loadBalancers) + { + $result = []; + foreach ($loadBalancers as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/DescribeRulesRequest.php b/src/ULB/Apis/DescribeRulesRequest.php new file mode 100644 index 00000000..18225073 --- /dev/null +++ b/src/ULB/Apis/DescribeRulesRequest.php @@ -0,0 +1,133 @@ + "DescribeRules"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 应用型负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * RuleId: 应用型负载均衡转发规则的ID。指定RuleId,则只描述该规则 + * + * @return string|null + */ + public function getRuleId() + { + return $this->get("RuleId"); + } + + /** + * RuleId: 应用型负载均衡转发规则的ID。指定RuleId,则只描述该规则 + * + * @param string $ruleId + */ + public function setRuleId($ruleId) + { + $this->set("RuleId", $ruleId); + } +} diff --git a/src/ULB/Apis/DescribeRulesResponse.php b/src/ULB/Apis/DescribeRulesResponse.php new file mode 100644 index 00000000..b362ba78 --- /dev/null +++ b/src/ULB/Apis/DescribeRulesResponse.php @@ -0,0 +1,67 @@ +get("Rules"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Rule($item)); + } + return $result; + } + + /** + * Rules: 转发规则信息 + * + * @param Rule[] $rules + */ + public function setRules(array $rules) + { + $result = []; + foreach ($rules as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/DescribeSSLRequest.php b/src/ULB/Apis/DescribeSSLRequest.php index d715c9e6..13cf2d33 100644 --- a/src/ULB/Apis/DescribeSSLRequest.php +++ b/src/ULB/Apis/DescribeSSLRequest.php @@ -1,6 +1,6 @@ "DescribeSSLV2"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SSLId: SSL证书的Id + * + * @return string|null + */ + public function getSSLId() + { + return $this->get("SSLId"); + } + + /** + * SSLId: SSL证书的Id + * + * @param string $sslId + */ + public function setSSLId($sslId) + { + $this->set("SSLId", $sslId); + } + + /** + * Limit: 数据分页值,默认为20 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 数据分页值,默认为20 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } + + /** + * Offset: 数据偏移量,默认值为0 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 数据偏移量,默认值为0 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } +} diff --git a/src/ULB/Apis/DescribeSSLV2Response.php b/src/ULB/Apis/DescribeSSLV2Response.php new file mode 100644 index 00000000..61029f0c --- /dev/null +++ b/src/ULB/Apis/DescribeSSLV2Response.php @@ -0,0 +1,78 @@ +get("TotalCount"); + } + + /** + * TotalCount: 满足条件的SSL证书总数 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } + + /** + * DataSet: SSL证书详细信息,具体结构见SSLInfo + * + * @return SSLInfo[]|null + */ + public function getDataSet() + { + $items = $this->get("DataSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new SSLInfo($item)); + } + return $result; + } + + /** + * DataSet: SSL证书详细信息,具体结构见SSLInfo + * + * @param SSLInfo[] $dataSet + */ + public function setDataSet(array $dataSet) + { + $result = []; + foreach ($dataSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/DescribeSecurityPoliciesRequest.php b/src/ULB/Apis/DescribeSecurityPoliciesRequest.php new file mode 100644 index 00000000..38e239a5 --- /dev/null +++ b/src/ULB/Apis/DescribeSecurityPoliciesRequest.php @@ -0,0 +1,131 @@ + "DescribeSecurityPolicies"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * Limit: 数据分页值 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 数据分页值 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } + + /** + * Offset: 数据偏移量 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 数据偏移量 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } +} diff --git a/src/ULB/Apis/DescribeSecurityPoliciesResponse.php b/src/ULB/Apis/DescribeSecurityPoliciesResponse.php new file mode 100644 index 00000000..0ba44770 --- /dev/null +++ b/src/ULB/Apis/DescribeSecurityPoliciesResponse.php @@ -0,0 +1,78 @@ +get("DataSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new SecurityPolicy($item)); + } + return $result; + } + + /** + * DataSet: 安全策略列表,每项参数详见SecurityPolicy + * + * @param SecurityPolicy[] $dataSet + */ + public function setDataSet(array $dataSet) + { + $result = []; + foreach ($dataSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * TotalCount: 满足条件的安全策略总数 + * + * @return integer|null + */ + public function getTotalCount() + { + return $this->get("TotalCount"); + } + + /** + * TotalCount: 满足条件的安全策略总数 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } +} diff --git a/src/ULB/Apis/DescribeSecurityPoliciesV2Request.php b/src/ULB/Apis/DescribeSecurityPoliciesV2Request.php new file mode 100644 index 00000000..37018440 --- /dev/null +++ b/src/ULB/Apis/DescribeSecurityPoliciesV2Request.php @@ -0,0 +1,131 @@ + "DescribeSecurityPoliciesV2"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * Limit: 数据分页值 + * + * @return integer|null + */ + public function getLimit() + { + return $this->get("Limit"); + } + + /** + * Limit: 数据分页值 + * + * @param int $limit + */ + public function setLimit($limit) + { + $this->set("Limit", $limit); + } + + /** + * Offset: 数据偏移量 + * + * @return integer|null + */ + public function getOffset() + { + return $this->get("Offset"); + } + + /** + * Offset: 数据偏移量 + * + * @param int $offset + */ + public function setOffset($offset) + { + $this->set("Offset", $offset); + } +} diff --git a/src/ULB/Apis/DescribeSecurityPoliciesV2Response.php b/src/ULB/Apis/DescribeSecurityPoliciesV2Response.php new file mode 100644 index 00000000..655ee171 --- /dev/null +++ b/src/ULB/Apis/DescribeSecurityPoliciesV2Response.php @@ -0,0 +1,78 @@ +get("DataSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new SecurityPolicyInfo($item)); + } + return $result; + } + + /** + * DataSet: 安全策略列表,每项参数详见SecurityPolicyInfo + * + * @param SecurityPolicyInfo[] $dataSet + */ + public function setDataSet(array $dataSet) + { + $result = []; + foreach ($dataSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * TotalCount: 满足条件的安全策略总数 + * + * @return integer|null + */ + public function getTotalCount() + { + return $this->get("TotalCount"); + } + + /** + * TotalCount: 满足条件的安全策略总数 + * + * @param int $totalCount + */ + public function setTotalCount($totalCount) + { + $this->set("TotalCount", $totalCount); + } +} diff --git a/src/ULB/Apis/DescribeSupportCiphersRequest.php b/src/ULB/Apis/DescribeSupportCiphersRequest.php new file mode 100644 index 00000000..0b79c4cc --- /dev/null +++ b/src/ULB/Apis/DescribeSupportCiphersRequest.php @@ -0,0 +1,71 @@ + "DescribeSupportCiphers"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } +} diff --git a/src/ULB/Apis/DescribeSupportCiphersResponse.php b/src/ULB/Apis/DescribeSupportCiphersResponse.php new file mode 100644 index 00000000..01204970 --- /dev/null +++ b/src/ULB/Apis/DescribeSupportCiphersResponse.php @@ -0,0 +1,57 @@ +get("DataSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new TLSAndCiphers($item)); + } + return $result; + } + + /** + * DataSet: 返回支持的TLS最低版本和加密套件,每项参数详见 TLSAndCiphers + * + * @param TLSAndCiphers[] $dataSet + */ + public function setDataSet(array $dataSet) + { + $result = []; + foreach ($dataSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/DescribeULBRequest.php b/src/ULB/Apis/DescribeULBRequest.php index 1df7cbc5..82732854 100644 --- a/src/ULB/Apis/DescribeULBRequest.php +++ b/src/ULB/Apis/DescribeULBRequest.php @@ -1,6 +1,6 @@ "RemoveTargets"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("Ids"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * Ids: 服务节点的标识ID。不超过20个; + * + * @return string[]|null + */ + public function getIds() + { + return $this->get("Ids"); + } + + /** + * Ids: 服务节点的标识ID。不超过20个; + * + * @param string[] $ids + */ + public function setIds(array $ids) + { + $this->set("Ids", $ids); + } +} diff --git a/src/ULB/Apis/RemoveTargetsResponse.php b/src/ULB/Apis/RemoveTargetsResponse.php new file mode 100644 index 00000000..5a026b17 --- /dev/null +++ b/src/ULB/Apis/RemoveTargetsResponse.php @@ -0,0 +1,26 @@ + "UnBindSecurityPolicy"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("SecurityPolicyId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } +} diff --git a/src/ULB/Apis/UnBindSecurityPolicyResponse.php b/src/ULB/Apis/UnBindSecurityPolicyResponse.php new file mode 100644 index 00000000..dc03532e --- /dev/null +++ b/src/ULB/Apis/UnBindSecurityPolicyResponse.php @@ -0,0 +1,26 @@ + "UpdateBackendBatch"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("ULBId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * ULBId: 负载均衡资源ID + * + * @return string|null + */ + public function getULBId() + { + return $this->get("ULBId"); + } + + /** + * ULBId: 负载均衡资源ID + * + * @param string $ulbId + */ + public function setULBId($ulbId) + { + $this->set("ULBId", $ulbId); + } + + /** + * Attributes: + * + * @return UpdateBackendBatchParamAttributes[]|null + */ + public function getAttributes() + { + $items = $this->get("Attributes"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UpdateBackendBatchParamAttributes($item)); + } + return $result; + } + + /** + * Attributes: + * + * @param UpdateBackendBatchParamAttributes[] $attributes + */ + public function setAttributes(array $attributes) + { + $result = []; + foreach ($attributes as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/UpdateBackendBatchResponse.php b/src/ULB/Apis/UpdateBackendBatchResponse.php new file mode 100644 index 00000000..13361a5f --- /dev/null +++ b/src/ULB/Apis/UpdateBackendBatchResponse.php @@ -0,0 +1,57 @@ +get("BackendSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new BackendMsg($item)); + } + return $result; + } + + /** + * BackendSet: 返回ulb对每个rs的修改是否成功 + * + * @param BackendMsg[] $backendSet + */ + public function setBackendSet(array $backendSet) + { + $result = []; + foreach ($backendSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/UpdateListenerAttributeRequest.php b/src/ULB/Apis/UpdateListenerAttributeRequest.php new file mode 100644 index 00000000..562b0d74 --- /dev/null +++ b/src/ULB/Apis/UpdateListenerAttributeRequest.php @@ -0,0 +1,355 @@ + "UpdateListenerAttribute"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * Name: 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:-_. + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:-_. + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Remark: 监听器的备注信息。限定字符长度:[0-255] + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 监听器的备注信息。限定字符长度:[0-255] + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持 + * + * @return string[]|null + */ + public function getCertificates() + { + return $this->get("Certificates"); + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持 + * + * @param string[] $certificates + */ + public function setCertificates(array $certificates) + { + $this->set("Certificates", $certificates); + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定。“Default”,表示绑定原生策略 + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定。“Default”,表示绑定原生策略 + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400] + * + * @return integer|null + */ + public function getIdleTimeout() + { + return $this->get("IdleTimeout"); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400] + * + * @param int $idleTimeout + */ + public function setIdleTimeout($idleTimeout) + { + $this->set("IdleTimeout", $idleTimeout); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup" + * + * @return string|null + */ + public function getScheduler() + { + return $this->get("Scheduler"); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup" + * + * @param string $scheduler + */ + public function setScheduler($scheduler) + { + $this->set("Scheduler", $scheduler); + } + + /** + * StickinessConfig: + * + * @return UpdateListenerAttributeParamStickinessConfig|null + */ + public function getStickinessConfig() + { + return new UpdateListenerAttributeParamStickinessConfig($this->get("StickinessConfig")); + } + + /** + * StickinessConfig: + * + * @param UpdateListenerAttributeParamStickinessConfig $stickinessConfig + */ + public function setStickinessConfig(array $stickinessConfig) + { + $this->set("StickinessConfig", $stickinessConfig->getAll()); + } + + /** + * HealthCheckConfig: + * + * @return UpdateListenerAttributeParamHealthCheckConfig|null + */ + public function getHealthCheckConfig() + { + return new UpdateListenerAttributeParamHealthCheckConfig($this->get("HealthCheckConfig")); + } + + /** + * HealthCheckConfig: + * + * @param UpdateListenerAttributeParamHealthCheckConfig $healthCheckConfig + */ + public function setHealthCheckConfig(array $healthCheckConfig) + { + $this->set("HealthCheckConfig", $healthCheckConfig->getAll()); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * + * @return boolean|null + */ + public function getCompressionEnabled() + { + return $this->get("CompressionEnabled"); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * + * @param boolean $compressionEnabled + */ + public function setCompressionEnabled($compressionEnabled) + { + $this->set("CompressionEnabled", $compressionEnabled); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * + * @return boolean|null + */ + public function getHTTP2Enabled() + { + return $this->get("HTTP2Enabled"); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * + * @param boolean $http2Enabled + */ + public function setHTTP2Enabled($http2Enabled) + { + $this->set("HTTP2Enabled", $http2Enabled); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * + * @return boolean|null + */ + public function getRedirectEnabled() + { + return $this->get("RedirectEnabled"); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * + * @param boolean $redirectEnabled + */ + public function setRedirectEnabled($redirectEnabled) + { + $this->set("RedirectEnabled", $redirectEnabled); + } + + /** + * RedirectPort: (应用型专用)重定向端口。限定取值:[1-65535] + * + * @return integer|null + */ + public function getRedirectPort() + { + return $this->get("RedirectPort"); + } + + /** + * RedirectPort: (应用型专用)重定向端口。限定取值:[1-65535] + * + * @param int $redirectPort + */ + public function setRedirectPort($redirectPort) + { + $this->set("RedirectPort", $redirectPort); + } +} diff --git a/src/ULB/Apis/UpdateListenerAttributeResponse.php b/src/ULB/Apis/UpdateListenerAttributeResponse.php new file mode 100644 index 00000000..f949a9b0 --- /dev/null +++ b/src/ULB/Apis/UpdateListenerAttributeResponse.php @@ -0,0 +1,26 @@ + "UpdateLoadBalancerAttribute"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * Name: 负载均衡实例的名称,不传则默认不修改 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 负载均衡实例的名称,不传则默认不修改 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Tag: 负载均衡实例所属的业务组ID,不传则默认不修改 + * + * @return string|null + */ + public function getTag() + { + return $this->get("Tag"); + } + + /** + * Tag: 负载均衡实例所属的业务组ID,不传则默认不修改 + * + * @param string $tag + */ + public function setTag($tag) + { + $this->set("Tag", $tag); + } + + /** + * Remark: 负载均衡实例的备注信息,不传则默认不修改,限定字符长度:[0-255] + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 负载均衡实例的备注信息,不传则默认不修改,限定字符长度:[0-255] + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * AccessLogConfig: + * + * @return UpdateLoadBalancerAttributeParamAccessLogConfig|null + */ + public function getAccessLogConfig() + { + return new UpdateLoadBalancerAttributeParamAccessLogConfig($this->get("AccessLogConfig")); + } + + /** + * AccessLogConfig: + * + * @param UpdateLoadBalancerAttributeParamAccessLogConfig $accessLogConfig + */ + public function setAccessLogConfig(array $accessLogConfig) + { + $this->set("AccessLogConfig", $accessLogConfig->getAll()); + } +} diff --git a/src/ULB/Apis/UpdateLoadBalancerAttributeResponse.php b/src/ULB/Apis/UpdateLoadBalancerAttributeResponse.php new file mode 100644 index 00000000..2276ff4f --- /dev/null +++ b/src/ULB/Apis/UpdateLoadBalancerAttributeResponse.php @@ -0,0 +1,26 @@ +get("PolicyPriority"); + } + + /** + * PolicyPriority: 策略优先级,1-9999;只针对路径规则生效 + * + * @param int $policyPriority + */ + public function setPolicyPriority($policyPriority) + { + $this->set("PolicyPriority", $policyPriority); + } + + /** + * DomainMatchMode: 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 + * + * @return string|null + */ + public function getDomainMatchMode() + { + return $this->get("DomainMatchMode"); + } + + /** + * DomainMatchMode: 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 + * + * @param string $domainMatchMode + */ + public function setDomainMatchMode($domainMatchMode) + { + $this->set("DomainMatchMode", $domainMatchMode); + } + + /** + * PolicyId: 传统型负载均衡转发规则的ID,当Type为Default时,可以不传或为空 * * @return string|null */ @@ -143,7 +183,7 @@ public function getPolicyId() } /** - * PolicyId: 转发规则的ID,当Type为Default时,可以不传或为空 + * PolicyId: 传统型负载均衡转发规则的ID,当Type为Default时,可以不传或为空 * * @param string $policyId */ @@ -153,7 +193,7 @@ public function setPolicyId($policyId) } /** - * BackendId: 内容转发策略应用的后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 + * BackendId: 内容转发策略应用的后端资源实例的ID(CLB的后端节点Id),来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 * * @return string[]|null */ @@ -163,7 +203,7 @@ public function getBackendId() } /** - * BackendId: 内容转发策略应用的后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 + * BackendId: 内容转发策略应用的后端资源实例的ID(CLB的后端节点Id),来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 * * @param string[] $backendId */ diff --git a/src/ULB/Apis/UpdatePolicyResponse.php b/src/ULB/Apis/UpdatePolicyResponse.php index b110c8b5..037ef8b2 100644 --- a/src/ULB/Apis/UpdatePolicyResponse.php +++ b/src/ULB/Apis/UpdatePolicyResponse.php @@ -1,6 +1,6 @@ "UpdateRuleAttribute"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + $this->markRequired("RuleId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * RuleId: 转发规则的ID + * + * @return string|null + */ + public function getRuleId() + { + return $this->get("RuleId"); + } + + /** + * RuleId: 转发规则的ID + * + * @param string $ruleId + */ + public function setRuleId($ruleId) + { + $this->set("RuleId", $ruleId); + } + + /** + * RuleConditions: + * + * @return UpdateRuleAttributeParamRuleConditions[]|null + */ + public function getRuleConditions() + { + $items = $this->get("RuleConditions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UpdateRuleAttributeParamRuleConditions($item)); + } + return $result; + } + + /** + * RuleConditions: + * + * @param UpdateRuleAttributeParamRuleConditions[] $ruleConditions + */ + public function setRuleConditions(array $ruleConditions) + { + $result = []; + foreach ($ruleConditions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * RuleActions: + * + * @return UpdateRuleAttributeParamRuleActions[]|null + */ + public function getRuleActions() + { + $items = $this->get("RuleActions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UpdateRuleAttributeParamRuleActions($item)); + } + return $result; + } + + /** + * RuleActions: + * + * @param UpdateRuleAttributeParamRuleActions[] $ruleActions + */ + public function setRuleActions(array $ruleActions) + { + $result = []; + foreach ($ruleActions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略。默认转发规则不可更改 + * + * @return boolean|null + */ + public function getPass() + { + return $this->get("Pass"); + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略。默认转发规则不可更改 + * + * @param boolean $pass + */ + public function setPass($pass) + { + $this->set("Pass", $pass); + } +} diff --git a/src/ULB/Apis/UpdateRuleAttributeResponse.php b/src/ULB/Apis/UpdateRuleAttributeResponse.php new file mode 100644 index 00000000..951e04cf --- /dev/null +++ b/src/ULB/Apis/UpdateRuleAttributeResponse.php @@ -0,0 +1,26 @@ + "UpdateSSLBinding"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("OldSSLId"); + $this->markRequired("NewSSLId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * OldSSLId: 监听器实例绑定的旧的证书 + * + * @return string|null + */ + public function getOldSSLId() + { + return $this->get("OldSSLId"); + } + + /** + * OldSSLId: 监听器实例绑定的旧的证书 + * + * @param string $oldSSLId + */ + public function setOldSSLId($oldSSLId) + { + $this->set("OldSSLId", $oldSSLId); + } + + /** + * NewSSLId: 监听器实例需要绑定的新的证书 + * + * @return string|null + */ + public function getNewSSLId() + { + return $this->get("NewSSLId"); + } + + /** + * NewSSLId: 监听器实例需要绑定的新的证书 + * + * @param string $newSSLId + */ + public function setNewSSLId($newSSLId) + { + $this->set("NewSSLId", $newSSLId); + } + + /** + * LoadBalancerId: 所操作LB实例ID(仅LoadBalancerId传参时,将更换该LB所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系)(LB指CLB或ALB) + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 所操作LB实例ID(仅LoadBalancerId传参时,将更换该LB所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系)(LB指CLB或ALB) + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 所操作监听器实例ID(仅ListenerId传参时,将更换该监听器所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系;若LoadBalancerId与ListenerId皆有传参,则会强校验ULB与Vsserver的所属关系,将更换该ulb下vserver所绑定的OldSSLId为NewSSLId)(监听器指VServer或Listener) + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 所操作监听器实例ID(仅ListenerId传参时,将更换该监听器所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系;若LoadBalancerId与ListenerId皆有传参,则会强校验ULB与Vsserver的所属关系,将更换该ulb下vserver所绑定的OldSSLId为NewSSLId)(监听器指VServer或Listener) + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } +} diff --git a/src/ULB/Apis/UpdateSSLBindingResponse.php b/src/ULB/Apis/UpdateSSLBindingResponse.php new file mode 100644 index 00000000..3ebe06bf --- /dev/null +++ b/src/ULB/Apis/UpdateSSLBindingResponse.php @@ -0,0 +1,26 @@ + "UpdateSecurityPolicy"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("SecurityPolicyId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * SSLCiphers: 加密套件,TLS最低版本和加密套件必须全不为空或全为空 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件,TLS最低版本和加密套件必须全不为空或全为空 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } + + /** + * TLSVersion: TLS最低版本,TLS最低版本和加密套件必须全不为空或全为空 + * + * @return string|null + */ + public function getTLSVersion() + { + return $this->get("TLSVersion"); + } + + /** + * TLSVersion: TLS最低版本,TLS最低版本和加密套件必须全不为空或全为空 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @return string|null + */ + public function getSecurityPolicyName() + { + return $this->get("SecurityPolicyName"); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @param string $securityPolicyName + */ + public function setSecurityPolicyName($securityPolicyName) + { + $this->set("SecurityPolicyName", $securityPolicyName); + } +} diff --git a/src/ULB/Apis/UpdateSecurityPolicyResponse.php b/src/ULB/Apis/UpdateSecurityPolicyResponse.php new file mode 100644 index 00000000..32e5e73b --- /dev/null +++ b/src/ULB/Apis/UpdateSecurityPolicyResponse.php @@ -0,0 +1,26 @@ + "UpdateTargetsAttribute"]); + $this->markRequired("Region"); + $this->markRequired("ProjectId"); + $this->markRequired("LoadBalancerId"); + $this->markRequired("ListenerId"); + } + + + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getRegion() + { + return $this->get("Region"); + } + + /** + * Region: 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $region + */ + public function setRegion($region) + { + $this->set("Region", $region); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @return string|null + */ + public function getProjectId() + { + return $this->get("ProjectId"); + } + + /** + * ProjectId: 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * + * @param string $projectId + */ + public function setProjectId($projectId) + { + $this->set("ProjectId", $projectId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * Targets: + * + * @return UpdateTargetsAttributeParamTargets[]|null + */ + public function getTargets() + { + $items = $this->get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UpdateTargetsAttributeParamTargets($item)); + } + return $result; + } + + /** + * Targets: + * + * @param UpdateTargetsAttributeParamTargets[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Apis/UpdateTargetsAttributeResponse.php b/src/ULB/Apis/UpdateTargetsAttributeResponse.php new file mode 100644 index 00000000..aca9fa27 --- /dev/null +++ b/src/ULB/Apis/UpdateTargetsAttributeResponse.php @@ -0,0 +1,26 @@ +set("Remark", $remark); } + + /** + * EnableLog: 日志开关,1代表开启日志,0代表关闭日志,传1时必须同时传BucketName,TokenName与TokenId二选一 + * + * @return integer|null + */ + public function getEnableLog() + { + return $this->get("EnableLog"); + } + + /** + * EnableLog: 日志开关,1代表开启日志,0代表关闭日志,传1时必须同时传BucketName,TokenName与TokenId二选一 + * + * @param int $enableLog + */ + public function setEnableLog($enableLog) + { + $this->set("EnableLog", $enableLog); + } + + /** + * BucketName: 设置用于存储ulb日志的bucket + * + * @return string|null + */ + public function getBucketName() + { + return $this->get("BucketName"); + } + + /** + * BucketName: 设置用于存储ulb日志的bucket + * + * @param string $bucketName + */ + public function setBucketName($bucketName) + { + $this->set("BucketName", $bucketName); + } + + /** + * TokenName: 用于指定上传到bucket所需的token,与TokenId选填其一即可 + * + * @return string|null + */ + public function getTokenName() + { + return $this->get("TokenName"); + } + + /** + * TokenName: 用于指定上传到bucket所需的token,与TokenId选填其一即可 + * + * @param string $tokenName + */ + public function setTokenName($tokenName) + { + $this->set("TokenName", $tokenName); + } + + /** + * TokenId: 用于指定上传到bucket所需的token,与TokenName选填其一即可 + * + * @return string|null + */ + public function getTokenId() + { + return $this->get("TokenId"); + } + + /** + * TokenId: 用于指定上传到bucket所需的token,与TokenName选填其一即可 + * + * @param string $tokenId + */ + public function setTokenId($tokenId) + { + $this->set("TokenId", $tokenId); + } + + /** + * IsWAFOn: 是否开启WAF。枚举类型:Yes,No,默认值为No + * + * @return string|null + */ + public function getIsWAFOn() + { + return $this->get("IsWAFOn"); + } + + /** + * IsWAFOn: 是否开启WAF。枚举类型:Yes,No,默认值为No + * + * @param string $isWAFOn + */ + public function setIsWAFOn($isWAFOn) + { + $this->set("IsWAFOn", $isWAFOn); + } } diff --git a/src/ULB/Apis/UpdateULBAttributeResponse.php b/src/ULB/Apis/UpdateULBAttributeResponse.php index 690a9329..50ff0eb5 100644 --- a/src/ULB/Apis/UpdateULBAttributeResponse.php +++ b/src/ULB/Apis/UpdateULBAttributeResponse.php @@ -1,6 +1,6 @@ set("ResponseMsg", $responseMsg); } + + /** + * SecurityPolicyId: 安全策略组ID + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略组ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * EnableCompression: 0:关闭 1:开启,用于数据压缩功能 + * + * @return integer|null + */ + public function getEnableCompression() + { + return $this->get("EnableCompression"); + } + + /** + * EnableCompression: 0:关闭 1:开启,用于数据压缩功能 + * + * @param int $enableCompression + */ + public function setEnableCompression($enableCompression) + { + $this->set("EnableCompression", $enableCompression); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @return integer|null + */ + public function getForwardPort() + { + return $this->get("ForwardPort"); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @param int $forwardPort + */ + public function setForwardPort($forwardPort) + { + $this->set("ForwardPort", $forwardPort); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @return integer|null + */ + public function getEnableHTTP2() + { + return $this->get("EnableHTTP2"); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @param int $enableHTTP2 + */ + public function setEnableHTTP2($enableHTTP2) + { + $this->set("EnableHTTP2", $enableHTTP2); + } } diff --git a/src/ULB/Apis/UpdateVServerAttributeResponse.php b/src/ULB/Apis/UpdateVServerAttributeResponse.php index c692cbb2..96ccb245 100644 --- a/src/ULB/Apis/UpdateVServerAttributeResponse.php +++ b/src/ULB/Apis/UpdateVServerAttributeResponse.php @@ -1,6 +1,6 @@ get("Enabled"); + } + + /** + * Enabled: (应用型专用)是否开启访问日志记录功能 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * US3BucketName: (应用型专用)用于存储访问日志的bucket + * + * @return string|null + */ + public function getUS3BucketName() + { + return $this->get("US3BucketName"); + } + + /** + * US3BucketName: (应用型专用)用于存储访问日志的bucket + * + * @param string $us3BucketName + */ + public function setUS3BucketName($us3BucketName) + { + $this->set("US3BucketName", $us3BucketName); + } + + /** + * US3TokenId: (应用型专用)上传访问日志到bucket所需的token + * + * @return string|null + */ + public function getUS3TokenId() + { + return $this->get("US3TokenId"); + } + + /** + * US3TokenId: (应用型专用)上传访问日志到bucket所需的token + * + * @param string $us3TokenId + */ + public function setUS3TokenId($us3TokenId) + { + $this->set("US3TokenId", $us3TokenId); + } +} diff --git a/src/ULB/Models/BackendMsg.php b/src/ULB/Models/BackendMsg.php new file mode 100644 index 00000000..60a6650d --- /dev/null +++ b/src/ULB/Models/BackendMsg.php @@ -0,0 +1,84 @@ +get("BackendId"); + } + + /** + * BackendId: rs的资源ID + * + * @param string $backendId + */ + public function setBackendId($backendId) + { + $this->set("BackendId", $backendId); + } + + /** + * SubMessage: 修改rs返回的消息 + * + * @return string|null + */ + public function getSubMessage() + { + return $this->get("SubMessage"); + } + + /** + * SubMessage: 修改rs返回的消息 + * + * @param string $subMessage + */ + public function setSubMessage($subMessage) + { + $this->set("SubMessage", $subMessage); + } + + /** + * SubRetCode: 修改rs的返回值 + * + * @return integer|null + */ + public function getSubRetCode() + { + return $this->get("SubRetCode"); + } + + /** + * SubRetCode: 修改rs的返回值 + * + * @param int $subRetCode + */ + public function setSubRetCode($subRetCode) + { + $this->set("SubRetCode", $subRetCode); + } +} diff --git a/src/ULB/Models/BindSecurityPolicy.php b/src/ULB/Models/BindSecurityPolicy.php new file mode 100644 index 00000000..8e9991ec --- /dev/null +++ b/src/ULB/Models/BindSecurityPolicy.php @@ -0,0 +1,124 @@ +get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略组ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * SecurityPolicyName: 安全策略组名称 + * + * @return string|null + */ + public function getSecurityPolicyName() + { + return $this->get("SecurityPolicyName"); + } + + /** + * SecurityPolicyName: 安全策略组名称 + * + * @param string $securityPolicyName + */ + public function setSecurityPolicyName($securityPolicyName) + { + $this->set("SecurityPolicyName", $securityPolicyName); + } + + /** + * TLSVersion: TLS最低版本 + * + * @return string|null + */ + public function getTLSVersion() + { + return $this->get("TLSVersion"); + } + + /** + * TLSVersion: TLS最低版本 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SSLCiphers: 加密套件 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @return integer|null + */ + public function getSecurityPolicyType() + { + return $this->get("SecurityPolicyType"); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @param int $securityPolicyType + */ + public function setSecurityPolicyType($securityPolicyType) + { + $this->set("SecurityPolicyType", $securityPolicyType); + } +} diff --git a/src/ULB/Models/BindVServerInfo.php b/src/ULB/Models/BindVServerInfo.php new file mode 100644 index 00000000..94ac7dab --- /dev/null +++ b/src/ULB/Models/BindVServerInfo.php @@ -0,0 +1,104 @@ +get("VServerId"); + } + + /** + * VServerId: 绑定的VServerId + * + * @param string $vServerId + */ + public function setVServerId($vServerId) + { + $this->set("VServerId", $vServerId); + } + + /** + * VServerName: 绑定的VServer名称 + * + * @return string|null + */ + public function getVServerName() + { + return $this->get("VServerName"); + } + + /** + * VServerName: 绑定的VServer名称 + * + * @param string $vServerName + */ + public function setVServerName($vServerName) + { + $this->set("VServerName", $vServerName); + } + + /** + * Port: VServer端口 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: VServer端口 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * ULBId: ULB的ID + * + * @return string|null + */ + public function getULBId() + { + return $this->get("ULBId"); + } + + /** + * ULBId: ULB的ID + * + * @param string $ulbId + */ + public function setULBId($ulbId) + { + $this->set("ULBId", $ulbId); + } +} diff --git a/src/ULB/Models/Certificate.php b/src/ULB/Models/Certificate.php new file mode 100644 index 00000000..ed33961a --- /dev/null +++ b/src/ULB/Models/Certificate.php @@ -0,0 +1,64 @@ +get("SSLId"); + } + + /** + * SSLId: 证书ID + * + * @param string $sslId + */ + public function setSSLId($sslId) + { + $this->set("SSLId", $sslId); + } + + /** + * IsDefault: 是否为默认证书 + * + * @return boolean|null + */ + public function getIsDefault() + { + return $this->get("IsDefault"); + } + + /** + * IsDefault: 是否为默认证书 + * + * @param boolean $isDefault + */ + public function setIsDefault($isDefault) + { + $this->set("IsDefault", $isDefault); + } +} diff --git a/src/ULB/Models/CorsConfigSet.php b/src/ULB/Models/CorsConfigSet.php new file mode 100644 index 00000000..edf4f6e6 --- /dev/null +++ b/src/ULB/Models/CorsConfigSet.php @@ -0,0 +1,144 @@ +get("AllowOrigin"); + } + + /** + * AllowOrigin: 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * + * @param string[] $allowOrigin + */ + public function setAllowOrigin(array $allowOrigin) + { + $this->set("AllowOrigin", $allowOrigin); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getAllowHeaders() + { + return $this->get("AllowHeaders"); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $allowHeaders + */ + public function setAllowHeaders(array $allowHeaders) + { + $this->set("AllowHeaders", $allowHeaders); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getExposeHeaders() + { + return $this->get("ExposeHeaders"); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $exposeHeaders + */ + public function setExposeHeaders(array $exposeHeaders) + { + $this->set("ExposeHeaders", $exposeHeaders); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GETPOSTPUTDELETEHEADOPTIONSPATCH + * + * @return string[]|null + */ + public function getAllowMethods() + { + return $this->get("AllowMethods"); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GETPOSTPUTDELETEHEADOPTIONSPATCH + * + * @param string[] $allowMethods + */ + public function setAllowMethods(array $allowMethods) + { + $this->set("AllowMethods", $allowMethods); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @return string|null + */ + public function getAllowCredentials() + { + return $this->get("AllowCredentials"); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @param string $allowCredentials + */ + public function setAllowCredentials($allowCredentials) + { + $this->set("AllowCredentials", $allowCredentials); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @return integer|null + */ + public function getMaxAge() + { + return $this->get("MaxAge"); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @param int $maxAge + */ + public function setMaxAge($maxAge) + { + $this->set("MaxAge", $maxAge); + } +} diff --git a/src/ULB/Models/FirewallSet.php b/src/ULB/Models/FirewallSet.php index 532cbbd4..f35f759e 100644 --- a/src/ULB/Models/FirewallSet.php +++ b/src/ULB/Models/FirewallSet.php @@ -1,6 +1,6 @@ get("HttpCode"); + } + + /** + * HttpCode: 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * + * @param int $httpCode + */ + public function setHttpCode($httpCode) + { + $this->set("HttpCode", $httpCode); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @return string|null + */ + public function getContent() + { + return $this->get("Content"); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @param string $content + */ + public function setContent($content) + { + $this->set("Content", $content); + } +} diff --git a/src/ULB/Models/ForwardConfigSet.php b/src/ULB/Models/ForwardConfigSet.php new file mode 100644 index 00000000..479d6658 --- /dev/null +++ b/src/ULB/Models/ForwardConfigSet.php @@ -0,0 +1,56 @@ +get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new ForwardTargetSet($item)); + } + return $result; + } + + /** + * Targets: 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet + * + * @param ForwardTargetSet[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Models/ForwardTargetSet.php b/src/ULB/Models/ForwardTargetSet.php new file mode 100644 index 00000000..69875b83 --- /dev/null +++ b/src/ULB/Models/ForwardTargetSet.php @@ -0,0 +1,64 @@ +get("Id"); + } + + /** + * Id: 服务节点的标识ID + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * Weight: 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } +} diff --git a/src/ULB/Models/HealthCheckConfigSet.php b/src/ULB/Models/HealthCheckConfigSet.php new file mode 100644 index 00000000..ddda96dd --- /dev/null +++ b/src/ULB/Models/HealthCheckConfigSet.php @@ -0,0 +1,104 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启健康检查功能。暂时不支持关闭。 默认值为:true + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查; 默认值:Port + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 健康检查方式。应用型限定取值: Port -> 端口检查;HTTP -> HTTP检查; 默认值:Port + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Domain: (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名 + * + * @return string|null + */ + public function getDomain() + { + return $this->get("Domain"); + } + + /** + * Domain: (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名 + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->set("Domain", $domain); + } + + /** + * Path: (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径 + * + * @return string|null + */ + public function getPath() + { + return $this->get("Path"); + } + + /** + * Path: (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径 + * + * @param string $path + */ + public function setPath($path) + { + $this->set("Path", $path); + } +} diff --git a/src/ULB/Models/HostConfigSet.php b/src/ULB/Models/HostConfigSet.php new file mode 100644 index 00000000..89bd531a --- /dev/null +++ b/src/ULB/Models/HostConfigSet.php @@ -0,0 +1,64 @@ +get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } + + /** + * MatchMode: 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + * + * @return string|null + */ + public function getMatchMode() + { + return $this->get("MatchMode"); + } + + /** + * MatchMode: 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + * + * @param string $matchMode + */ + public function setMatchMode($matchMode) + { + $this->set("MatchMode", $matchMode); + } +} diff --git a/src/ULB/Models/IPInfo.php b/src/ULB/Models/IPInfo.php new file mode 100644 index 00000000..ca469880 --- /dev/null +++ b/src/ULB/Models/IPInfo.php @@ -0,0 +1,164 @@ +get("IP"); + } + + /** + * IP: IP地址 + * + * @param string $ip + */ + public function setIP($ip) + { + $this->set("IP", $ip); + } + + /** + * Id: 唯一标识ID + * + * @return string|null + */ + public function getId() + { + return $this->get("Id"); + } + + /** + * Id: 唯一标识ID + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * IPVersion: IP协议版本 + * + * @return string|null + */ + public function getIPVersion() + { + return $this->get("IPVersion"); + } + + /** + * IPVersion: IP协议版本 + * + * @param string $ipVersion + */ + public function setIPVersion($ipVersion) + { + $this->set("IPVersion", $ipVersion); + } + + /** + * OperatorName: 外网IP的运营商信息。枚举值为:Telecom -> 电信,Unicom -> 联通,International -> 国际IP,Bgp -> BGP,Duplet -> 双线(电信+联通双线路),BGPPro -> 精品BGP,China-mobile -> 中国移动,Anycast -> AnycastEIP + * + * @return string|null + */ + public function getOperatorName() + { + return $this->get("OperatorName"); + } + + /** + * OperatorName: 外网IP的运营商信息。枚举值为:Telecom -> 电信,Unicom -> 联通,International -> 国际IP,Bgp -> BGP,Duplet -> 双线(电信+联通双线路),BGPPro -> 精品BGP,China-mobile -> 中国移动,Anycast -> AnycastEIP + * + * @param string $operatorName + */ + public function setOperatorName($operatorName) + { + $this->set("OperatorName", $operatorName); + } + + /** + * BandwidthType: 带宽类型。限定枚举值:1 -> 共享带宽,0 -> 普通带宽类型 + * + * @return integer|null + */ + public function getBandwidthType() + { + return $this->get("BandwidthType"); + } + + /** + * BandwidthType: 带宽类型。限定枚举值:1 -> 共享带宽,0 -> 普通带宽类型 + * + * @param int $bandwidthType + */ + public function setBandwidthType($bandwidthType) + { + $this->set("BandwidthType", $bandwidthType); + } + + /** + * Bandwidth: 带宽值。单位M + * + * @return integer|null + */ + public function getBandwidth() + { + return $this->get("Bandwidth"); + } + + /** + * Bandwidth: 带宽值。单位M + * + * @param int $bandwidth + */ + public function setBandwidth($bandwidth) + { + $this->set("Bandwidth", $bandwidth); + } + + /** + * AddressType: 网络模式。 限定枚举值:Internet -> 互联网,Intranet -> 内联网 + * + * @return string|null + */ + public function getAddressType() + { + return $this->get("AddressType"); + } + + /** + * AddressType: 网络模式。 限定枚举值:Internet -> 互联网,Intranet -> 内联网 + * + * @param string $addressType + */ + public function setAddressType($addressType) + { + $this->set("AddressType", $addressType); + } +} diff --git a/src/ULB/Models/InsertHeaderConfigSet.php b/src/ULB/Models/InsertHeaderConfigSet.php new file mode 100644 index 00000000..18d70d47 --- /dev/null +++ b/src/ULB/Models/InsertHeaderConfigSet.php @@ -0,0 +1,84 @@ +get("Key"); + } + + /** + * Key: 插入的 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 + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @return string|null + */ + public function getValue() + { + return $this->get("Value"); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @param string $value + */ + public function setValue($value) + { + $this->set("Value", $value); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @return string|null + */ + public function getValueType() + { + return $this->get("ValueType"); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @param string $valueType + */ + public function setValueType($valueType) + { + $this->set("ValueType", $valueType); + } +} diff --git a/src/ULB/Models/Listener.php b/src/ULB/Models/Listener.php new file mode 100644 index 00000000..dc2cad55 --- /dev/null +++ b/src/ULB/Models/Listener.php @@ -0,0 +1,420 @@ +get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * Name: 监听器的名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 监听器的名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Remark: 监听器的备注信息 + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 监听器的备注信息 + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * ListenerPort: 监听器的监听端口 + * + * @return integer|null + */ + public function getListenerPort() + { + return $this->get("ListenerPort"); + } + + /** + * ListenerPort: 监听器的监听端口 + * + * @param int $listenerPort + */ + public function setListenerPort($listenerPort) + { + $this->set("ListenerPort", $listenerPort); + } + + /** + * ListenerProtocol: 监听协议。应用型限定取值: HTTP、HTTPS + * + * @return string|null + */ + public function getListenerProtocol() + { + return $this->get("ListenerProtocol"); + } + + /** + * ListenerProtocol: 监听协议。应用型限定取值: HTTP、HTTPS + * + * @param string $listenerProtocol + */ + public function setListenerProtocol($listenerProtocol) + { + $this->set("ListenerProtocol", $listenerProtocol); + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持。具体接口详见 Certificate + * + * @return Certificate[]|null + */ + public function getCertificates() + { + $items = $this->get("Certificates"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Certificate($item)); + } + return $result; + } + + /** + * Certificates: (应用型专用)服务器默认证书ID。仅HTTPS监听支持。具体接口详见 Certificate + * + * @param Certificate[] $certificates + */ + public function setCertificates(array $certificates) + { + $result = []; + foreach ($certificates as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略 + * + * @return string|null + */ + public function getSecurityPolicyId() + { + return $this->get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: (应用型专用)安全策略组ID。仅HTTPS监听支持绑定;Default -> 原生策略 + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒 + * + * @return integer|null + */ + public function getIdleTimeout() + { + return $this->get("IdleTimeout"); + } + + /** + * IdleTimeout: 连接空闲超时时间。单位:秒 + * + * @param int $idleTimeout + */ + public function setIdleTimeout($idleTimeout) + { + $this->set("IdleTimeout", $idleTimeout); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式 + * + * @return string|null + */ + public function getScheduler() + { + return $this->get("Scheduler"); + } + + /** + * Scheduler: 负载均衡算法。应用型限定取值:Roundrobin -> 轮询;Source -> 源地址; WeightRoundrobin -> 加权轮询; Leastconn -> 最小连接数;Backup ->主备模式 + * + * @param string $scheduler + */ + public function setScheduler($scheduler) + { + $this->set("Scheduler", $scheduler); + } + + /** + * StickinessConfig: 会话保持相关配置。具体结构详见 StickinessConfigSet + * + * @return StickinessConfigSet|null + */ + public function getStickinessConfig() + { + return new StickinessConfigSet($this->get("StickinessConfig")); + } + + /** + * StickinessConfig: 会话保持相关配置。具体结构详见 StickinessConfigSet + * + * @param StickinessConfigSet $stickinessConfig + */ + public function setStickinessConfig(array $stickinessConfig) + { + $this->set("StickinessConfig", $stickinessConfig->getAll()); + } + + /** + * HealthCheckConfig: 健康检查相关配置。具体结构详见 HealthCheckConfigSet + * + * @return HealthCheckConfigSet|null + */ + public function getHealthCheckConfig() + { + return new HealthCheckConfigSet($this->get("HealthCheckConfig")); + } + + /** + * HealthCheckConfig: 健康检查相关配置。具体结构详见 HealthCheckConfigSet + * + * @param HealthCheckConfigSet $healthCheckConfig + */ + public function setHealthCheckConfig(array $healthCheckConfig) + { + $this->set("HealthCheckConfig", $healthCheckConfig->getAll()); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * + * @return boolean|null + */ + public function getCompressionEnabled() + { + return $this->get("CompressionEnabled"); + } + + /** + * CompressionEnabled: (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * + * @param boolean $compressionEnabled + */ + public function setCompressionEnabled($compressionEnabled) + { + $this->set("CompressionEnabled", $compressionEnabled); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * + * @return boolean|null + */ + public function getHTTP2Enabled() + { + return $this->get("HTTP2Enabled"); + } + + /** + * HTTP2Enabled: (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * + * @param boolean $http2Enabled + */ + public function setHTTP2Enabled($http2Enabled) + { + $this->set("HTTP2Enabled", $http2Enabled); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * + * @return boolean|null + */ + public function getRedirectEnabled() + { + return $this->get("RedirectEnabled"); + } + + /** + * RedirectEnabled: (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * + * @param boolean $redirectEnabled + */ + public function setRedirectEnabled($redirectEnabled) + { + $this->set("RedirectEnabled", $redirectEnabled); + } + + /** + * RedirectPort: (应用型专用)重定向端口 + * + * @return integer|null + */ + public function getRedirectPort() + { + return $this->get("RedirectPort"); + } + + /** + * RedirectPort: (应用型专用)重定向端口 + * + * @param int $redirectPort + */ + public function setRedirectPort($redirectPort) + { + $this->set("RedirectPort", $redirectPort); + } + + /** + * Targets: 添加的服务节点信息。具体结构详见 Target + * + * @return Target[]|null + */ + public function getTargets() + { + $items = $this->get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Target($item)); + } + return $result; + } + + /** + * Targets: 添加的服务节点信息。具体结构详见 Target + * + * @param Target[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Rules: (应用型专用)转发规则信息 + * + * @return Rule[]|null + */ + public function getRules() + { + $items = $this->get("Rules"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Rule($item)); + } + return $result; + } + + /** + * Rules: (应用型专用)转发规则信息 + * + * @param Rule[] $rules + */ + public function setRules(array $rules) + { + $result = []; + foreach ($rules as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * State: listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } +} diff --git a/src/ULB/Models/LoadBalancer.php b/src/ULB/Models/LoadBalancer.php new file mode 100644 index 00000000..ae4c0595 --- /dev/null +++ b/src/ULB/Models/LoadBalancer.php @@ -0,0 +1,408 @@ +get("VPCId"); + } + + /** + * VPCId: 负载均衡实例所属的VPC资源ID + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @return string|null + */ + public function getLoadBalancerId() + { + return $this->get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:Application -> 应用型,Network -> 网络型 + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 负载均衡实例的类型。限定枚举值:Application -> 应用型,Network -> 网络型 + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Name: 负载均衡实例的名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 负载均衡实例的名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * Tag: 负载均衡实例所属的业务组ID + * + * @return string|null + */ + public function getTag() + { + return $this->get("Tag"); + } + + /** + * Tag: 负载均衡实例所属的业务组ID + * + * @param string $tag + */ + public function setTag($tag) + { + $this->set("Tag", $tag); + } + + /** + * Remark: 负载均衡实例的备注信息 + * + * @return string|null + */ + public function getRemark() + { + return $this->get("Remark"); + } + + /** + * Remark: 负载均衡实例的备注信息 + * + * @param string $remark + */ + public function setRemark($remark) + { + $this->set("Remark", $remark); + } + + /** + * IPVersion: 负载均衡实例支持的IP协议版本 + * + * @return string|null + */ + public function getIPVersion() + { + return $this->get("IPVersion"); + } + + /** + * IPVersion: 负载均衡实例支持的IP协议版本 + * + * @param string $ipVersion + */ + public function setIPVersion($ipVersion) + { + $this->set("IPVersion", $ipVersion); + } + + /** + * IPInfos: 绑定的IP信息。具体结构详见 IPInfo + * + * @return IPInfo[]|null + */ + public function getIPInfos() + { + $items = $this->get("IPInfos"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new IPInfo($item)); + } + return $result; + } + + /** + * IPInfos: 绑定的IP信息。具体结构详见 IPInfo + * + * @param IPInfo[] $ipInfos + */ + public function setIPInfos(array $ipInfos) + { + $result = []; + foreach ($ipInfos as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * SnatIPs: 应用型实例的代理IP或网络型FULLNAT模式下snat所用的IP + * + * @return string[]|null + */ + public function getSnatIPs() + { + return $this->get("SnatIPs"); + } + + /** + * SnatIPs: 应用型实例的代理IP或网络型FULLNAT模式下snat所用的IP + * + * @param string[] $snatIPs + */ + public function setSnatIPs(array $snatIPs) + { + $this->set("SnatIPs", $snatIPs); + } + + /** + * Firewall: 防火墙信息 + * + * @return FirewallSet|null + */ + public function getFirewall() + { + return new FirewallSet($this->get("Firewall")); + } + + /** + * Firewall: 防火墙信息 + * + * @param FirewallSet $firewall + */ + public function setFirewall(array $firewall) + { + $this->set("Firewall", $firewall->getAll()); + } + + /** + * AccessLogConfig: (应用型专用)访问日志相关配置 + * + * @return AccessLogConfigSet|null + */ + public function getAccessLogConfig() + { + return new AccessLogConfigSet($this->get("AccessLogConfig")); + } + + /** + * AccessLogConfig: (应用型专用)访问日志相关配置 + * + * @param AccessLogConfigSet $accessLogConfig + */ + public function setAccessLogConfig(array $accessLogConfig) + { + $this->set("AccessLogConfig", $accessLogConfig->getAll()); + } + + /** + * ChargeType: 付费模式 + * + * @return string|null + */ + public function getChargeType() + { + return $this->get("ChargeType"); + } + + /** + * ChargeType: 付费模式 + * + * @param string $chargeType + */ + public function setChargeType($chargeType) + { + $this->set("ChargeType", $chargeType); + } + + /** + * PurchaseValue: 有效期(计费)。格式为Unix Timestamp + * + * @return integer|null + */ + public function getPurchaseValue() + { + return $this->get("PurchaseValue"); + } + + /** + * PurchaseValue: 有效期(计费)。格式为Unix Timestamp + * + * @param int $purchaseValue + */ + public function setPurchaseValue($purchaseValue) + { + $this->set("PurchaseValue", $purchaseValue); + } + + /** + * CreateTime: 负载均衡实例创建时间。格式为Unix Timestamp + * + * @return integer|null + */ + public function getCreateTime() + { + return $this->get("CreateTime"); + } + + /** + * CreateTime: 负载均衡实例创建时间。格式为Unix Timestamp + * + * @param int $createTime + */ + public function setCreateTime($createTime) + { + $this->set("CreateTime", $createTime); + } + + /** + * Listeners: 监听器信息。当ShowDetail为false时,为空 + * + * @return Listener[]|null + */ + public function getListeners() + { + $items = $this->get("Listeners"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Listener($item)); + } + return $result; + } + + /** + * Listeners: 监听器信息。当ShowDetail为false时,为空 + * + * @param Listener[] $listeners + */ + public function setListeners(array $listeners) + { + $result = []; + foreach ($listeners as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Status: lb状态:Normal-正常;Arrears-欠费停服 + * + * @return string|null + */ + public function getStatus() + { + return $this->get("Status"); + } + + /** + * Status: lb状态:Normal-正常;Arrears-欠费停服 + * + * @param string $status + */ + public function setStatus($status) + { + $this->set("Status", $status); + } + + /** + * AutoRenewEnabled: 是否开启自动续费 + * + * @return boolean|null + */ + public function getAutoRenewEnabled() + { + return $this->get("AutoRenewEnabled"); + } + + /** + * AutoRenewEnabled: 是否开启自动续费 + * + * @param boolean $autoRenewEnabled + */ + public function setAutoRenewEnabled($autoRenewEnabled) + { + $this->set("AutoRenewEnabled", $autoRenewEnabled); + } +} diff --git a/src/ULB/Models/LoggerSet.php b/src/ULB/Models/LoggerSet.php index 16b135c7..3bef9825 100644 --- a/src/ULB/Models/LoggerSet.php +++ b/src/ULB/Models/LoggerSet.php @@ -1,6 +1,6 @@ get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } +} diff --git a/src/ULB/Models/PolicyBackendSet.php b/src/ULB/Models/PolicyBackendSet.php index 34c73418..943174ab 100644 --- a/src/ULB/Models/PolicyBackendSet.php +++ b/src/ULB/Models/PolicyBackendSet.php @@ -1,6 +1,6 @@ get("Key"); + } + + /** + * Key: 删除的 header 字段名称,目前只能删除以下几个默认配置的字段: X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } +} diff --git a/src/ULB/Models/Rule.php b/src/ULB/Models/Rule.php new file mode 100644 index 00000000..8a1e53fe --- /dev/null +++ b/src/ULB/Models/Rule.php @@ -0,0 +1,148 @@ +get("RuleId"); + } + + /** + * RuleId: 转发规则的ID + * + * @param string $ruleId + */ + public function setRuleId($ruleId) + { + $this->set("RuleId", $ruleId); + } + + /** + * RuleConditions: 转发规则匹配条件。具体结构详见 RuleCondition + * + * @return RuleCondition[]|null + */ + public function getRuleConditions() + { + $items = $this->get("RuleConditions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new RuleCondition($item)); + } + return $result; + } + + /** + * RuleConditions: 转发规则匹配条件。具体结构详见 RuleCondition + * + * @param RuleCondition[] $ruleConditions + */ + public function setRuleConditions(array $ruleConditions) + { + $result = []; + foreach ($ruleConditions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * RuleActions: 转发动作。具体规则详见RuleAction + * + * @return RuleAction[]|null + */ + public function getRuleActions() + { + $items = $this->get("RuleActions"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new RuleAction($item)); + } + return $result; + } + + /** + * RuleActions: 转发动作。具体规则详见RuleAction + * + * @param RuleAction[] $ruleActions + */ + public function setRuleActions(array $ruleActions) + { + $result = []; + foreach ($ruleActions as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * IsDefault: 是否为默认转发规则 + * + * @return boolean|null + */ + public function getIsDefault() + { + return $this->get("IsDefault"); + } + + /** + * IsDefault: 是否为默认转发规则 + * + * @param boolean $isDefault + */ + public function setIsDefault($isDefault) + { + $this->set("IsDefault", $isDefault); + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略 + * + * @return boolean|null + */ + public function getPass() + { + return $this->get("Pass"); + } + + /** + * Pass: 当转发的服务节点为空时,规则是否忽略 + * + * @param boolean $pass + */ + public function setPass($pass) + { + $this->set("Pass", $pass); + } +} diff --git a/src/ULB/Models/RuleAction.php b/src/ULB/Models/RuleAction.php new file mode 100644 index 00000000..937c49fc --- /dev/null +++ b/src/ULB/Models/RuleAction.php @@ -0,0 +1,164 @@ +get("Type"); + } + + /** + * Type: 动作类型。限定枚举值:Forward、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader" + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * ForwardConfig: 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet + * + * @return ForwardConfigSet|null + */ + public function getForwardConfig() + { + return new ForwardConfigSet($this->get("ForwardConfig")); + } + + /** + * ForwardConfig: 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet + * + * @param ForwardConfigSet $forwardConfig + */ + public function setForwardConfig(array $forwardConfig) + { + $this->set("ForwardConfig", $forwardConfig->getAll()); + } + + /** + * FixedResponseConfig: 静态返回相关配置,对应 type 值: "FixedResponse"。具体结构详见 FixedResponseConfigSet + * + * @return FixedResponseConfigSet|null + */ + public function getFixedResponseConfig() + { + return new FixedResponseConfigSet($this->get("FixedResponseConfig")); + } + + /** + * FixedResponseConfig: 静态返回相关配置,对应 type 值: "FixedResponse"。具体结构详见 FixedResponseConfigSet + * + * @param FixedResponseConfigSet $fixedResponseConfig + */ + public function setFixedResponseConfig(array $fixedResponseConfig) + { + $this->set("FixedResponseConfig", $fixedResponseConfig->getAll()); + } + + /** + * InsertHeaderConfig: 插入 header 相关配置,对应 type 值: "InsertHeader"。具体结构详见 InsertHeaderConfigSet + * + * @return InsertHeaderConfigSet|null + */ + public function getInsertHeaderConfig() + { + return new InsertHeaderConfigSet($this->get("InsertHeaderConfig")); + } + + /** + * InsertHeaderConfig: 插入 header 相关配置,对应 type 值: "InsertHeader"。具体结构详见 InsertHeaderConfigSet + * + * @param InsertHeaderConfigSet $insertHeaderConfig + */ + public function setInsertHeaderConfig(array $insertHeaderConfig) + { + $this->set("InsertHeaderConfig", $insertHeaderConfig->getAll()); + } + + /** + * CorsConfig: 跨域相关配置,对应 type 值: "Cors"。具体结构详见 CorsConfigSet + * + * @return CorsConfigSet|null + */ + public function getCorsConfig() + { + return new CorsConfigSet($this->get("CorsConfig")); + } + + /** + * CorsConfig: 跨域相关配置,对应 type 值: "Cors"。具体结构详见 CorsConfigSet + * + * @param CorsConfigSet $corsConfig + */ + public function setCorsConfig(array $corsConfig) + { + $this->set("CorsConfig", $corsConfig->getAll()); + } + + /** + * RemoveHeaderConfig: 删除 header 相关配置,对应 type 值: "RemoveHeader"。具体结构详见 RemoveHeaderConfigSet + * + * @return RemoveHeaderConfigSet|null + */ + public function getRemoveHeaderConfig() + { + return new RemoveHeaderConfigSet($this->get("RemoveHeaderConfig")); + } + + /** + * RemoveHeaderConfig: 删除 header 相关配置,对应 type 值: "RemoveHeader"。具体结构详见 RemoveHeaderConfigSet + * + * @param RemoveHeaderConfigSet $removeHeaderConfig + */ + public function setRemoveHeaderConfig(array $removeHeaderConfig) + { + $this->set("RemoveHeaderConfig", $removeHeaderConfig->getAll()); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @return integer|null + */ + public function getOrder() + { + return $this->get("Order"); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @param int $order + */ + public function setOrder($order) + { + $this->set("Order", $order); + } +} diff --git a/src/ULB/Models/RuleCondition.php b/src/ULB/Models/RuleCondition.php new file mode 100644 index 00000000..f307d8e6 --- /dev/null +++ b/src/ULB/Models/RuleCondition.php @@ -0,0 +1,84 @@ +get("Type"); + } + + /** + * Type: 匹配条件类型。限定枚举值:Host,Path + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * HostConfig: 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet + * + * @return HostConfigSet|null + */ + public function getHostConfig() + { + return new HostConfigSet($this->get("HostConfig")); + } + + /** + * HostConfig: 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet + * + * @param HostConfigSet $hostConfig + */ + public function setHostConfig(array $hostConfig) + { + $this->set("HostConfig", $hostConfig->getAll()); + } + + /** + * PathConfig: 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet + * + * @return PathConfigSet|null + */ + public function getPathConfig() + { + return new PathConfigSet($this->get("PathConfig")); + } + + /** + * PathConfig: 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet + * + * @param PathConfigSet $pathConfig + */ + public function setPathConfig(array $pathConfig) + { + $this->set("PathConfig", $pathConfig->getAll()); + } +} diff --git a/src/ULB/Models/SSLBindedTargetSet.php b/src/ULB/Models/SSLBindedTargetSet.php index 50f4ac64..8f15bbda 100644 --- a/src/ULB/Models/SSLBindedTargetSet.php +++ b/src/ULB/Models/SSLBindedTargetSet.php @@ -1,6 +1,6 @@ get("SSLId"); + } + + /** + * SSLId: SSL证书的Id + * + * @param string $sslId + */ + public function setSSLId($sslId) + { + $this->set("SSLId", $sslId); + } + + /** + * SSLName: SSL证书的名字 + * + * @return string|null + */ + public function getSSLName() + { + return $this->get("SSLName"); + } + + /** + * SSLName: SSL证书的名字 + * + * @param string $sslName + */ + public function setSSLName($sslName) + { + $this->set("SSLName", $sslName); + } + + /** + * SSLType: SSL证书类型,暂时只有 Pem 一种类型 + * + * @return string|null + */ + public function getSSLType() + { + return $this->get("SSLType"); + } + + /** + * SSLType: SSL证书类型,暂时只有 Pem 一种类型 + * + * @param string $sslType + */ + public function setSSLType($sslType) + { + $this->set("SSLType", $sslType); + } + + /** + * SSLContent: SSL证书的内容 + * + * @return string|null + */ + public function getSSLContent() + { + return $this->get("SSLContent"); + } + + /** + * SSLContent: SSL证书的内容 + * + * @param string $sslContent + */ + public function setSSLContent($sslContent) + { + $this->set("SSLContent", $sslContent); + } + + /** + * CreateTime: SSL证书的创建时间 + * + * @return integer|null + */ + public function getCreateTime() + { + return $this->get("CreateTime"); + } + + /** + * CreateTime: SSL证书的创建时间 + * + * @param int $createTime + */ + public function setCreateTime($createTime) + { + $this->set("CreateTime", $createTime); + } + + /** + * HashValue: SSL证书的HASH值 + * + * @return string|null + */ + public function getHashValue() + { + return $this->get("HashValue"); + } + + /** + * HashValue: SSL证书的HASH值 + * + * @param string $hashValue + */ + public function setHashValue($hashValue) + { + $this->set("HashValue", $hashValue); + } + + /** + * Relations: SSL绑定ULB和ALB的关系 + * + * @return SSLRelation[]|null + */ + public function getRelations() + { + $items = $this->get("Relations"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new SSLRelation($item)); + } + return $result; + } + + /** + * Relations: SSL绑定ULB和ALB的关系 + * + * @param SSLRelation[] $relations + */ + public function setRelations(array $relations) + { + $result = []; + foreach ($relations as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * SSLSource: SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * + * @return integer|null + */ + public function getSSLSource() + { + return $this->get("SSLSource"); + } + + /** + * SSLSource: SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * + * @param int $sslSource + */ + public function setSSLSource($sslSource) + { + $this->set("SSLSource", $sslSource); + } + + /** + * USSLId: USSL证书平台的编号,只有当SSLSource为1时才出现 + * + * @return string|null + */ + public function getUSSLId() + { + return $this->get("USSLId"); + } + + /** + * USSLId: USSL证书平台的编号,只有当SSLSource为1时才出现 + * + * @param string $usslId + */ + public function setUSSLId($usslId) + { + $this->set("USSLId", $usslId); + } + + /** + * Domains: SSL证书的域名 + * + * @return string|null + */ + public function getDomains() + { + return $this->get("Domains"); + } + + /** + * Domains: SSL证书的域名 + * + * @param string $domains + */ + public function setDomains($domains) + { + $this->set("Domains", $domains); + } + + /** + * DNSNames: SSL证书的扩展域名 + * + * @return string|null + */ + public function getDNSNames() + { + return $this->get("DNSNames"); + } + + /** + * DNSNames: SSL证书的扩展域名 + * + * @param string $dnsNames + */ + public function setDNSNames($dnsNames) + { + $this->set("DNSNames", $dnsNames); + } + + /** + * NotBefore: 证书颁发时间 + * + * @return integer|null + */ + public function getNotBefore() + { + return $this->get("NotBefore"); + } + + /** + * NotBefore: 证书颁发时间 + * + * @param int $notBefore + */ + public function setNotBefore($notBefore) + { + $this->set("NotBefore", $notBefore); + } + + /** + * NotAfter: 证书过期时间 + * + * @return integer|null + */ + public function getNotAfter() + { + return $this->get("NotAfter"); + } + + /** + * NotAfter: 证书过期时间 + * + * @param int $notAfter + */ + public function setNotAfter($notAfter) + { + $this->set("NotAfter", $notAfter); + } +} diff --git a/src/ULB/Models/SSLRelation.php b/src/ULB/Models/SSLRelation.php new file mode 100644 index 00000000..416b9b05 --- /dev/null +++ b/src/ULB/Models/SSLRelation.php @@ -0,0 +1,124 @@ +get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * LoadBalancerName: 负载均衡实例的名称 + * + * @return string|null + */ + public function getLoadBalancerName() + { + return $this->get("LoadBalancerName"); + } + + /** + * LoadBalancerName: 负载均衡实例的名称 + * + * @param string $loadBalancerName + */ + public function setLoadBalancerName($loadBalancerName) + { + $this->set("LoadBalancerName", $loadBalancerName); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * ListenerName: 监听器的名称 + * + * @return string|null + */ + public function getListenerName() + { + return $this->get("ListenerName"); + } + + /** + * ListenerName: 监听器的名称 + * + * @param string $listenerName + */ + public function setListenerName($listenerName) + { + $this->set("ListenerName", $listenerName); + } + + /** + * IsDefault: 是否为监听器默认SSL证书 + * + * @return boolean|null + */ + public function getIsDefault() + { + return $this->get("IsDefault"); + } + + /** + * IsDefault: 是否为监听器默认SSL证书 + * + * @param boolean $isDefault + */ + public function setIsDefault($isDefault) + { + $this->set("IsDefault", $isDefault); + } +} diff --git a/src/ULB/Models/SecurityPolicy.php b/src/ULB/Models/SecurityPolicy.php new file mode 100644 index 00000000..a5705f97 --- /dev/null +++ b/src/ULB/Models/SecurityPolicy.php @@ -0,0 +1,156 @@ +get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @return string|null + */ + public function getSecurityPolicyName() + { + return $this->get("SecurityPolicyName"); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @param string $securityPolicyName + */ + public function setSecurityPolicyName($securityPolicyName) + { + $this->set("SecurityPolicyName", $securityPolicyName); + } + + /** + * TLSVersion: TLS最低版本 + * + * @return string|null + */ + public function getTLSVersion() + { + return $this->get("TLSVersion"); + } + + /** + * TLSVersion: TLS最低版本 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SSLCiphers: 加密套件 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @return integer|null + */ + public function getSecurityPolicyType() + { + return $this->get("SecurityPolicyType"); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @param int $securityPolicyType + */ + public function setSecurityPolicyType($securityPolicyType) + { + $this->set("SecurityPolicyType", $securityPolicyType); + } + + /** + * VServerSet: 关联的监听 + * + * @return BindVServerInfo[]|null + */ + public function getVServerSet() + { + $items = $this->get("VServerSet"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new BindVServerInfo($item)); + } + return $result; + } + + /** + * VServerSet: 关联的监听 + * + * @param BindVServerInfo[] $vServerSet + */ + public function setVServerSet(array $vServerSet) + { + $result = []; + foreach ($vServerSet as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Models/SecurityPolicyInfo.php b/src/ULB/Models/SecurityPolicyInfo.php new file mode 100644 index 00000000..00d5dd7c --- /dev/null +++ b/src/ULB/Models/SecurityPolicyInfo.php @@ -0,0 +1,156 @@ +get("SecurityPolicyId"); + } + + /** + * SecurityPolicyId: 安全策略ID + * + * @param string $securityPolicyId + */ + public function setSecurityPolicyId($securityPolicyId) + { + $this->set("SecurityPolicyId", $securityPolicyId); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @return string|null + */ + public function getSecurityPolicyName() + { + return $this->get("SecurityPolicyName"); + } + + /** + * SecurityPolicyName: 安全策略名称 + * + * @param string $securityPolicyName + */ + public function setSecurityPolicyName($securityPolicyName) + { + $this->set("SecurityPolicyName", $securityPolicyName); + } + + /** + * TLSVersion: TLS最低版本 + * + * @return string|null + */ + public function getTLSVersion() + { + return $this->get("TLSVersion"); + } + + /** + * TLSVersion: TLS最低版本 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SSLCiphers: 加密套件 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @return integer|null + */ + public function getSecurityPolicyType() + { + return $this->get("SecurityPolicyType"); + } + + /** + * SecurityPolicyType: 安全策略类型 0:预定义 1:自定义 + * + * @param int $securityPolicyType + */ + public function setSecurityPolicyType($securityPolicyType) + { + $this->set("SecurityPolicyType", $securityPolicyType); + } + + /** + * Relations: 关联的监听 + * + * @return SecurityPolicyRelation[]|null + */ + public function getRelations() + { + $items = $this->get("Relations"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new SecurityPolicyRelation($item)); + } + return $result; + } + + /** + * Relations: 关联的监听 + * + * @param SecurityPolicyRelation[] $relations + */ + public function setRelations(array $relations) + { + $result = []; + foreach ($relations as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Models/SecurityPolicyRelation.php b/src/ULB/Models/SecurityPolicyRelation.php new file mode 100644 index 00000000..94d3febe --- /dev/null +++ b/src/ULB/Models/SecurityPolicyRelation.php @@ -0,0 +1,104 @@ +get("LoadBalancerId"); + } + + /** + * LoadBalancerId: 负载均衡实例的ID + * + * @param string $loadBalancerId + */ + public function setLoadBalancerId($loadBalancerId) + { + $this->set("LoadBalancerId", $loadBalancerId); + } + + /** + * ListenerId: 监听器的ID + * + * @return string|null + */ + public function getListenerId() + { + return $this->get("ListenerId"); + } + + /** + * ListenerId: 监听器的ID + * + * @param string $listenerId + */ + public function setListenerId($listenerId) + { + $this->set("ListenerId", $listenerId); + } + + /** + * ListenerName: 监听器的名称 + * + * @return string|null + */ + public function getListenerName() + { + return $this->get("ListenerName"); + } + + /** + * ListenerName: 监听器的名称 + * + * @param string $listenerName + */ + public function setListenerName($listenerName) + { + $this->set("ListenerName", $listenerName); + } + + /** + * ListenerPort: 监听端口 + * + * @return integer|null + */ + public function getListenerPort() + { + return $this->get("ListenerPort"); + } + + /** + * ListenerPort: 监听端口 + * + * @param int $listenerPort + */ + public function setListenerPort($listenerPort) + { + $this->set("ListenerPort", $listenerPort); + } +} diff --git a/src/ULB/Models/StickinessConfigSet.php b/src/ULB/Models/StickinessConfigSet.php new file mode 100644 index 00000000..287c6969 --- /dev/null +++ b/src/ULB/Models/StickinessConfigSet.php @@ -0,0 +1,84 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值: ServerInsert -> 自动生成KEY;UserDefined -> 用户自定义KEY + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效 + * + * @return string|null + */ + public function getCookieName() + { + return $this->get("CookieName"); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效 + * + * @param string $cookieName + */ + public function setCookieName($cookieName) + { + $this->set("CookieName", $cookieName); + } +} diff --git a/src/ULB/Models/TLSAndCiphers.php b/src/ULB/Models/TLSAndCiphers.php new file mode 100644 index 00000000..59573549 --- /dev/null +++ b/src/ULB/Models/TLSAndCiphers.php @@ -0,0 +1,64 @@ +get("TLSVersion"); + } + + /** + * TLSVersion: TLS最低版本 + * + * @param string $tlsVersion + */ + public function setTLSVersion($tlsVersion) + { + $this->set("TLSVersion", $tlsVersion); + } + + /** + * SSLCiphers: 加密套件 + * + * @return string[]|null + */ + public function getSSLCiphers() + { + return $this->get("SSLCiphers"); + } + + /** + * SSLCiphers: 加密套件 + * + * @param string[] $sslCiphers + */ + public function setSSLCiphers(array $sslCiphers) + { + $this->set("SSLCiphers", $sslCiphers); + } +} diff --git a/src/ULB/Models/Target.php b/src/ULB/Models/Target.php new file mode 100644 index 00000000..1951e459 --- /dev/null +++ b/src/ULB/Models/Target.php @@ -0,0 +1,264 @@ + 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + * + * @return string|null + */ + public function getResourceType() + { + return $this->get("ResourceType"); + } + + /** + * ResourceType: 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + * + * @param string $resourceType + */ + public function setResourceType($resourceType) + { + $this->set("ResourceType", $resourceType); + } + + /** + * ResourceId: 服务节点的资源ID + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 服务节点的资源ID + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * ResourceName: 服务节点的资源名称 + * + * @return string|null + */ + public function getResourceName() + { + return $this->get("ResourceName"); + } + + /** + * ResourceName: 服务节点的资源名称 + * + * @param string $resourceName + */ + public function setResourceName($resourceName) + { + $this->set("ResourceName", $resourceName); + } + + /** + * VPCId: 服务节点的VPC资源ID + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 服务节点的VPC资源ID + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 服务节点的子网资源ID + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 服务节点的子网资源ID + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * ResourceIP: 服务节点的IP + * + * @return string|null + */ + public function getResourceIP() + { + return $this->get("ResourceIP"); + } + + /** + * ResourceIP: 服务节点的IP + * + * @param string $resourceIP + */ + public function setResourceIP($resourceIP) + { + $this->set("ResourceIP", $resourceIP); + } + + /** + * Port: 服务节点的端口 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 服务节点的端口 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * Weight: 服务节点的权重。仅在加权轮询算法时有效 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 服务节点的权重。仅在加权轮询算法时有效 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * Enabled: 服务节点是否启用 + * + * @return boolean|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 服务节点是否启用 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * IsBackup: 服务节点是否为备节点 + * + * @return boolean|null + */ + public function getIsBackup() + { + return $this->get("IsBackup"); + } + + /** + * IsBackup: 服务节点是否为备节点 + * + * @param boolean $isBackup + */ + public function setIsBackup($isBackup) + { + $this->set("IsBackup", $isBackup); + } + + /** + * Id: 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets + * + * @return string|null + */ + public function getId() + { + return $this->get("Id"); + } + + /** + * Id: 服务节点的标识ID。为ALB/NLB中使用,与资源自身ID无关,可用于UpdateTargetsAttribute/RemoveTargets + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * State: 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } +} diff --git a/src/ULB/Models/TargetSet.php b/src/ULB/Models/TargetSet.php new file mode 100644 index 00000000..eebd9035 --- /dev/null +++ b/src/ULB/Models/TargetSet.php @@ -0,0 +1,244 @@ + 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + * + * @return string|null + */ + public function getResourceType() + { + return $this->get("ResourceType"); + } + + /** + * ResourceType: 服务节点的类型。限定枚举值:UHost -> 云主机,UNI -> 虚拟网卡,UPM -> 物理云主机,IP -> IP类型; 默认值:"UHost"; 非IP类型,如果该资源有多个IP,将只能添加主IP; 非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。 在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + * + * @param string $resourceType + */ + public function setResourceType($resourceType) + { + $this->set("ResourceType", $resourceType); + } + + /** + * ResourceId: 服务节点的资源ID。在非IP类型时,必传 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 服务节点的资源ID。在非IP类型时,必传 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * VPCId: 服务节点的VPC资源ID。在IP类型时,必传 + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 服务节点的VPC资源ID。在IP类型时,必传 + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 服务节点的子网资源ID。在IP类型时,必传 + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 服务节点的子网资源ID。在IP类型时,必传 + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * ResourceIP: 服务节点的IP。在IP类型时,必传 + * + * @return string|null + */ + public function getResourceIP() + { + return $this->get("ResourceIP"); + } + + /** + * ResourceIP: 服务节点的IP。在IP类型时,必传 + * + * @param string $resourceIP + */ + public function setResourceIP($resourceIP) + { + $this->set("ResourceIP", $resourceIP); + } + + /** + * Port: 服务节点的端口。限定取值:[1-65535]; 默认值:80 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 服务节点的端口。限定取值:[1-65535]; 默认值:80 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100]; 仅在加权轮询算法时有效; 默认值:1 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100]; 仅在加权轮询算法时有效; 默认值:1 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * Enabled: 服务节点是否启用。 默认值:true + * + * @return boolean|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 服务节点是否启用。 默认值:true + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * IsBackup: 服务节点是否为备节点。 默认值:false + * + * @return boolean|null + */ + public function getIsBackup() + { + return $this->get("IsBackup"); + } + + /** + * IsBackup: 服务节点是否为备节点。 默认值:false + * + * @param boolean $isBackup + */ + public function setIsBackup($isBackup) + { + $this->set("IsBackup", $isBackup); + } + + /** + * Id: 服务节点的标识ID。 + * + * @return string|null + */ + public function getId() + { + return $this->get("Id"); + } + + /** + * Id: 服务节点的标识ID。 + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * State: 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 服务节点的健康检查状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } +} diff --git a/src/ULB/Models/ULBBackendSet.php b/src/ULB/Models/ULBBackendSet.php index fd725adc..9baef8e9 100644 --- a/src/ULB/Models/ULBBackendSet.php +++ b/src/ULB/Models/ULBBackendSet.php @@ -1,6 +1,6 @@ set("IsBackup", $isBackup); } + + /** + * Weight: 后端RS权重(在加权轮询算法下有效) + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 后端RS权重(在加权轮询算法下有效) + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * VPCId: 后端服务器所在的VPC + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 后端服务器所在的VPC + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } } diff --git a/src/ULB/Models/ULBIPSet.php b/src/ULB/Models/ULBIPSet.php index 176b17ac..dd709e09 100644 --- a/src/ULB/Models/ULBIPSet.php +++ b/src/ULB/Models/ULBIPSet.php @@ -1,6 +1,6 @@ get("SSLSource"); + } + + /** + * SSLSource: SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * + * @param int $sslSource + */ + public function setSSLSource($sslSource) + { + $this->set("SSLSource", $sslSource); + } + + /** + * USSLId: USSL证书平台的编号,只有当SSLSource为1时才出现 + * + * @return string|null + */ + public function getUSSLId() + { + return $this->get("USSLId"); + } + + /** + * USSLId: USSL证书平台的编号,只有当SSLSource为1时才出现 + * + * @param string $usslId + */ + public function setUSSLId($usslId) + { + $this->set("USSLId", $usslId); + } + + /** + * Domains: SSL证书平台的域名,多域名时,不展示扩展域名 + * + * @return string|null + */ + public function getDomains() + { + return $this->get("Domains"); + } + + /** + * Domains: SSL证书平台的域名,多域名时,不展示扩展域名 + * + * @param string $domains + */ + public function setDomains($domains) + { + $this->set("Domains", $domains); + } + + /** + * NotBefore: 证书颁发时间 + * + * @return integer|null + */ + public function getNotBefore() + { + return $this->get("NotBefore"); + } + + /** + * NotBefore: 证书颁发时间 + * + * @param int $notBefore + */ + public function setNotBefore($notBefore) + { + $this->set("NotBefore", $notBefore); + } + + /** + * NotAfter: 证书过期时间 + * + * @return integer|null + */ + public function getNotAfter() + { + return $this->get("NotAfter"); + } + + /** + * NotAfter: 证书过期时间 + * + * @param int $notAfter + */ + public function setNotAfter($notAfter) + { + $this->set("NotAfter", $notAfter); + } } diff --git a/src/ULB/Models/ULBSet.php b/src/ULB/Models/ULBSet.php index b043e71f..e6c689ba 100644 --- a/src/ULB/Models/ULBSet.php +++ b/src/ULB/Models/ULBSet.php @@ -1,6 +1,6 @@ set("IPVersion", $ipVersion); } + /** + * SnatIps: ULB后向代理IP,仅当有代理IP时返回否 + * + * @return string[]|null + */ + public function getSnatIps() + { + return $this->get("SnatIps"); + } + + /** + * SnatIps: ULB后向代理IP,仅当有代理IP时返回否 + * + * @param string[] $snatIps + */ + public function setSnatIps(array $snatIps) + { + $this->set("SnatIps", $snatIps); + } + /** * ListenType: ULB 监听器类型,枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发;Comprehensive,兼容型;Pending,未定型 * diff --git a/src/ULB/Models/ULBSimpleSet.php b/src/ULB/Models/ULBSimpleSet.php index abae97fa..dbbc001e 100644 --- a/src/ULB/Models/ULBSimpleSet.php +++ b/src/ULB/Models/ULBSimpleSet.php @@ -1,6 +1,6 @@ set("IPVersion", $ipVersion); } + /** + * SnatIps: ULB后向代理IP,仅当有代理IP时返回否 + * + * @return string[]|null + */ + public function getSnatIps() + { + return $this->get("SnatIps"); + } + + /** + * SnatIps: ULB后向代理IP,仅当有代理IP时返回否 + * + * @param string[] $snatIps + */ + public function setSnatIps(array $snatIps) + { + $this->set("SnatIps", $snatIps); + } + /** * ULBId: 负载均衡的资源ID * @@ -425,4 +445,24 @@ public function setLogSet(array $logSet) { $this->set("LogSet", $logSet->getAll()); } + + /** + * WAFMode: WAF功能状态,枚举类型:Unavailable:无法创建WAF;NoWAF:未绑定WAF;Intranet:内网回源Waf;Extranet:外网回源Waf + * + * @return string|null + */ + public function getWAFMode() + { + return $this->get("WAFMode"); + } + + /** + * WAFMode: WAF功能状态,枚举类型:Unavailable:无法创建WAF;NoWAF:未绑定WAF;Intranet:内网回源Waf;Extranet:外网回源Waf + * + * @param string $wafMode + */ + public function setWAFMode($wafMode) + { + $this->set("WAFMode", $wafMode); + } } diff --git a/src/ULB/Models/ULBVServerSet.php b/src/ULB/Models/ULBVServerSet.php index bf0842cd..40b1c131 100644 --- a/src/ULB/Models/ULBVServerSet.php +++ b/src/ULB/Models/ULBVServerSet.php @@ -1,6 +1,6 @@ set("MonitorType", $monitorType); } + /** + * PersistenceType: VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 + * + * @return string|null + */ + public function getPersistenceType() + { + return $this->get("PersistenceType"); + } + + /** + * PersistenceType: VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 + * + * @param string $persistenceType + */ + public function setPersistenceType($persistenceType) + { + $this->set("PersistenceType", $persistenceType); + } + /** * ULBId: 负载均衡实例的Id * @@ -242,26 +262,6 @@ public function setMethod($method) $this->set("Method", $method); } - /** - * PersistenceType: VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 - * - * @return string|null - */ - public function getPersistenceType() - { - return $this->get("PersistenceType"); - } - - /** - * PersistenceType: VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 - * - * @param string $persistenceType - */ - public function setPersistenceType($persistenceType) - { - $this->set("PersistenceType", $persistenceType); - } - /** * PersistenceInfo: 根据PersistenceType确定: None或ServerInsert,此字段为空; UserDefined,此字段展示用户自定义会话string。 * @@ -437,4 +437,84 @@ public function setPolicySet(array $policySet) } return $result; } + + /** + * EnableCompression: 数据压缩开关,0:关闭 1:开启 + * + * @return integer|null + */ + public function getEnableCompression() + { + return $this->get("EnableCompression"); + } + + /** + * EnableCompression: 数据压缩开关,0:关闭 1:开启 + * + * @param int $enableCompression + */ + public function setEnableCompression($enableCompression) + { + $this->set("EnableCompression", $enableCompression); + } + + /** + * SecurityPolicy: VServer绑定的安全策略,具体结构见BindSecurityPolicy + * + * @return BindSecurityPolicy|null + */ + public function getSecurityPolicy() + { + return new BindSecurityPolicy($this->get("SecurityPolicy")); + } + + /** + * SecurityPolicy: VServer绑定的安全策略,具体结构见BindSecurityPolicy + * + * @param BindSecurityPolicy $securityPolicy + */ + public function setSecurityPolicy(array $securityPolicy) + { + $this->set("SecurityPolicy", $securityPolicy->getAll()); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @return integer|null + */ + public function getForwardPort() + { + return $this->get("ForwardPort"); + } + + /** + * ForwardPort: 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * + * @param int $forwardPort + */ + public function setForwardPort($forwardPort) + { + $this->set("ForwardPort", $forwardPort); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @return integer|null + */ + public function getEnableHTTP2() + { + return $this->get("EnableHTTP2"); + } + + /** + * EnableHTTP2: 0:关闭 1:开启,用于开启http2功能;默认值为0 + * + * @param int $enableHTTP2 + */ + public function setEnableHTTP2($enableHTTP2) + { + $this->set("EnableHTTP2", $enableHTTP2); + } } diff --git a/src/ULB/Params/AddTargetsParamTargets.php b/src/ULB/Params/AddTargetsParamTargets.php new file mode 100644 index 00000000..8208d4b1 --- /dev/null +++ b/src/ULB/Params/AddTargetsParamTargets.php @@ -0,0 +1,204 @@ +get("ResourceType"); + } + + /** + * ResourceType: 服务节点的类型。限定枚举值:"UHost" / "UNI"/"UPM"/"IP",默认值:"UHost";非IP类型,如果该资源有多个IP,将只能添加主IP;非IP类型,展示时,会显示相关资源信息,IP类型只展示IP信息。在相关资源被删除时,非IP类型会把相关资源从lb中剔除,IP类型不保证这个逻辑 + * + * @param string $resourceType + */ + public function setResourceType($resourceType) + { + $this->set("ResourceType", $resourceType); + } + + /** + * ResourceId: 服务节点的资源ID。在非IP类型时,必传 + * + * @return string|null + */ + public function getResourceId() + { + return $this->get("ResourceId"); + } + + /** + * ResourceId: 服务节点的资源ID。在非IP类型时,必传 + * + * @param string $resourceId + */ + public function setResourceId($resourceId) + { + $this->set("ResourceId", $resourceId); + } + + /** + * VPCId: 服务节点的VPC资源ID。在IP类型时,必传 + * + * @return string|null + */ + public function getVPCId() + { + return $this->get("VPCId"); + } + + /** + * VPCId: 服务节点的VPC资源ID。在IP类型时,必传 + * + * @param string $vpcId + */ + public function setVPCId($vpcId) + { + $this->set("VPCId", $vpcId); + } + + /** + * SubnetId: 服务节点的子网资源ID。在IP类型时,必传 + * + * @return string|null + */ + public function getSubnetId() + { + return $this->get("SubnetId"); + } + + /** + * SubnetId: 服务节点的子网资源ID。在IP类型时,必传 + * + * @param string $subnetId + */ + public function setSubnetId($subnetId) + { + $this->set("SubnetId", $subnetId); + } + + /** + * ResourceIP: 服务节点的IP。在IP类型时,必传 + * + * @return string|null + */ + public function getResourceIP() + { + return $this->get("ResourceIP"); + } + + /** + * ResourceIP: 服务节点的IP。在IP类型时,必传 + * + * @param string $resourceIP + */ + public function setResourceIP($resourceIP) + { + $this->set("ResourceIP", $resourceIP); + } + + /** + * Port: 服务节点的端口。限定取值:[1-65535],默认值80 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 服务节点的端口。限定取值:[1-65535],默认值80 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * Enabled: 服务节点是否启用。默认值true + * + * @return boolean|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 服务节点是否启用。默认值true + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * IsBackup: 服务节点是否为备节点。默认值false + * + * @return boolean|null + */ + public function getIsBackup() + { + return $this->get("IsBackup"); + } + + /** + * IsBackup: 服务节点是否为备节点。默认值false + * + * @param boolean $isBackup + */ + public function setIsBackup($isBackup) + { + $this->set("IsBackup", $isBackup); + } +} diff --git a/src/ULB/Params/CreateListenerParamHealthCheckConfig.php b/src/ULB/Params/CreateListenerParamHealthCheckConfig.php new file mode 100644 index 00000000..5bfb658c --- /dev/null +++ b/src/ULB/Params/CreateListenerParamHealthCheckConfig.php @@ -0,0 +1,104 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启健康检查功能。暂时不支持关闭。默认值为:true + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: 健康检查方式。应用型限定取值:“Port”/"HTTP",默认值:“Port” + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 健康检查方式。应用型限定取值:“Port”/"HTTP",默认值:“Port” + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Domain: (应用型专用)HTTP检查域名 + * + * @return string|null + */ + public function getDomain() + { + return $this->get("Domain"); + } + + /** + * Domain: (应用型专用)HTTP检查域名 + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->set("Domain", $domain); + } + + /** + * Path: (应用型专用)HTTP检查路径 + * + * @return string|null + */ + public function getPath() + { + return $this->get("Path"); + } + + /** + * Path: (应用型专用)HTTP检查路径 + * + * @param string $path + */ + public function setPath($path) + { + $this->set("Path", $path); + } +} diff --git a/src/ULB/Params/CreateListenerParamStickinessConfig.php b/src/ULB/Params/CreateListenerParamStickinessConfig.php new file mode 100644 index 00000000..94ff6a01 --- /dev/null +++ b/src/ULB/Params/CreateListenerParamStickinessConfig.php @@ -0,0 +1,84 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现;默认值为:false + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert” + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined";默认值为:“ServerInsert” + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + * + * @return string|null + */ + public function getCookieName() + { + return $this->get("CookieName"); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + * + * @param string $cookieName + */ + public function setCookieName($cookieName) + { + $this->set("CookieName", $cookieName); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActions.php b/src/ULB/Params/CreateRuleParamRuleActions.php new file mode 100644 index 00000000..b89aa641 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActions.php @@ -0,0 +1,164 @@ +get("Type"); + } + + /** + * Type: 动作类型。限定枚举值:"Forward"、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader"。只会处理 Type 对应的结构体。 + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * ForwardConfig: + * + * @return CreateRuleParamRuleActionsForwardConfig|null + */ + public function getForwardConfig() + { + return new CreateRuleParamRuleActionsForwardConfig($this->get("ForwardConfig")); + } + + /** + * ForwardConfig: + * + * @param CreateRuleParamRuleActionsForwardConfig $forwardConfig + */ + public function setForwardConfig(array $forwardConfig) + { + $this->set("ForwardConfig", $forwardConfig->getAll()); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @return integer|null + */ + public function getOrder() + { + return $this->get("Order"); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @param int $order + */ + public function setOrder($order) + { + $this->set("Order", $order); + } + + /** + * InsertHeaderConfig: + * + * @return CreateRuleParamRuleActionsInsertHeaderConfig|null + */ + public function getInsertHeaderConfig() + { + return new CreateRuleParamRuleActionsInsertHeaderConfig($this->get("InsertHeaderConfig")); + } + + /** + * InsertHeaderConfig: + * + * @param CreateRuleParamRuleActionsInsertHeaderConfig $insertHeaderConfig + */ + public function setInsertHeaderConfig(array $insertHeaderConfig) + { + $this->set("InsertHeaderConfig", $insertHeaderConfig->getAll()); + } + + /** + * RemoveHeaderConfig: + * + * @return CreateRuleParamRuleActionsRemoveHeaderConfig|null + */ + public function getRemoveHeaderConfig() + { + return new CreateRuleParamRuleActionsRemoveHeaderConfig($this->get("RemoveHeaderConfig")); + } + + /** + * RemoveHeaderConfig: + * + * @param CreateRuleParamRuleActionsRemoveHeaderConfig $removeHeaderConfig + */ + public function setRemoveHeaderConfig(array $removeHeaderConfig) + { + $this->set("RemoveHeaderConfig", $removeHeaderConfig->getAll()); + } + + /** + * CorsConfig: + * + * @return CreateRuleParamRuleActionsCorsConfig|null + */ + public function getCorsConfig() + { + return new CreateRuleParamRuleActionsCorsConfig($this->get("CorsConfig")); + } + + /** + * CorsConfig: + * + * @param CreateRuleParamRuleActionsCorsConfig $corsConfig + */ + public function setCorsConfig(array $corsConfig) + { + $this->set("CorsConfig", $corsConfig->getAll()); + } + + /** + * FixedResponseConfig: + * + * @return CreateRuleParamRuleActionsFixedResponseConfig|null + */ + public function getFixedResponseConfig() + { + return new CreateRuleParamRuleActionsFixedResponseConfig($this->get("FixedResponseConfig")); + } + + /** + * FixedResponseConfig: + * + * @param CreateRuleParamRuleActionsFixedResponseConfig $fixedResponseConfig + */ + public function setFixedResponseConfig(array $fixedResponseConfig) + { + $this->set("FixedResponseConfig", $fixedResponseConfig->getAll()); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsCorsConfig.php b/src/ULB/Params/CreateRuleParamRuleActionsCorsConfig.php new file mode 100644 index 00000000..fc604b9d --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsCorsConfig.php @@ -0,0 +1,144 @@ +get("AllowOrigin"); + } + + /** + * AllowOrigin: 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * + * @param string[] $allowOrigin + */ + public function setAllowOrigin(array $allowOrigin) + { + $this->set("AllowOrigin", $allowOrigin); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getAllowHeaders() + { + return $this->get("AllowHeaders"); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $allowHeaders + */ + public function setAllowHeaders(array $allowHeaders) + { + $this->set("AllowHeaders", $allowHeaders); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getExposeHeaders() + { + return $this->get("ExposeHeaders"); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $exposeHeaders + */ + public function setExposeHeaders(array $exposeHeaders) + { + $this->set("ExposeHeaders", $exposeHeaders); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GET。POST。PUT。DELETE。HEAD。OPTIONS。PATCH。 + * + * @return string[]|null + */ + public function getAllowMethods() + { + return $this->get("AllowMethods"); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GET。POST。PUT。DELETE。HEAD。OPTIONS。PATCH。 + * + * @param string[] $allowMethods + */ + public function setAllowMethods(array $allowMethods) + { + $this->set("AllowMethods", $allowMethods); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @return string|null + */ + public function getAllowCredentials() + { + return $this->get("AllowCredentials"); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @param string $allowCredentials + */ + public function setAllowCredentials($allowCredentials) + { + $this->set("AllowCredentials", $allowCredentials); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @return integer|null + */ + public function getMaxAge() + { + return $this->get("MaxAge"); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @param int $maxAge + */ + public function setMaxAge($maxAge) + { + $this->set("MaxAge", $maxAge); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsFixedResponseConfig.php b/src/ULB/Params/CreateRuleParamRuleActionsFixedResponseConfig.php new file mode 100644 index 00000000..925fa215 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsFixedResponseConfig.php @@ -0,0 +1,64 @@ +get("HttpCode"); + } + + /** + * HttpCode: 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * + * @param int $httpCode + */ + public function setHttpCode($httpCode) + { + $this->set("HttpCode", $httpCode); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @return string|null + */ + public function getContent() + { + return $this->get("Content"); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @param string $content + */ + public function setContent($content) + { + $this->set("Content", $content); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsForwardConfig.php b/src/ULB/Params/CreateRuleParamRuleActionsForwardConfig.php new file mode 100644 index 00000000..4f5b5ae5 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsForwardConfig.php @@ -0,0 +1,56 @@ +get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new CreateRuleParamRuleActionsForwardConfigTargets($item)); + } + return $result; + } + + /** + * Targets: + * + * @param CreateRuleParamRuleActionsForwardConfigTargets[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsForwardConfigTargets.php b/src/ULB/Params/CreateRuleParamRuleActionsForwardConfigTargets.php new file mode 100644 index 00000000..6251b528 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsForwardConfigTargets.php @@ -0,0 +1,64 @@ +get("Id"); + } + + /** + * Id: 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填 + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * Weight: 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsInsertHeaderConfig.php b/src/ULB/Params/CreateRuleParamRuleActionsInsertHeaderConfig.php new file mode 100644 index 00000000..10a6da15 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsInsertHeaderConfig.php @@ -0,0 +1,84 @@ +get("Key"); + } + + /** + * Key: 插入的 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 + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @return string|null + */ + public function getValueType() + { + return $this->get("ValueType"); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @param string $valueType + */ + public function setValueType($valueType) + { + $this->set("ValueType", $valueType); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @return string|null + */ + public function getValue() + { + return $this->get("Value"); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @param string $value + */ + public function setValue($value) + { + $this->set("Value", $value); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleActionsRemoveHeaderConfig.php b/src/ULB/Params/CreateRuleParamRuleActionsRemoveHeaderConfig.php new file mode 100644 index 00000000..3e0039c0 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleActionsRemoveHeaderConfig.php @@ -0,0 +1,44 @@ +get("Key"); + } + + /** + * Key: 删除的 header 字段名称,目前只能删除以下几个默认配置的字段X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleConditions.php b/src/ULB/Params/CreateRuleParamRuleConditions.php new file mode 100644 index 00000000..b71cc2b9 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleConditions.php @@ -0,0 +1,84 @@ +get("Type"); + } + + /** + * Type: 匹配条件类型。限定枚举值:"Host"/"Path" + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * HostConfig: + * + * @return CreateRuleParamRuleConditionsHostConfig|null + */ + public function getHostConfig() + { + return new CreateRuleParamRuleConditionsHostConfig($this->get("HostConfig")); + } + + /** + * HostConfig: + * + * @param CreateRuleParamRuleConditionsHostConfig $hostConfig + */ + public function setHostConfig(array $hostConfig) + { + $this->set("HostConfig", $hostConfig->getAll()); + } + + /** + * PathConfig: + * + * @return CreateRuleParamRuleConditionsPathConfig|null + */ + public function getPathConfig() + { + return new CreateRuleParamRuleConditionsPathConfig($this->get("PathConfig")); + } + + /** + * PathConfig: + * + * @param CreateRuleParamRuleConditionsPathConfig $pathConfig + */ + public function setPathConfig(array $pathConfig) + { + $this->set("PathConfig", $pathConfig->getAll()); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleConditionsHostConfig.php b/src/ULB/Params/CreateRuleParamRuleConditionsHostConfig.php new file mode 100644 index 00000000..ce96f99a --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleConditionsHostConfig.php @@ -0,0 +1,64 @@ +get("MatchMode"); + } + + /** + * MatchMode: 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular" + * + * @param string $matchMode + */ + public function setMatchMode($matchMode) + { + $this->set("MatchMode", $matchMode); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填 + * + * @return string[]|null + */ + public function getValues() + { + return $this->get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } +} diff --git a/src/ULB/Params/CreateRuleParamRuleConditionsPathConfig.php b/src/ULB/Params/CreateRuleParamRuleConditionsPathConfig.php new file mode 100644 index 00000000..b0013048 --- /dev/null +++ b/src/ULB/Params/CreateRuleParamRuleConditionsPathConfig.php @@ -0,0 +1,44 @@ +get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关条件;路径匹配时必填 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } +} diff --git a/src/ULB/Params/UpdateBackendBatchParamAttributes.php b/src/ULB/Params/UpdateBackendBatchParamAttributes.php new file mode 100644 index 00000000..c4b82274 --- /dev/null +++ b/src/ULB/Params/UpdateBackendBatchParamAttributes.php @@ -0,0 +1,124 @@ +get("BackendId"); + } + + /** + * BackendId: 后端资源实例的ID(ULB后端ID,非资源自身ID) + * + * @param string $backendId + */ + public function setBackendId($backendId) + { + $this->set("BackendId", $backendId); + } + + /** + * Port: 后端资源服务端口,取值范围[1-65535] + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 后端资源服务端口,取值范围[1-65535] + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * Weight: 所添加的后端RS权重(在加权轮询算法下有效),取值范围[0-100],默认为1 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 所添加的后端RS权重(在加权轮询算法下有效),取值范围[0-100],默认为1 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * Enabled: 后端实例状态开关 + * + * @return integer|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 后端实例状态开关 + * + * @param int $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * IsBackup: 是否为backup 0:主rs 1:备rs 默认为0 + * + * @return integer|null + */ + public function getIsBackup() + { + return $this->get("IsBackup"); + } + + /** + * IsBackup: 是否为backup 0:主rs 1:备rs 默认为0 + * + * @param int $isBackup + */ + public function setIsBackup($isBackup) + { + $this->set("IsBackup", $isBackup); + } +} diff --git a/src/ULB/Params/UpdateListenerAttributeParamHealthCheckConfig.php b/src/ULB/Params/UpdateListenerAttributeParamHealthCheckConfig.php new file mode 100644 index 00000000..9566b660 --- /dev/null +++ b/src/ULB/Params/UpdateListenerAttributeParamHealthCheckConfig.php @@ -0,0 +1,104 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启健康检查功能。暂时不支持关闭;默认值为:true + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: 健康检查方式。应用型限定取值:“Port”/"HTTP";默认值:“Port” + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: 健康检查方式。应用型限定取值:“Port”/"HTTP";默认值:“Port” + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * Domain: (应用型专用)HTTP检查域名 + * + * @return string|null + */ + public function getDomain() + { + return $this->get("Domain"); + } + + /** + * Domain: (应用型专用)HTTP检查域名 + * + * @param string $domain + */ + public function setDomain($domain) + { + $this->set("Domain", $domain); + } + + /** + * Path: (应用型专用)HTTP检查路径 + * + * @return string|null + */ + public function getPath() + { + return $this->get("Path"); + } + + /** + * Path: (应用型专用)HTTP检查路径 + * + * @param string $path + */ + public function setPath($path) + { + $this->set("Path", $path); + } +} diff --git a/src/ULB/Params/UpdateListenerAttributeParamStickinessConfig.php b/src/ULB/Params/UpdateListenerAttributeParamStickinessConfig.php new file mode 100644 index 00000000..9b48e55a --- /dev/null +++ b/src/ULB/Params/UpdateListenerAttributeParamStickinessConfig.php @@ -0,0 +1,84 @@ +get("Enabled"); + } + + /** + * Enabled: 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现,网络型负载均衡则基于源IP,保证在对应的空闲超时时间内,同一个源IP送到同一个服务节点。默认值为:false + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined",默认值为:“ServerInsert” + * + * @return string|null + */ + public function getType() + { + return $this->get("Type"); + } + + /** + * Type: (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined",默认值为:“ServerInsert” + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + * + * @return string|null + */ + public function getCookieName() + { + return $this->get("CookieName"); + } + + /** + * CookieName: (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + * + * @param string $cookieName + */ + public function setCookieName($cookieName) + { + $this->set("CookieName", $cookieName); + } +} diff --git a/src/ULB/Params/UpdateLoadBalancerAttributeParamAccessLogConfig.php b/src/ULB/Params/UpdateLoadBalancerAttributeParamAccessLogConfig.php new file mode 100644 index 00000000..19059db7 --- /dev/null +++ b/src/ULB/Params/UpdateLoadBalancerAttributeParamAccessLogConfig.php @@ -0,0 +1,84 @@ +get("Enabled"); + } + + /** + * Enabled: (应用型专用)是否开启访问日志记录功能 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * US3BucketName: (应用型专用)用于存储访问日志的bucket + * + * @return string|null + */ + public function getUS3BucketName() + { + return $this->get("US3BucketName"); + } + + /** + * US3BucketName: (应用型专用)用于存储访问日志的bucket + * + * @param string $us3BucketName + */ + public function setUS3BucketName($us3BucketName) + { + $this->set("US3BucketName", $us3BucketName); + } + + /** + * US3TokenId: (应用型专用)上传访问日志到bucket所需的token + * + * @return string|null + */ + public function getUS3TokenId() + { + return $this->get("US3TokenId"); + } + + /** + * US3TokenId: (应用型专用)上传访问日志到bucket所需的token + * + * @param string $us3TokenId + */ + public function setUS3TokenId($us3TokenId) + { + $this->set("US3TokenId", $us3TokenId); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActions.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActions.php new file mode 100644 index 00000000..1db80e4f --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActions.php @@ -0,0 +1,164 @@ +get("Type"); + } + + /** + * Type: 动作类型。限定枚举值:"Forward";RuleActions数组长度不为0时必填 + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * ForwardConfig: + * + * @return UpdateRuleAttributeParamRuleActionsForwardConfig|null + */ + public function getForwardConfig() + { + return new UpdateRuleAttributeParamRuleActionsForwardConfig($this->get("ForwardConfig")); + } + + /** + * ForwardConfig: + * + * @param UpdateRuleAttributeParamRuleActionsForwardConfig $forwardConfig + */ + public function setForwardConfig(array $forwardConfig) + { + $this->set("ForwardConfig", $forwardConfig->getAll()); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @return integer|null + */ + public function getOrder() + { + return $this->get("Order"); + } + + /** + * Order: 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * + * @param int $order + */ + public function setOrder($order) + { + $this->set("Order", $order); + } + + /** + * InsertHeaderConfig: + * + * @return UpdateRuleAttributeParamRuleActionsInsertHeaderConfig|null + */ + public function getInsertHeaderConfig() + { + return new UpdateRuleAttributeParamRuleActionsInsertHeaderConfig($this->get("InsertHeaderConfig")); + } + + /** + * InsertHeaderConfig: + * + * @param UpdateRuleAttributeParamRuleActionsInsertHeaderConfig $insertHeaderConfig + */ + public function setInsertHeaderConfig(array $insertHeaderConfig) + { + $this->set("InsertHeaderConfig", $insertHeaderConfig->getAll()); + } + + /** + * RemoveHeaderConfig: + * + * @return UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig|null + */ + public function getRemoveHeaderConfig() + { + return new UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig($this->get("RemoveHeaderConfig")); + } + + /** + * RemoveHeaderConfig: + * + * @param UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig $removeHeaderConfig + */ + public function setRemoveHeaderConfig(array $removeHeaderConfig) + { + $this->set("RemoveHeaderConfig", $removeHeaderConfig->getAll()); + } + + /** + * CorsConfig: + * + * @return UpdateRuleAttributeParamRuleActionsCorsConfig|null + */ + public function getCorsConfig() + { + return new UpdateRuleAttributeParamRuleActionsCorsConfig($this->get("CorsConfig")); + } + + /** + * CorsConfig: + * + * @param UpdateRuleAttributeParamRuleActionsCorsConfig $corsConfig + */ + public function setCorsConfig(array $corsConfig) + { + $this->set("CorsConfig", $corsConfig->getAll()); + } + + /** + * FixedResponseConfig: + * + * @return UpdateRuleAttributeParamRuleActionsFixedResponseConfig|null + */ + public function getFixedResponseConfig() + { + return new UpdateRuleAttributeParamRuleActionsFixedResponseConfig($this->get("FixedResponseConfig")); + } + + /** + * FixedResponseConfig: + * + * @param UpdateRuleAttributeParamRuleActionsFixedResponseConfig $fixedResponseConfig + */ + public function setFixedResponseConfig(array $fixedResponseConfig) + { + $this->set("FixedResponseConfig", $fixedResponseConfig->getAll()); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsCorsConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsCorsConfig.php new file mode 100644 index 00000000..bb28a826 --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsCorsConfig.php @@ -0,0 +1,144 @@ +get("AllowOrigin"); + } + + /** + * AllowOrigin: 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * + * @param string[] $allowOrigin + */ + public function setAllowOrigin(array $allowOrigin) + { + $this->set("AllowOrigin", $allowOrigin); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getAllowHeaders() + { + return $this->get("AllowHeaders"); + } + + /** + * AllowHeaders: 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $allowHeaders + */ + public function setAllowHeaders(array $allowHeaders) + { + $this->set("AllowHeaders", $allowHeaders); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @return string[]|null + */ + public function getExposeHeaders() + { + return $this->get("ExposeHeaders"); + } + + /** + * ExposeHeaders: 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * + * @param string[] $exposeHeaders + */ + public function setExposeHeaders(array $exposeHeaders) + { + $this->set("ExposeHeaders", $exposeHeaders); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GET。POST。PUT。DELETE。HEAD。OPTIONS。PATCH。 + * + * @return string[]|null + */ + public function getAllowMethods() + { + return $this->get("AllowMethods"); + } + + /** + * AllowMethods: 选择跨域访问时允许的 HTTP 方法。取值:GET。POST。PUT。DELETE。HEAD。OPTIONS。PATCH。 + * + * @param string[] $allowMethods + */ + public function setAllowMethods(array $allowMethods) + { + $this->set("AllowMethods", $allowMethods); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @return string|null + */ + public function getAllowCredentials() + { + return $this->get("AllowCredentials"); + } + + /** + * AllowCredentials: 是否允许携带凭证信息。取值:on:是。off:否。 + * + * @param string $allowCredentials + */ + public function setAllowCredentials($allowCredentials) + { + $this->set("AllowCredentials", $allowCredentials); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @return integer|null + */ + public function getMaxAge() + { + return $this->get("MaxAge"); + } + + /** + * MaxAge: 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * + * @param int $maxAge + */ + public function setMaxAge($maxAge) + { + $this->set("MaxAge", $maxAge); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsFixedResponseConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsFixedResponseConfig.php new file mode 100644 index 00000000..6a735b85 --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsFixedResponseConfig.php @@ -0,0 +1,64 @@ +get("HttpCode"); + } + + /** + * HttpCode: 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * + * @param int $httpCode + */ + public function setHttpCode($httpCode) + { + $this->set("HttpCode", $httpCode); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @return string|null + */ + public function getContent() + { + return $this->get("Content"); + } + + /** + * Content: 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * + * @param string $content + */ + public function setContent($content) + { + $this->set("Content", $content); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfig.php new file mode 100644 index 00000000..eb2dce5a --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfig.php @@ -0,0 +1,56 @@ +get("Targets"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UpdateRuleAttributeParamRuleActionsForwardConfigTargets($item)); + } + return $result; + } + + /** + * Targets: + * + * @param UpdateRuleAttributeParamRuleActionsForwardConfigTargets[] $targets + */ + public function setTargets(array $targets) + { + $result = []; + foreach ($targets as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfigTargets.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfigTargets.php new file mode 100644 index 00000000..41fce9e7 --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsForwardConfigTargets.php @@ -0,0 +1,64 @@ +get("Id"); + } + + /** + * Id: 转发的后端服务节点的标识ID。限定在监听器的服务节点池里;数组长度可以是0;转发服务节点配置的数组长度不为0时,Id必填 + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * Weight: 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 转发的后端服务节点的权重。仅监听器负载均衡算法是加权轮询是有效 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsInsertHeaderConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsInsertHeaderConfig.php new file mode 100644 index 00000000..61f0be7d --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsInsertHeaderConfig.php @@ -0,0 +1,84 @@ +get("Key"); + } + + /** + * Key: 插入的 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 + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @return string|null + */ + public function getValueType() + { + return $this->get("ValueType"); + } + + /** + * ValueType: 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * + * @param string $valueType + */ + public function setValueType($valueType) + { + $this->set("ValueType", $valueType); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @return string|null + */ + public function getValue() + { + return $this->get("Value"); + } + + /** + * Value: 插入的 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、数字、短划线(-)和下划线(_)。 + * + * @param string $value + */ + public function setValue($value) + { + $this->set("Value", $value); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig.php new file mode 100644 index 00000000..ee9904fd --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleActionsRemoveHeaderConfig.php @@ -0,0 +1,44 @@ +get("Key"); + } + + /** + * Key: 删除的 header 字段名称,目前只能删除以下几个默认配置的字段X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * + * @param string $key + */ + public function setKey($key) + { + $this->set("Key", $key); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleConditions.php b/src/ULB/Params/UpdateRuleAttributeParamRuleConditions.php new file mode 100644 index 00000000..2992ea05 --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleConditions.php @@ -0,0 +1,84 @@ +get("Type"); + } + + /** + * Type: 匹配条件类型。限定枚举值:"Host"/"Path";RuleConditions数组长度不为0时必填 + * + * @param string $type + */ + public function setType($type) + { + $this->set("Type", $type); + } + + /** + * HostConfig: + * + * @return UpdateRuleAttributeParamRuleConditionsHostConfig|null + */ + public function getHostConfig() + { + return new UpdateRuleAttributeParamRuleConditionsHostConfig($this->get("HostConfig")); + } + + /** + * HostConfig: + * + * @param UpdateRuleAttributeParamRuleConditionsHostConfig $hostConfig + */ + public function setHostConfig(array $hostConfig) + { + $this->set("HostConfig", $hostConfig->getAll()); + } + + /** + * PathConfig: + * + * @return UpdateRuleAttributeParamRuleConditionsPathConfig|null + */ + public function getPathConfig() + { + return new UpdateRuleAttributeParamRuleConditionsPathConfig($this->get("PathConfig")); + } + + /** + * PathConfig: + * + * @param UpdateRuleAttributeParamRuleConditionsPathConfig $pathConfig + */ + public function setPathConfig(array $pathConfig) + { + $this->set("PathConfig", $pathConfig->getAll()); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsHostConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsHostConfig.php new file mode 100644 index 00000000..033e5fbc --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsHostConfig.php @@ -0,0 +1,64 @@ +get("MatchMode"); + } + + /** + * MatchMode: 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular" + * + * @param string $matchMode + */ + public function setMatchMode($matchMode) + { + $this->set("MatchMode", $matchMode); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;修改域名匹配时必填 + * + * @return string[]|null + */ + public function getValues() + { + return $this->get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;修改域名匹配时必填 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } +} diff --git a/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsPathConfig.php b/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsPathConfig.php new file mode 100644 index 00000000..851e21bd --- /dev/null +++ b/src/ULB/Params/UpdateRuleAttributeParamRuleConditionsPathConfig.php @@ -0,0 +1,44 @@ +get("Values"); + } + + /** + * Values: 取值。暂时只支持数组长度为1;取值需符合相关条件;修改路径匹配时必填 + * + * @param string[] $values + */ + public function setValues(array $values) + { + $this->set("Values", $values); + } +} diff --git a/src/ULB/Params/UpdateTargetsAttributeParamTargets.php b/src/ULB/Params/UpdateTargetsAttributeParamTargets.php new file mode 100644 index 00000000..f9f46bb8 --- /dev/null +++ b/src/ULB/Params/UpdateTargetsAttributeParamTargets.php @@ -0,0 +1,104 @@ +get("Id"); + } + + /** + * Id: 服务节点的标识ID。限定枚举值:"UHost" / "UNI"/"UPM"/"IP";要更新的Targets数组长度至少为1,不超过20个 + * + * @param string $id + */ + public function setId($id) + { + $this->set("Id", $id); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效;要更新的Targets数组长度至少为1,不超过20个 + * + * @return integer|null + */ + public function getWeight() + { + return $this->get("Weight"); + } + + /** + * Weight: 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效;要更新的Targets数组长度至少为1,不超过20个 + * + * @param int $weight + */ + public function setWeight($weight) + { + $this->set("Weight", $weight); + } + + /** + * Enabled: 服务节点是否启用。默认值true;要更新的Targets数组长度至少为1,不超过20个 + * + * @return boolean|null + */ + public function getEnabled() + { + return $this->get("Enabled"); + } + + /** + * Enabled: 服务节点是否启用。默认值true;要更新的Targets数组长度至少为1,不超过20个 + * + * @param boolean $enabled + */ + public function setEnabled($enabled) + { + $this->set("Enabled", $enabled); + } + + /** + * IsBackup: 服务节点是否为备节点。默认值false;要更新的Targets数组长度至少为1,不超过20个 + * + * @return boolean|null + */ + public function getIsBackup() + { + return $this->get("IsBackup"); + } + + /** + * IsBackup: 服务节点是否为备节点。默认值false;要更新的Targets数组长度至少为1,不超过20个 + * + * @param boolean $isBackup + */ + public function setIsBackup($isBackup) + { + $this->set("IsBackup", $isBackup); + } +} diff --git a/src/ULB/ULBClient.php b/src/ULB/ULBClient.php index 0c7b002b..5426a3d9 100644 --- a/src/ULB/ULBClient.php +++ b/src/ULB/ULBClient.php @@ -1,6 +1,6 @@ (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) 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) [ + * [ + * "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) 服务节点信息[ + * [ + * "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 * @@ -77,13 +216,13 @@ class ULBClient extends Client * $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 + * "ULBId" => (string) 传统型负载均衡实例的ID * "VServerId" => (string) VServer实例的ID - * "ResourceType" => (string) 所添加的后端资源的类型,枚举值:UHost -> 云主机;UNI -> 虚拟网卡;UPM -> 物理云主机; UDHost -> 私有专区主机;UDocker -> 容器;UHybrid->混合云主机;CUBE->Cube,USDP->智能大数据平台;默认值为UHost。报文转发模式不支持UDocker、UHybrid、CUBE - * "ResourceId" => (string) 所添加的后端资源的资源ID - * "ResourceIP" => (string) 所添加的后端服务器的资源实例IP,当ResourceType 为 UHybrid 时有效,且必填 - * "VPCId" => (string) 所添加的后端服务器所在的vpc,当ResourceType 为 UHybrid 时有效,且必填 - * "SubnetId" => (string) 所添加的后端服务器所在的子网,当ResourceType 为 UHybrid 时有效,且必填 + * "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:禁用 默认为启用 @@ -93,7 +232,7 @@ class ULBClient extends Client * Outputs: * * $outputs = [ - * "BackendId" => (string) 所添加的后端资源在ULB中的对象ID,(为ULB系统中使用,与资源自身ID无关),可用于 UpdateBackendAttribute/UpdateBackendAttributeBatch/ReleaseBackend + * "BackendId" => (string) 所添加的后端资源在CLB中的对象ID,(为CLB系统中使用,与资源自身ID无关),可用于 UpdateBackendAttribute/UpdateBackendAttributeBatch/ReleaseBackend * ] * * @return AllocateBackendResponse @@ -106,16 +245,16 @@ public function allocateBackend(AllocateBackendRequest $request = null) } /** - * BindSSL - 将SSL证书绑定到VServer + * BindSSL - 将SSL证书绑定到传统型负载均衡VServer * * See also: https://docs.ucloud.cn/api/ulb-api/bind_ssl * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 所绑定ULB实例ID + * "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 * ] @@ -135,21 +274,110 @@ public function bindSSL(BindSSLRequest $request = null) } /** - * CreatePolicy - 创建VServer内容转发策略 + * 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) (应用型专用)服务器默认证书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",默认值:“Port” + * "Domain" => (string) (应用型专用)HTTP检查域名 + * "Path" => (string) (应用型专用)HTTP检查路径 + * ] + * "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩。默认值为:false + * "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启;默认值为:false + * "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启;默认值为:false + * "RedirectPort" => (integer) (应用型专用)重定向端口。限定取值:[1-65535],默认值443 + * ] + * + * 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,实际收费按一个周期计费) + * "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) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 需要添加内容转发策略的负载均衡实例ID - * "VServerId" => (string) 需要添加内容转发策略的VServer实例ID - * "BackendId" => (array) 内容转发策略应用的后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId + * "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) 内容转发策略应用的传统型负载均衡后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId * "Match" => (string) 内容转发匹配字段 + * "DomainMatchMode" => (string) 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 * "Type" => (string) 内容转发匹配字段的类型 - * "PolicyPriority" => (integer) 策略优先级,1-9999 + * "PolicyPriority" => (integer) 策略优先级,1-9999;只针对路径规则生效 * ] * * Outputs: @@ -167,6 +395,82 @@ public function createPolicy(CreatePolicyRequest $request = null) 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) [ + * [ + * "Type" => (string) 匹配条件类型。限定枚举值:"Host"/"Path" + * "HostConfig" => (object) [ + * "MatchMode" => (string) 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular" + * "Values" => (array) 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;域名匹配时必填 + * ] + * "PathConfig" => (object) [ + * "Values" => (array) 取值。暂时只支持数组长度为1;取值需符合相关条件;路径匹配时必填 + * ] + * ] + * ] + * "RuleActions" => (array) [ + * [ + * "Type" => (string) 动作类型。限定枚举值:"Forward"、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader"。只会处理 Type 对应的结构体。 + * "ForwardConfig" => (object) [ + * "Targets" => (array) [ + * [ + * "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) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * "AllowHeaders" => (array) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "ExposeHeaders" => (array) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "AllowMethods" => (array) 选择跨域访问时允许的 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范围内、不包括 $ 的可打印字符。 + * ] + * ] + * ] + * "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证书分别传过来 * @@ -183,6 +487,7 @@ public function createPolicy(CreatePolicyRequest $request = null) * "UserCert" => (string) 用户的证书 * "PrivateKey" => (string) 加密证书的私钥 * "CaCert" => (string) CA证书 + * "USSLId" => (string) USSL证书的ID * ] * * Outputs: @@ -201,7 +506,37 @@ public function createSSL(CreateSSLRequest $request = null) } /** - * CreateULB - 创建负载均衡实例,可以选择内网或者外网 + * 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) 加密套件 + * "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 * @@ -213,20 +548,20 @@ public function createSSL(CreateSSLRequest $request = null) * "ULBName" => (string) 负载均衡的名字,默认值为“ULB” * "Tag" => (string) 业务组 * "Remark" => (string) 备注 - * "OuterMode" => (string) 创建的ULB是否为外网模式,默认即为外网模式 - * "InnerMode" => (string) 创建的ULB是否为内网模式 + * "OuterMode" => (string) 创建的CLB是否为外网模式,默认即为外网模式 + * "InnerMode" => (string) 创建的CLB是否为内网模式 * "ChargeType" => (string) 付费方式, 枚举值为: Year, 按年付费; Month, 按月付费; Dynamic, 按时付费 - * "VPCId" => (string) ULB所在的VPC的ID, 如果不传则使用默认的VPC - * "SubnetId" => (string) ULB 所属的子网ID,如果不传则随机选择一个。 - * "BusinessId" => (string) ULB 所属的业务组ID,如果不传则使用默认的业务组 + * "VPCId" => (string) CLB所在的VPC的ID。 如果不传则使用默认的VPC,若不传且无默认VPC则接口报错 + * "SubnetId" => (string) CLB 所属的子网ID,如果不传则随机选择一个。 + * "BusinessId" => (string) CLB 所属的业务组ID,如果不传则使用默认的业务组 * "FirewallId" => (string) 防火墙ID,如果不传,则默认不绑定防火墙 - * "ListenType" => (string) ULB 监听器类型,外网ULB默认RequestProxy,内网ULB默认PacketsTransmit。枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发。 + * "ListenType" => (string) CLB 监听器类型,外网CLB默认RequestProxy,内网ULB默认PacketsTransmit。枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发。 * ] * * Outputs: * * $outputs = [ - * "ULBId" => (string) 负载均衡实例的Id + * "ULBId" => (string) 传统型负载均衡实例的Id * "IPv6AddressId" => (string) IPv6地址Id * ] * @@ -240,7 +575,7 @@ public function createULB(CreateULBRequest $request = null) } /** - * CreateVServer - 创建VServer实例,定义监听的协议和端口以及负载均衡算法 + * CreateVServer - 创建CLB的VServer实例,定义监听的协议和端口以及负载均衡算法 * * See also: https://docs.ucloud.cn/api/ulb-api/create_vserver * @@ -249,7 +584,7 @@ public function createULB(CreateULBRequest $request = null) * $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 + * "ULBId" => (string) 传统型负载均衡实例ID * "VServerName" => (string) VServer实例名称,默认为"VServer" * "ListenType" => (string) 监听器类型,枚举值,RequestProxy ,请求代理;PacketsTransmit ,报文转发。默认为RequestProxy * "Protocol" => (string) VServer实例的协议,请求代理模式下有 HTTP、HTTPS、TCP,报文转发下有 TCP,UDP。默认为“HTTP" @@ -263,6 +598,10 @@ public function createULB(CreateULBRequest $request = null) * "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: @@ -281,17 +620,73 @@ public function createVServer(CreateVServerRequest $request = null) } /** - * DeletePolicy - 删除内容转发策略 + * 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) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "PolicyId" => (string) 内容转发策略ID - * "VServerId" => (string) VServer 资源ID + * "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: @@ -308,6 +703,35 @@ public function deletePolicy(DeletePolicyRequest $request = null) 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证书 * @@ -336,17 +760,18 @@ public function deleteSSL(DeleteSSLRequest $request = null) } /** - * DeleteULB - 删除负载均衡实例 + * DeleteSSLBinding - 删除监听器绑定的扩展证书 * - * See also: https://docs.ucloud.cn/api/ulb-api/delete_ulb + * See also: https://docs.ucloud.cn/api/ulb-api/delete_ssl_binding * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 负载均衡实例的ID - * "ReleaseEip" => (boolean) 删除ulb时是否释放绑定的EIP,false标识只解绑EIP,true表示会释放绑定的EIP,默认是false。Anycast IP 此参数无效 + * "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) SSLId的数组 * ] * * Outputs: @@ -354,27 +779,26 @@ public function deleteSSL(DeleteSSLRequest $request = null) * $outputs = [ * ] * - * @return DeleteULBResponse + * @return DeleteSSLBindingResponse * @throws UCloudException */ - public function deleteULB(DeleteULBRequest $request = null) + public function deleteSSLBinding(DeleteSSLBindingRequest $request = null) { $resp = $this->invoke($request); - return new DeleteULBResponse($resp->toArray(), $resp->getRequestId()); + return new DeleteSSLBindingResponse($resp->toArray(), $resp->getRequestId()); } /** - * DeleteVServer - 删除VServer实例 + * DeleteSecurityPolicy - 删除安全策略 * - * See also: https://docs.ucloud.cn/api/ulb-api/delete_vserver + * See also: https://docs.ucloud.cn/api/ulb-api/delete_security_policy * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 负载均衡实例的ID - * "VServerId" => (string) VServer实例的ID + * "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: @@ -382,38 +806,485 @@ public function deleteULB(DeleteULBRequest $request = null) * $outputs = [ * ] * - * @return DeleteVServerResponse + * @return DeleteSecurityPolicyResponse * @throws UCloudException */ - public function deleteVServer(DeleteVServerRequest $request = null) + public function deleteSecurityPolicy(DeleteSecurityPolicyRequest $request = null) { $resp = $this->invoke($request); - return new DeleteVServerResponse($resp->toArray(), $resp->getRequestId()); + return new DeleteSecurityPolicyResponse($resp->toArray(), $resp->getRequestId()); } /** - * DescribeSSL - 获取SSL证书信息 + * DeleteULB - 删除传统型负载均衡实例 * - * See also: https://docs.ucloud.cn/api/ulb-api/describe_ssl + * See also: https://docs.ucloud.cn/api/ulb-api/delete_ulb * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "SSLId" => (string) SSL证书的Id - * "Limit" => (integer) 数据分页值,默认为20 - * "Offset" => (integer) 数据偏移量,默认值为0 + * "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 = [ - * "TotalCount" => (integer) 满足条件的SSL证书总数 - * "DataSet" => (array) SSL证书详细信息,具体结构见 ULBSSLSet[ - * [ - * "SSLId" => (string) SSL证书的Id - * "SSLName" => (string) SSL证书的名字 + * ] + * + * @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) 负载均衡监听器信息[ + * [ + * "ListenerId" => (string) 监听器的ID + * "Name" => (string) 监听器的名称 + * "Remark" => (string) 监听器的备注信息 + * "ListenerPort" => (integer) 监听器的监听端口 + * "ListenerProtocol" => (string) 监听协议。应用型限定取值: HTTP、HTTPS + * "Certificates" => (array) (应用型专用)服务器默认证书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检查; 默认值:Port + * "Domain" => (string) (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名 + * "Path" => (string) (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径 + * ] + * "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * "RedirectPort" => (integer) (应用型专用)重定向端口 + * "Targets" => (array) 添加的服务节点信息。具体结构详见 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) (应用型专用)转发规则信息[ + * [ + * "RuleId" => (string) 转发规则的ID + * "RuleConditions" => (array) 转发规则匹配条件。具体结构详见 RuleCondition[ + * [ + * "Type" => (string) 匹配条件类型。限定枚举值:Host,Path + * "HostConfig" => (object) 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * "MatchMode" => (string) 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + * ] + * "PathConfig" => (object) 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * ] + * ] + * ] + * "RuleActions" => (array) 转发动作。具体规则详见RuleAction[ + * [ + * "Type" => (string) 动作类型。限定枚举值:Forward、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader" + * "ForwardConfig" => (object) 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet[ + * "Targets" => (array) 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet[ + * [ + * "Id" => (string) 服务节点的标识ID + * "Weight" => (integer) 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + * ] + * ] + * ] + * "FixedResponseConfig" => (object) 静态返回相关配置,对应 type 值: "FixedResponse"。具体结构详见 FixedResponseConfigSet[ + * "HttpCode" => (integer) 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * "Content" => (string) 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * ] + * "InsertHeaderConfig" => (object) 插入 header 相关配置,对应 type 值: "InsertHeader"。具体结构详见 InsertHeaderConfigSet[ + * "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 + * "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、数字、短划线(-)和下划线(_)。 + * "ValueType" => (string) 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * ] + * "CorsConfig" => (object) 跨域相关配置,对应 type 值: "Cors"。具体结构详见 CorsConfigSet[ + * "AllowOrigin" => (array) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * "AllowHeaders" => (array) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "ExposeHeaders" => (array) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "AllowMethods" => (array) 选择跨域访问时允许的 HTTP 方法。取值:GETPOSTPUTDELETEHEADOPTIONSPATCH + * "AllowCredentials" => (string) 是否允许携带凭证信息。取值:on:是。off:否。 + * "MaxAge" => (integer) 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * ] + * "RemoveHeaderConfig" => (object) 删除 header 相关配置,对应 type 值: "RemoveHeader"。具体结构详见 RemoveHeaderConfigSet[ + * "Key" => (string) 删除的 header 字段名称,目前只能删除以下几个默认配置的字段: X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * ] + * "Order" => (integer) 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * ] + * ] + * "IsDefault" => (boolean) 是否为默认转发规则 + * "Pass" => (boolean) 当转发的服务节点为空时,规则是否忽略 + * ] + * ] + * "State" => (string) listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态 + * ] + * ] + * ] + * + * @return DescribeListenersResponse + * @throws UCloudException + */ + public function describeListeners(DescribeListenersRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeListenersResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeLoadBalancers - 描述特定条件下的应用型负载均衡实例或者全部的应用型负载均衡实例 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_load_balancers + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "Type" => (string) 负载均衡实例的类型。限定枚举值:"Application" / "Network",默认值:"Application" + * "ShowDetail" => (boolean) 是否获取监听器和后端服务节点的详细信息。默认值:false + * "LoadBalancerIds" => (array) 负载均衡实例的ID。必须是同一类型的实例,若指定了实例ID,将忽略除Type外的其他过滤条件 + * "VPCId" => (string) 限定所在的VPC + * "SubnetId" => (string) 限定所在的子网 + * "Offset" => (string) 数据偏移量,默认为0 + * "Limit" => (string) 数据分页值,默认为100 + * ] + * + * Outputs: + * + * $outputs = [ + * "TotalCount" => (integer) 满足条件的负载均衡实例总数 + * "LoadBalancers" => (array) 负载均衡实例信息[ + * [ + * "VPCId" => (string) 负载均衡实例所属的VPC资源ID + * "SubnetId" => (string) 负载均衡实例所属的子网资源ID。负载均衡实例的内网VIP和SNAT场景的源IP限定在该子网内;指定子网不影响添加后端服务节点时的范围,依旧是整个VPC下支持的资源 + * "LoadBalancerId" => (string) 负载均衡实例的ID + * "Type" => (string) 负载均衡实例的类型。限定枚举值:Application -> 应用型,Network -> 网络型 + * "Name" => (string) 负载均衡实例的名称 + * "Tag" => (string) 负载均衡实例所属的业务组ID + * "Remark" => (string) 负载均衡实例的备注信息 + * "IPVersion" => (string) 负载均衡实例支持的IP协议版本 + * "IPInfos" => (array) 绑定的IP信息。具体结构详见 IPInfo[ + * [ + * "IP" => (string) IP地址 + * "Id" => (string) 唯一标识ID + * "IPVersion" => (string) IP协议版本 + * "OperatorName" => (string) 外网IP的运营商信息。枚举值为:Telecom -> 电信,Unicom -> 联通,International -> 国际IP,Bgp -> BGP,Duplet -> 双线(电信+联通双线路),BGPPro -> 精品BGP,China-mobile -> 中国移动,Anycast -> AnycastEIP + * "BandwidthType" => (integer) 带宽类型。限定枚举值:1 -> 共享带宽,0 -> 普通带宽类型 + * "Bandwidth" => (integer) 带宽值。单位M + * "AddressType" => (string) 网络模式。 限定枚举值:Internet -> 互联网,Intranet -> 内联网 + * ] + * ] + * "SnatIPs" => (array) 应用型实例的代理IP或网络型FULLNAT模式下snat所用的IP + * "Firewall" => (object) 防火墙信息[ + * "FirewallName" => (string) 防火墙名称 + * "FirewallId" => (string) 防火墙ID + * ] + * "AccessLogConfig" => (object) (应用型专用)访问日志相关配置[ + * "Enabled" => (boolean) (应用型专用)是否开启访问日志记录功能 + * "US3BucketName" => (string) (应用型专用)用于存储访问日志的bucket + * "US3TokenId" => (string) (应用型专用)上传访问日志到bucket所需的token + * ] + * "ChargeType" => (string) 付费模式 + * "PurchaseValue" => (integer) 有效期(计费)。格式为Unix Timestamp + * "CreateTime" => (integer) 负载均衡实例创建时间。格式为Unix Timestamp + * "Listeners" => (array) 监听器信息。当ShowDetail为false时,为空[ + * [ + * "ListenerId" => (string) 监听器的ID + * "Name" => (string) 监听器的名称 + * "Remark" => (string) 监听器的备注信息 + * "ListenerPort" => (integer) 监听器的监听端口 + * "ListenerProtocol" => (string) 监听协议。应用型限定取值: HTTP、HTTPS + * "Certificates" => (array) (应用型专用)服务器默认证书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检查; 默认值:Port + * "Domain" => (string) (应用型专用)HTTP检查域名。 当Type为HTTP时,此字段有意义,代表HTTP检查域名 + * "Path" => (string) (应用型专用)HTTP检查路径。当Type为HTTP时,此字段有意义,代表HTTP检查路径 + * ] + * "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * "RedirectPort" => (integer) (应用型专用)重定向端口 + * "Targets" => (array) 添加的服务节点信息。具体结构详见 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) (应用型专用)转发规则信息[ + * [ + * "RuleId" => (string) 转发规则的ID + * "RuleConditions" => (array) 转发规则匹配条件。具体结构详见 RuleCondition[ + * [ + * "Type" => (string) 匹配条件类型。限定枚举值:Host,Path + * "HostConfig" => (object) 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * "MatchMode" => (string) 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + * ] + * "PathConfig" => (object) 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * ] + * ] + * ] + * "RuleActions" => (array) 转发动作。具体规则详见RuleAction[ + * [ + * "Type" => (string) 动作类型。限定枚举值:Forward、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader" + * "ForwardConfig" => (object) 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet[ + * "Targets" => (array) 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet[ + * [ + * "Id" => (string) 服务节点的标识ID + * "Weight" => (integer) 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + * ] + * ] + * ] + * "FixedResponseConfig" => (object) 静态返回相关配置,对应 type 值: "FixedResponse"。具体结构详见 FixedResponseConfigSet[ + * "HttpCode" => (integer) 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * "Content" => (string) 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * ] + * "InsertHeaderConfig" => (object) 插入 header 相关配置,对应 type 值: "InsertHeader"。具体结构详见 InsertHeaderConfigSet[ + * "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 + * "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、数字、短划线(-)和下划线(_)。 + * "ValueType" => (string) 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * ] + * "CorsConfig" => (object) 跨域相关配置,对应 type 值: "Cors"。具体结构详见 CorsConfigSet[ + * "AllowOrigin" => (array) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * "AllowHeaders" => (array) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "ExposeHeaders" => (array) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "AllowMethods" => (array) 选择跨域访问时允许的 HTTP 方法。取值:GETPOSTPUTDELETEHEADOPTIONSPATCH + * "AllowCredentials" => (string) 是否允许携带凭证信息。取值:on:是。off:否。 + * "MaxAge" => (integer) 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * ] + * "RemoveHeaderConfig" => (object) 删除 header 相关配置,对应 type 值: "RemoveHeader"。具体结构详见 RemoveHeaderConfigSet[ + * "Key" => (string) 删除的 header 字段名称,目前只能删除以下几个默认配置的字段: X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * ] + * "Order" => (integer) 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * ] + * ] + * "IsDefault" => (boolean) 是否为默认转发规则 + * "Pass" => (boolean) 当转发的服务节点为空时,规则是否忽略 + * ] + * ] + * "State" => (string) listener健康状态。限定枚举值:Healthy -> 健康,Unhealthy -> 不健康,PartialHealth -> 部分健康,None -> 无节点状态 + * ] + * ] + * "Status" => (string) lb状态:Normal-正常;Arrears-欠费停服 + * "AutoRenewEnabled" => (boolean) 是否开启自动续费 + * ] + * ] + * ] + * + * @return DescribeLoadBalancersResponse + * @throws UCloudException + */ + public function describeLoadBalancers(DescribeLoadBalancersRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeLoadBalancersResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeRules - 描述一条指定的转发规则或者一个应用型负载均衡监听器下的所有转发规则 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_rules + * + * 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。指定RuleId,则只描述该规则 + * ] + * + * Outputs: + * + * $outputs = [ + * "Rules" => (array) 转发规则信息[ + * [ + * "RuleId" => (string) 转发规则的ID + * "RuleConditions" => (array) 转发规则匹配条件。具体结构详见 RuleCondition[ + * [ + * "Type" => (string) 匹配条件类型。限定枚举值:Host,Path + * "HostConfig" => (object) 域名相关配置。Type为Host时必填。具体结构详见 HostConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * "MatchMode" => (string) 匹配方式。限定枚举值:Regular-正则,Wildcard-泛域名; 默认值:Regular + * ] + * "PathConfig" => (object) 路径相关配置。Type为Path时必填。具体结构详见 PathConfigSet[ + * "Values" => (array) 取值。暂时只支持数组长度为1; 取值需符合相关匹配方式的条件 + * ] + * ] + * ] + * "RuleActions" => (array) 转发动作。具体规则详见RuleAction[ + * [ + * "Type" => (string) 动作类型。限定枚举值:Forward、"InsertHeader"、"Cors"、"FixedResponse"、"RemoveHeader" + * "ForwardConfig" => (object) 转发服务节点相关配置,对应 type 值: "Forward"。具体结构详见 ForwardConfigSet[ + * "Targets" => (array) 转发的后端服务节点。限定在监听器的服务节点池里;数组长度可以为0。具体结构详见 ForwardTargetSet[ + * [ + * "Id" => (string) 服务节点的标识ID + * "Weight" => (integer) 权重。仅监听器负载均衡算法是加权轮询是有效;取值范围[1-100],默认值为1 + * ] + * ] + * ] + * "FixedResponseConfig" => (object) 静态返回相关配置,对应 type 值: "FixedResponse"。具体结构详见 FixedResponseConfigSet[ + * "HttpCode" => (integer) 返回的 HTTP 响应码,仅支持 2xx、4xx、5xx 数字,x 为任意数字。 + * "Content" => (string) 返回的固定内容。最大支持存储 1 KB,只支持 ASCII 码值ch >= 32 && ch < 127范围内、不包括 $ 的可打印字符。 + * ] + * "InsertHeaderConfig" => (object) 插入 header 相关配置,对应 type 值: "InsertHeader"。具体结构详见 InsertHeaderConfigSet[ + * "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 + * "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、数字、短划线(-)和下划线(_)。 + * "ValueType" => (string) 头字段内容类型。取值:UserDefined:用户指定。ReferenceHeader:引用用户请求头中的某一个字段。SystemDefined:系统定义。 + * ] + * "CorsConfig" => (object) 跨域相关配置,对应 type 值: "Cors"。具体结构详见 CorsConfigSet[ + * "AllowOrigin" => (array) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * "AllowHeaders" => (array) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "ExposeHeaders" => (array) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "AllowMethods" => (array) 选择跨域访问时允许的 HTTP 方法。取值:GETPOSTPUTDELETEHEADOPTIONSPATCH + * "AllowCredentials" => (string) 是否允许携带凭证信息。取值:on:是。off:否。 + * "MaxAge" => (integer) 预检请求在浏览器的最大缓存时间,单位:秒。取值范围:-1~172800。 + * ] + * "RemoveHeaderConfig" => (object) 删除 header 相关配置,对应 type 值: "RemoveHeader"。具体结构详见 RemoveHeaderConfigSet[ + * "Key" => (string) 删除的 header 字段名称,目前只能删除以下几个默认配置的字段: X-Real-IP、X-Forwarded-For、X-Forwarded-Proto、X-Forwarded-SrcPort + * ] + * "Order" => (integer) 转发规则动作执行的顺序,取值为1~1000,按值从小到大执行动作。值不能为空,不能重复。Forward、FixedResponse 类型的动作不判断 Order,最后一个执行 + * ] + * ] + * "IsDefault" => (boolean) 是否为默认转发规则 + * "Pass" => (boolean) 当转发的服务节点为空时,规则是否忽略 + * ] + * ] + * ] + * + * @return DescribeRulesResponse + * @throws UCloudException + */ + public function describeRules(DescribeRulesRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeRulesResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeSSL - 获取SSL证书信息,仅能获取SSL证书与传统型负载均衡监听器的绑定关系 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_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) + * "SSLId" => (string) SSL证书的Id + * "Limit" => (integer) 数据分页值,默认为20 + * "Offset" => (integer) 数据偏移量,默认值为0 + * ] + * + * Outputs: + * + * $outputs = [ + * "TotalCount" => (integer) 满足条件的SSL证书总数 + * "DataSet" => (array) SSL证书详细信息,具体结构见 ULBSSLSet[ + * [ + * "SSLId" => (string) SSL证书的Id + * "SSLName" => (string) SSL证书的名字 * "SSLType" => (string) SSL证书类型,暂时只有 Pem 一种类型 * "SSLContent" => (string) SSL证书的内容 * "CreateTime" => (integer) SSL证书的创建时间 @@ -426,21 +1297,207 @@ public function deleteVServer(DeleteVServerRequest $request = null) * "ULBName" => (string) ULB实例的名称 * ] * ] + * "SSLSource" => (integer) SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * "USSLId" => (string) USSL证书平台的编号,只有当SSLSource为1时才出现 + * "Domains" => (string) SSL证书平台的域名,多域名时,不展示扩展域名 + * "NotBefore" => (integer) 证书颁发时间 + * "NotAfter" => (integer) 证书过期时间 + * ] + * ] + * ] + * + * @return DescribeSSLResponse + * @throws UCloudException + */ + public function describeSSL(DescribeSSLRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeSSLResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeSSLV2 - 获取SSL证书信息,该接口可以同时获取SSL与传统型和应用型负载均衡监听器的绑定关系 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_sslv2 + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "SSLId" => (string) SSL证书的Id + * "Limit" => (integer) 数据分页值,默认为20 + * "Offset" => (integer) 数据偏移量,默认值为0 + * ] + * + * Outputs: + * + * $outputs = [ + * "TotalCount" => (integer) 满足条件的SSL证书总数 + * "DataSet" => (array) SSL证书详细信息,具体结构见SSLInfo[ + * [ + * "SSLId" => (string) SSL证书的Id + * "SSLName" => (string) SSL证书的名字 + * "SSLType" => (string) SSL证书类型,暂时只有 Pem 一种类型 + * "SSLContent" => (string) SSL证书的内容 + * "CreateTime" => (integer) SSL证书的创建时间 + * "HashValue" => (string) SSL证书的HASH值 + * "Relations" => (array) SSL绑定ULB和ALB的关系[ + * [ + * "LoadBalancerId" => (string) 负载均衡实例的ID + * "LoadBalancerName" => (string) 负载均衡实例的名称 + * "ListenerId" => (string) 监听器的ID + * "ListenerName" => (string) 监听器的名称 + * "IsDefault" => (boolean) 是否为监听器默认SSL证书 + * ] + * ] + * "SSLSource" => (integer) SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * "USSLId" => (string) USSL证书平台的编号,只有当SSLSource为1时才出现 + * "Domains" => (string) SSL证书的域名 + * "DNSNames" => (string) SSL证书的扩展域名 + * "NotBefore" => (integer) 证书颁发时间 + * "NotAfter" => (integer) 证书过期时间 + * ] + * ] + * ] + * + * @return DescribeSSLV2Response + * @throws UCloudException + */ + public function describeSSLV2(DescribeSSLV2Request $request = null) + { + $resp = $this->invoke($request); + return new DescribeSSLV2Response($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeSecurityPolicies - 获取安全策略的信息,绑定关系仅能获取安全策略与传统型负载均衡监听器的绑定关系 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_security_policies + * + * 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 + * "Limit" => (integer) 数据分页值 + * "Offset" => (integer) 数据偏移量 + * ] + * + * Outputs: + * + * $outputs = [ + * "DataSet" => (array) 安全策略列表,每项参数详见SecurityPolicy[ + * [ + * "SecurityPolicyId" => (string) 安全策略ID + * "SecurityPolicyName" => (string) 安全策略名称 + * "TLSVersion" => (string) TLS最低版本 + * "SSLCiphers" => (array) 加密套件 + * "SecurityPolicyType" => (integer) 安全策略类型 0:预定义 1:自定义 + * "VServerSet" => (array) 关联的监听[ + * [ + * "VServerId" => (string) 绑定的VServerId + * "VServerName" => (string) 绑定的VServer名称 + * "Port" => (integer) VServer端口 + * "ULBId" => (string) ULB的ID + * ] + * ] + * ] + * ] + * "TotalCount" => (integer) 满足条件的安全策略总数 + * ] + * + * @return DescribeSecurityPoliciesResponse + * @throws UCloudException + */ + public function describeSecurityPolicies(DescribeSecurityPoliciesRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeSecurityPoliciesResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeSecurityPoliciesV2 - 获取安全策略的信息,可以同时获取安全策略与传统型和应用性负载均衡监听器的绑定关系 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_security_policies_v2 + * + * 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 + * "Limit" => (integer) 数据分页值 + * "Offset" => (integer) 数据偏移量 + * ] + * + * Outputs: + * + * $outputs = [ + * "DataSet" => (array) 安全策略列表,每项参数详见SecurityPolicyInfo[ + * [ + * "SecurityPolicyId" => (string) 安全策略ID + * "SecurityPolicyName" => (string) 安全策略名称 + * "TLSVersion" => (string) TLS最低版本 + * "SSLCiphers" => (array) 加密套件 + * "SecurityPolicyType" => (integer) 安全策略类型 0:预定义 1:自定义 + * "Relations" => (array) 关联的监听[ + * [ + * "LoadBalancerId" => (string) 负载均衡实例的ID + * "ListenerId" => (string) 监听器的ID + * "ListenerName" => (string) 监听器的名称 + * "ListenerPort" => (integer) 监听端口 + * ] + * ] + * ] + * ] + * "TotalCount" => (integer) 满足条件的安全策略总数 + * ] + * + * @return DescribeSecurityPoliciesV2Response + * @throws UCloudException + */ + public function describeSecurityPoliciesV2(DescribeSecurityPoliciesV2Request $request = null) + { + $resp = $this->invoke($request); + return new DescribeSecurityPoliciesV2Response($resp->toArray(), $resp->getRequestId()); + } + + /** + * DescribeSupportCiphers - 返回安全策略所有支持的加密套件 + * + * See also: https://docs.ucloud.cn/api/ulb-api/describe_support_ciphers + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * ] + * + * Outputs: + * + * $outputs = [ + * "DataSet" => (array) 返回支持的TLS最低版本和加密套件,每项参数详见 TLSAndCiphers[ + * [ + * "TLSVersion" => (string) TLS最低版本 + * "SSLCiphers" => (array) 加密套件 * ] * ] * ] * - * @return DescribeSSLResponse + * @return DescribeSupportCiphersResponse * @throws UCloudException */ - public function describeSSL(DescribeSSLRequest $request = null) + public function describeSupportCiphers(DescribeSupportCiphersRequest $request = null) { $resp = $this->invoke($request); - return new DescribeSSLResponse($resp->toArray(), $resp->getRequestId()); + return new DescribeSupportCiphersResponse($resp->toArray(), $resp->getRequestId()); } /** - * DescribeULB - 获取ULB详细信息 + * DescribeULB - 获取CLB详细信息 * * See also: https://docs.ucloud.cn/api/ulb-api/describe_ulb * @@ -451,17 +1508,17 @@ public function describeSSL(DescribeSSLRequest $request = null) * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) * "Offset" => (integer) 数据偏移量,默认为0 * "Limit" => (integer) 数据分页值,默认为20 - * "ULBId" => (string) 负载均衡实例的Id。 若指定则返回指定的负载均衡实例的信息; 若不指定则返回当前数据中心中所有的负载均衡实例的信息 - * "VPCId" => (string) ULB所属的VPC - * "SubnetId" => (string) ULB所属的子网ID - * "BusinessId" => (string) ULB所属的业务组ID + * "ULBId" => (string) 传统型负载均衡实例的Id。 若指定则返回指定的传统型负载均衡实例的信息; 若不指定则返回当前数据中心中所有的传统型负载均衡实例的信息 + * "VPCId" => (string) CLB所属的VPC + * "SubnetId" => (string) CLB所属的子网ID + * "BusinessId" => (string) CLB所属的业务组ID * ] * * Outputs: * * $outputs = [ - * "TotalCount" => (integer) 满足条件的ULB总数 - * "DataSet" => (array) ULB列表,每项参数详见 ULBSet[ + * "TotalCount" => (integer) 满足条件的CLB总数 + * "DataSet" => (array) CLB列表,每项参数详见 ULBSet[ * [ * "ULBId" => (string) 负载均衡的资源ID * "Name" => (string) 负载均衡的资源名称 @@ -482,6 +1539,7 @@ public function describeSSL(DescribeSSLRequest $request = null) * "VServerSet" => (array) 负载均衡实例中存在的VServer实例列表,具体结构见下方 ULBVServerSet[ * [ * "MonitorType" => (string) 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测, Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path; 报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize + * "PersistenceType" => (string) VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 * "ULBId" => (string) 负载均衡实例的Id * "Domain" => (string) 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查域名 * "Path" => (string) 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查路径 @@ -492,7 +1550,6 @@ public function describeSSL(DescribeSSLRequest $request = null) * "Protocol" => (string) VServer实例的协议。 枚举值为:HTTP,TCP,UDP,HTTPS。 * "FrontendPort" => (integer) VServer服务端口 * "Method" => (string) VServer负载均衡的模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口)。 - * "PersistenceType" => (string) VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 * "PersistenceInfo" => (string) 根据PersistenceType确定: None或ServerInsert,此字段为空; UserDefined,此字段展示用户自定义会话string。 * "ClientTimeout" => (integer) 空闲连接的回收时间,单位:秒。 * "Status" => (integer) VServer的运行状态。枚举值: 0 -> rs全部运行正常;1 -> rs全部运行异常;2 -> rs部分运行异常。 @@ -512,6 +1569,11 @@ public function describeSSL(DescribeSSLRequest $request = null) * "ULBName" => (string) ULB实例的名称 * ] * ] + * "SSLSource" => (integer) SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * "USSLId" => (string) USSL证书平台的编号,只有当SSLSource为1时才出现 + * "Domains" => (string) SSL证书平台的域名,多域名时,不展示扩展域名 + * "NotBefore" => (integer) 证书颁发时间 + * "NotAfter" => (integer) 证书过期时间 * ] * ] * "BackendSet" => (array) 后端资源信息列表,具体结构见下方 ULBBackendSet[ @@ -529,6 +1591,8 @@ public function describeSSL(DescribeSSLRequest $request = null) * "Status" => (integer) 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常 * "SubnetId" => (string) 后端提供服务的资源所在的子网的ID * "IsBackup" => (integer) 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs + * "Weight" => (integer) 后端RS权重(在加权轮询算法下有效) + * "VPCId" => (string) 后端服务器所在的VPC * ] * ] * "ListenType" => (string) 监听器类型,枚举值为: RequestProxy -> 请求代理;PacketsTransmit -> 报文转发 @@ -557,10 +1621,21 @@ public function describeSSL(DescribeSSLRequest $request = null) * ] * ] * ] + * "EnableCompression" => (integer) 数据压缩开关,0:关闭 1:开启 + * "SecurityPolicy" => (object) VServer绑定的安全策略,具体结构见BindSecurityPolicy[ + * "SecurityPolicyId" => (string) 安全策略组ID + * "SecurityPolicyName" => (string) 安全策略组名称 + * "TLSVersion" => (string) TLS最低版本 + * "SSLCiphers" => (array) 加密套件 + * "SecurityPolicyType" => (integer) 安全策略类型 0:预定义 1:自定义 + * ] + * "ForwardPort" => (integer) 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * "EnableHTTP2" => (integer) 0:关闭 1:开启,用于开启http2功能;默认值为0 * ] * ] * "ULBType" => (string) ULB 的类型 * "IPVersion" => (string) ULB ip类型,枚举值:IPv6 / IPv4 (内部测试,暂未对外开放) + * "SnatIps" => (array) ULB后向代理IP,仅当有代理IP时返回否 * "ListenType" => (string) ULB 监听器类型,枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发;Comprehensive,兼容型;Pending,未定型 * "VPCId" => (string) ULB所在的VPC的ID * "SubnetId" => (string) ULB 为 InnerMode 时,ULB 所属的子网ID,默认为空 @@ -592,31 +1667,32 @@ public function describeULB(DescribeULBRequest $request = null) } /** - * DescribeULBSimple - 获取ULB信息 + * DescribeULBSimple - 获取CLB信息 * * See also: https://docs.ucloud.cn/api/ulb-api/describe_ulb_simple * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) * "Offset" => (integer) 数据偏移量,默认为0 * "Limit" => (integer) 数据分页值,默认为10000 - * "ULBId" => (string) 负载均衡实例的Id。 若指定则返回指定的负载均衡实例的信息; 若不指定则返回当前数据中心中所有的负载均衡实例的信息 - * "VPCId" => (string) ULB所属的VPC - * "SubnetId" => (string) ULB所属的子网ID - * "BusinessId" => (string) ULB所属的业务组ID + * "ULBId" => (string) 传统型负载均衡实例的Id。 若指定则返回指定的传统型负载均衡实例的信息; 若不指定则返回当前数据中心中所有的传统型负载均衡实例的信息 + * "VPCId" => (string) CLB所属的VPC + * "SubnetId" => (string) CLB所属的子网ID + * "BusinessId" => (string) CLB所属的业务组ID * ] * * Outputs: * * $outputs = [ - * "TotalCount" => (integer) 满足条件的ULB总数 - * "DataSet" => (array) ULB列表,每项参数详见 ULBSimpleSet[ + * "TotalCount" => (integer) 满足条件的CLB总数 + * "DataSet" => (array) CLB列表,每项参数详见 ULBSimpleSet[ * [ * "ListenType" => (string) ULB 监听器类型,枚举值:RequestProxy,请求代理; PacketsTransmit ,报文转发;Comprehensive,兼容型;Pending,未定型 * "IPVersion" => (string) ULB提供服务的IP类型。枚举值,“IPv4”,"IPv6"。默认为“IPv4” + * "SnatIps" => (array) ULB后向代理IP,仅当有代理IP时返回否 * "ULBId" => (string) 负载均衡的资源ID * "Name" => (string) 负载均衡的资源名称 * "Tag" => (string) 负载均衡的业务组名称 @@ -651,6 +1727,7 @@ public function describeULB(DescribeULBRequest $request = null) * "TokenID" => (string) 上传到bucket使用的token的tokenid * "TokenName" => (string) bucket的token名称 * ] + * "WAFMode" => (string) WAF功能状态,枚举类型:Unavailable:无法创建WAF;NoWAF:未绑定WAF;Intranet:内网回源Waf;Extranet:外网回源Waf * ] * ] * ] @@ -665,7 +1742,7 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) } /** - * DescribeVServer - 获取ULB下的VServer的详细信息 + * DescribeVServer - 获取CLB下的VServer的详细信息 * * See also: https://docs.ucloud.cn/api/ulb-api/describe_vserver * @@ -674,8 +1751,8 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * $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;若指定则返回指定的VServer实例的信息; 若不指定则返回当前负载均衡实例下所有VServer的信息 + * "ULBId" => (string) 传统型负载均衡实例的Id + * "VServerId" => (string) CLB下的VServer实例的Id;若指定则返回指定的VServer实例的信息; 若不指定则返回当前传统型负载均衡实例下所有VServer的信息 * "Limit" => (integer) 数据分页值 * "Offset" => (integer) 数据偏移量 * ] @@ -687,6 +1764,7 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * "DataSet" => (array) VServer列表,每项参数详见 ULBVServerSet[ * [ * "MonitorType" => (string) 健康检查类型,枚举值:Port -> 端口检查;Path -> 路径检查;Ping -> Ping探测, Customize -> UDP检查请求代理型默认值为Port,其中TCP协议仅支持Port,其他协议支持Port和Path; 报文转发型TCP协议仅支持Port,UDP协议支持Ping、Port和Customize + * "PersistenceType" => (string) VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 * "ULBId" => (string) 负载均衡实例的Id * "Domain" => (string) 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查域名 * "Path" => (string) 根据MonitorType确认; 当MonitorType为Port时,此字段无意义。当MonitorType为Path时,代表HTTP检查路径 @@ -697,7 +1775,6 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * "Protocol" => (string) VServer实例的协议。 枚举值为:HTTP,TCP,UDP,HTTPS。 * "FrontendPort" => (integer) VServer服务端口 * "Method" => (string) VServer负载均衡的模式,枚举值:Roundrobin -> 轮询;Source -> 源地址;ConsistentHash -> 一致性哈希;SourcePort -> 源地址(计算端口);ConsistentHashPort -> 一致性哈希(计算端口)。 - * "PersistenceType" => (string) VServer会话保持方式。枚举值为: None -> 关闭会话保持; ServerInsert -> 自动生成; UserDefined -> 用户自定义。 * "PersistenceInfo" => (string) 根据PersistenceType确定: None或ServerInsert,此字段为空; UserDefined,此字段展示用户自定义会话string。 * "ClientTimeout" => (integer) 空闲连接的回收时间,单位:秒。 * "Status" => (integer) VServer的运行状态。枚举值: 0 -> rs全部运行正常;1 -> rs全部运行异常;2 -> rs部分运行异常。 @@ -717,6 +1794,11 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * "ULBName" => (string) ULB实例的名称 * ] * ] + * "SSLSource" => (integer) SSL证书来源,SSL证书来源,0代表证书来自于ULB平台,1代表证书来自于USSL平台 + * "USSLId" => (string) USSL证书平台的编号,只有当SSLSource为1时才出现 + * "Domains" => (string) SSL证书平台的域名,多域名时,不展示扩展域名 + * "NotBefore" => (integer) 证书颁发时间 + * "NotAfter" => (integer) 证书过期时间 * ] * ] * "BackendSet" => (array) 后端资源信息列表,具体结构见下方 ULBBackendSet[ @@ -734,6 +1816,8 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * "Status" => (integer) 后端提供服务的实例运行状态,枚举值:0健康检查健康状态 1 健康检查异常 * "SubnetId" => (string) 后端提供服务的资源所在的子网的ID * "IsBackup" => (integer) 是否为backup,只有当vserver的Backup属性为1时才会有此字段,说明:0:主rs1:备rs + * "Weight" => (integer) 后端RS权重(在加权轮询算法下有效) + * "VPCId" => (string) 后端服务器所在的VPC * ] * ] * "ListenType" => (string) 监听器类型,枚举值为: RequestProxy -> 请求代理;PacketsTransmit -> 报文转发 @@ -762,6 +1846,16 @@ public function describeULBSimple(DescribeULBSimpleRequest $request = null) * ] * ] * ] + * "EnableCompression" => (integer) 数据压缩开关,0:关闭 1:开启 + * "SecurityPolicy" => (object) VServer绑定的安全策略,具体结构见BindSecurityPolicy[ + * "SecurityPolicyId" => (string) 安全策略组ID + * "SecurityPolicyName" => (string) 安全策略组名称 + * "TLSVersion" => (string) TLS最低版本 + * "SSLCiphers" => (array) 加密套件 + * "SecurityPolicyType" => (integer) 安全策略类型 0:预定义 1:自定义 + * ] + * "ForwardPort" => (integer) 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * "EnableHTTP2" => (integer) 0:关闭 1:开启,用于开启http2功能;默认值为0 * ] * ] * ] @@ -776,17 +1870,17 @@ public function describeVServer(DescribeVServerRequest $request = null) } /** - * ReleaseBackend - 从VServer释放后端资源实例 + * ReleaseBackend - 从CLB的VServer释放后端资源实例 * * See also: https://docs.ucloud.cn/api/ulb-api/release_backend * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 负载均衡实例的ID - * "BackendId" => (string) 后端资源实例的ID(ULB后端ID,非资源自身ID) + * "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 + * "BackendId" => (string) 后端资源实例的ID(CLB后端ID,非资源自身ID) * ] * * Outputs: @@ -804,17 +1898,73 @@ public function releaseBackend(ReleaseBackendRequest $request = null) } /** - * UnbindSSL - 从VServer解绑SSL证书 + * RemoveTargets - 从应用型负载均衡监听器删除后端服务节点 + * + * See also: https://docs.ucloud.cn/api/ulb-api/remove_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 + * "Ids" => (array) 服务节点的标识ID。不超过20个; + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return RemoveTargetsResponse + * @throws UCloudException + */ + public function removeTargets(RemoveTargetsRequest $request = null) + { + $resp = $this->invoke($request); + return new RemoveTargetsResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UnBindSecurityPolicy - 批量解绑安全策略,会同时解绑与传统型和应用型负载均衡监听器的绑定关系 + * + * See also: https://docs.ucloud.cn/api/ulb-api/un_bind_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 UnBindSecurityPolicyResponse + * @throws UCloudException + */ + public function unBindSecurityPolicy(UnBindSecurityPolicyRequest $request = null) + { + $resp = $this->invoke($request); + return new UnBindSecurityPolicyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UnbindSSL - 从CLB下的VServer解绑SSL证书 * * See also: https://docs.ucloud.cn/api/ulb-api/unbind_ssl * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 所绑定ULB实例ID - * "VServerId" => (string) 所绑定VServer实例ID + * "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) CLB所绑定VServer实例ID * "SSLId" => (string) SSL证书的Id * ] * @@ -833,7 +1983,7 @@ public function unbindSSL(UnbindSSLRequest $request = null) } /** - * UpdateBackendAttribute - 更新ULB后端资源实例(服务节点)属性 + * UpdateBackendAttribute - 更新CLB后端资源实例(服务节点)属性 * * See also: https://docs.ucloud.cn/api/ulb-api/update_backend_attribute * @@ -842,8 +1992,8 @@ public function unbindSSL(UnbindSSLRequest $request = null) * $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 - * "BackendId" => (string) 后端资源实例的ID(ULB后端ID,非资源自身ID) + * "ULBId" => (string) 传统型负载均衡资源ID + * "BackendId" => (string) 后端资源实例的ID(CLB后端ID,非资源自身ID) * "Port" => (integer) 后端资源服务端口,取值范围[1-65535] * "Weight" => (integer) 所添加的后端RS权重(在加权轮询算法下有效),取值范围[1-100],默认为1 * "Enabled" => (integer) 后端实例状态开关 @@ -865,20 +2015,149 @@ public function updateBackendAttribute(UpdateBackendAttributeRequest $request = } /** - * UpdatePolicy - 更新内容转发规则,包括转发规则后的服务节点 + * UpdateBackendBatch - 批量更新ULB后端资源实例(服务节点)属性 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_backend_batch + * + * 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 + * "Attributes" => (array) [ + * [ + * "BackendId" => (string) 后端资源实例的ID(ULB后端ID,非资源自身ID) + * "Port" => (integer) 后端资源服务端口,取值范围[1-65535] + * "Weight" => (integer) 所添加的后端RS权重(在加权轮询算法下有效),取值范围[0-100],默认为1 + * "Enabled" => (integer) 后端实例状态开关 + * "IsBackup" => (integer) 是否为backup 0:主rs 1:备rs 默认为0 + * ] + * ] + * ] + * + * Outputs: + * + * $outputs = [ + * "BackendSet" => (array) 返回ulb对每个rs的修改是否成功[ + * [ + * "BackendId" => (string) rs的资源ID + * "SubMessage" => (string) 修改rs返回的消息 + * "SubRetCode" => (integer) 修改rs的返回值 + * ] + * ] + * ] + * + * @return UpdateBackendBatchResponse + * @throws UCloudException + */ + public function updateBackendBatch(UpdateBackendBatchRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateBackendBatchResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateListenerAttribute - 更新一个应用型负载均衡监听器的属性 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_listener_attribute + * + * 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 + * "Name" => (string) 监听器的名称。限定字符长度:[1-255];限定特殊字符,仅支持:-_. + * "Remark" => (string) 监听器的备注信息。限定字符长度:[0-255] + * "Certificates" => (array) (应用型专用)服务器默认证书ID。仅HTTPS监听支持 + * "SecurityPolicyId" => (string) (应用型专用)安全策略组ID。仅HTTPS监听支持绑定。“Default”,表示绑定原生策略 + * "IdleTimeout" => (integer) 连接空闲超时时间。单位:秒。应用型限定取值:[1-86400] + * "Scheduler" => (string) 负载均衡算法。应用型限定取值:"Roundrobin"/"Source"/"WeightRoundrobin"/" Leastconn"/"Backup" + * "StickinessConfig" => (object) [ + * "Enabled" => (boolean) 是否开启会话保持功能。应用型负载均衡实例基于Cookie实现,网络型负载均衡则基于源IP,保证在对应的空闲超时时间内,同一个源IP送到同一个服务节点。默认值为:false + * "Type" => (string) (应用型专用)Cookie处理方式。限定枚举值:"ServerInsert" / "UserDefined",默认值为:“ServerInsert” + * "CookieName" => (string) (应用型专用)自定义Cookie。当StickinessType取值"UserDefined"时有效;限定字符长度:[0-255] + * ] + * "HealthCheckConfig" => (object) [ + * "Enabled" => (boolean) 是否开启健康检查功能。暂时不支持关闭;默认值为:true + * "Type" => (string) 健康检查方式。应用型限定取值:“Port”/"HTTP";默认值:“Port” + * "Domain" => (string) (应用型专用)HTTP检查域名 + * "Path" => (string) (应用型专用)HTTP检查路径 + * ] + * "CompressionEnabled" => (boolean) (应用型专用)是否开启数据压缩功能。目前只支持使用gzip对特定文件类型进行压缩 + * "HTTP2Enabled" => (boolean) (应用型专用)是否开启HTTP/2特性。仅HTTPS监听支持开启 + * "RedirectEnabled" => (boolean) (应用型专用)是否开启HTTP重定向到HTTPS。仅HTTP监听支持开启 + * "RedirectPort" => (integer) (应用型专用)重定向端口。限定取值:[1-65535] + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateListenerAttributeResponse + * @throws UCloudException + */ + public function updateListenerAttribute(UpdateListenerAttributeRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateListenerAttributeResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateLoadBalancerAttribute - 更新一个应用型负载均衡实例的属性 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_load_balancer_attribute + * + * 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) 负载均衡实例的名称,不传则默认不修改 + * "Tag" => (string) 负载均衡实例所属的业务组ID,不传则默认不修改 + * "Remark" => (string) 负载均衡实例的备注信息,不传则默认不修改,限定字符长度:[0-255] + * "AccessLogConfig" => (object) [ + * "Enabled" => (boolean) (应用型专用)是否开启访问日志记录功能 + * "US3BucketName" => (string) (应用型专用)用于存储访问日志的bucket + * "US3TokenId" => (string) (应用型专用)上传访问日志到bucket所需的token + * ] + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateLoadBalancerAttributeResponse + * @throws UCloudException + */ + public function updateLoadBalancerAttribute(UpdateLoadBalancerAttributeRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateLoadBalancerAttributeResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdatePolicy - 更新传统型负载均衡内容转发规则,包括转发规则后的服务节点 * * See also: https://docs.ucloud.cn/api/ulb-api/update_policy * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) 需要添加内容转发策略的负载均衡实例ID - * "VServerId" => (string) 需要添加内容转发策略的VServer实例ID,只支持请求代理模式下,HTTP或HTTPS协议的VServer + * "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,只支持请求代理模式下,HTTP或HTTPS协议的CLB下的VServer * "Match" => (string) 内容转发匹配字段 - * "PolicyId" => (string) 转发规则的ID,当Type为Default时,可以不传或为空 - * "BackendId" => (array) 内容转发策略应用的后端资源实例的ID,来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 + * "PolicyPriority" => (integer) 策略优先级,1-9999;只针对路径规则生效 + * "DomainMatchMode" => (string) 内容转发规则中域名的匹配方式,默认与原本一致。枚举值:Regular,正则;Wildcard,泛域名 + * "PolicyId" => (string) 传统型负载均衡转发规则的ID,当Type为Default时,可以不传或为空 + * "BackendId" => (array) 内容转发策略应用的后端资源实例的ID(CLB的后端节点Id),来源于 AllocateBackend 返回的 BackendId,不传表示更新转发节点为空 * "Type" => (string) 内容转发匹配字段的类型,枚举值:Domain -> 域名转发规则;Path -> 路径转发规则;Default -> 默认转发规则,不传默认值Domain * ] * @@ -896,6 +2175,82 @@ public function updatePolicy(UpdatePolicyRequest $request = null) return new UpdatePolicyResponse($resp->toArray(), $resp->getRequestId()); } + /** + * UpdateRuleAttribute - 更新应用型负载均衡监听器的一条转发规则的属性 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_rule_attribute + * + * 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 + * "RuleConditions" => (array) [ + * [ + * "Type" => (string) 匹配条件类型。限定枚举值:"Host"/"Path";RuleConditions数组长度不为0时必填 + * "HostConfig" => (object) [ + * "MatchMode" => (string) 匹配方式。限定枚举值:"Regular"/"Wildcard",默认值:"Regular" + * "Values" => (array) 取值。暂时只支持数组长度为1;取值需符合相关匹配方式的条件;修改域名匹配时必填 + * ] + * "PathConfig" => (object) [ + * "Values" => (array) 取值。暂时只支持数组长度为1;取值需符合相关条件;修改路径匹配时必填 + * ] + * ] + * ] + * "RuleActions" => (array) [ + * [ + * "Type" => (string) 动作类型。限定枚举值:"Forward";RuleActions数组长度不为0时必填 + * "ForwardConfig" => (object) [ + * "Targets" => (array) [ + * [ + * "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) 允许的访问来源列表。支持只配置一个元素*,或配置一个或多个值。单个值必须以http://或者https://开头,后边加一个正确的域名或一级泛域名。(例:http://*.test.abc.example.com)单个值可以不加端口,也可以指定端口,端口范围:1~65535。最多支持5个值 + * "AllowHeaders" => (array) 允许跨域的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "ExposeHeaders" => (array) 允许暴露的 Header 列表。支持配置为*或配置一个或多个 value 值。单个 value 值只允许包含大小写字母、数字,不能以下划线(_)和短划线(-)开头或结尾,最大长度限制为 32 个字符。最多支持20个值 + * "AllowMethods" => (array) 选择跨域访问时允许的 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范围内、不包括 $ 的可打印字符。 + * ] + * ] + * ] + * "Pass" => (boolean) 当转发的服务节点为空时,规则是否忽略。默认转发规则不可更改 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateRuleAttributeResponse + * @throws UCloudException + */ + public function updateRuleAttribute(UpdateRuleAttributeRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateRuleAttributeResponse($resp->toArray(), $resp->getRequestId()); + } + /** * UpdateSSLAttribute - 更新修改SSL的属性,如:修改SSLName * @@ -925,19 +2280,120 @@ public function updateSSLAttribute(UpdateSSLAttributeRequest $request = null) } /** - * UpdateULBAttribute - 更新ULB名字业务组备注等属性字段 + * UpdateSSLBinding - 将传统型或应用型负载均衡监听器绑定的证书更换为另一个证书, + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_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) + * "OldSSLId" => (string) 监听器实例绑定的旧的证书 + * "NewSSLId" => (string) 监听器实例需要绑定的新的证书 + * "LoadBalancerId" => (string) 所操作LB实例ID(仅LoadBalancerId传参时,将更换该LB所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系)(LB指CLB或ALB) + * "ListenerId" => (string) 所操作监听器实例ID(仅ListenerId传参时,将更换该监听器所有原证书为OldSSLId的绑定关系;LoadBalancerId和ListenerId都不传参则将更新该项目下所有原证书为OldSSLId的绑定关系;若LoadBalancerId与ListenerId皆有传参,则会强校验ULB与Vsserver的所属关系,将更换该ulb下vserver所绑定的OldSSLId为NewSSLId)(监听器指VServer或Listener) + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateSSLBindingResponse + * @throws UCloudException + */ + public function updateSSLBinding(UpdateSSLBindingRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateSSLBindingResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateSecurityPolicy - 更新安全策略 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_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 + * "SSLCiphers" => (array) 加密套件,TLS最低版本和加密套件必须全不为空或全为空 + * "TLSVersion" => (string) TLS最低版本,TLS最低版本和加密套件必须全不为空或全为空 + * "SecurityPolicyName" => (string) 安全策略名称 + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateSecurityPolicyResponse + * @throws UCloudException + */ + public function updateSecurityPolicy(UpdateSecurityPolicyRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateSecurityPolicyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateTargetsAttribute - 更新应用型负载均衡监听器后端服务节点的属性 + * + * See also: https://docs.ucloud.cn/api/ulb-api/update_targets_attribute + * + * 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) [ + * [ + * "Id" => (string) 服务节点的标识ID。限定枚举值:"UHost" / "UNI"/"UPM"/"IP";要更新的Targets数组长度至少为1,不超过20个 + * "Weight" => (integer) 服务节点的权重。限定取值:[1-100],默认值1;仅在加权轮询算法时有效;要更新的Targets数组长度至少为1,不超过20个 + * "Enabled" => (boolean) 服务节点是否启用。默认值true;要更新的Targets数组长度至少为1,不超过20个 + * "IsBackup" => (boolean) 服务节点是否为备节点。默认值false;要更新的Targets数组长度至少为1,不超过20个 + * ] + * ] + * ] + * + * Outputs: + * + * $outputs = [ + * ] + * + * @return UpdateTargetsAttributeResponse + * @throws UCloudException + */ + public function updateTargetsAttribute(UpdateTargetsAttributeRequest $request = null) + { + $resp = $this->invoke($request); + return new UpdateTargetsAttributeResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * UpdateULBAttribute - 更新CLB名字业务组备注等属性字段 * * See also: https://docs.ucloud.cn/api/ulb-api/update_ulb_attribute * * Arguments: * * $args = [ - * "Region" => (string) 地域。 参见 [地域和可用区列表](../summary/regionlist.html) - * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html) - * "ULBId" => (string) ULB资源ID - * "Name" => (string) 名字 - * "Tag" => (string) 业务 - * "Remark" => (string) 备注 + * "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 + * "Name" => (string) 名字,不传则默认不修改 + * "Tag" => (string) 业务,不传则默认不修改 + * "Remark" => (string) 备注,不传则默认不修改 + * "EnableLog" => (integer) 日志开关,1代表开启日志,0代表关闭日志,传1时必须同时传BucketName,TokenName与TokenId二选一 + * "BucketName" => (string) 设置用于存储ulb日志的bucket + * "TokenName" => (string) 用于指定上传到bucket所需的token,与TokenId选填其一即可 + * "TokenId" => (string) 用于指定上传到bucket所需的token,与TokenName选填其一即可 + * "IsWAFOn" => (string) 是否开启WAF。枚举类型:Yes,No,默认值为No * ] * * Outputs: @@ -955,7 +2411,7 @@ public function updateULBAttribute(UpdateULBAttributeRequest $request = null) } /** - * UpdateVServerAttribute - 更新VServer实例属性 + * UpdateVServerAttribute - 更新传统型负载均衡VServer实例属性 * * See also: https://docs.ucloud.cn/api/ulb-api/update_vserver_attribute * @@ -964,8 +2420,8 @@ public function updateULBAttribute(UpdateULBAttributeRequest $request = null) * $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 + * "ULBId" => (string) 传统型负载均衡实例ID + * "VServerId" => (string) 传统型负载均衡VServer实例ID * "VServerName" => (string) VServer实例名称,若无此字段则不做修改 * "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。 @@ -976,6 +2432,10 @@ public function updateULBAttribute(UpdateULBAttributeRequest $request = null) * "Path" => (string) MonitorType 为 Path 时指定健康检查发送请求时的路径,默认为 / * "RequestMsg" => (string) 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查发出的请求报文 * "ResponseMsg" => (string) 根据MonitorType确认; 当MonitorType为Customize时,此字段有意义,代表UDP检查请求应收到的响应报文 + * "SecurityPolicyId" => (string) 安全策略组ID + * "EnableCompression" => (integer) 0:关闭 1:开启,用于数据压缩功能 + * "ForwardPort" => (integer) 重定向端口,取值范围[0-65535];默认值为0,代表关闭;仅HTTP协议支持开启重定向功能 + * "EnableHTTP2" => (integer) 0:关闭 1:开启,用于开启http2功能;默认值为0 * ] * * Outputs: