diff --git a/VERSION b/VERSION index 402f043e..4b455236 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.77 +0.3.78 diff --git a/src/UDB/Apis/GetUDBAccessInfoRequest.php b/src/UDB/Apis/GetUDBAccessInfoRequest.php new file mode 100644 index 00000000..c772f4eb --- /dev/null +++ b/src/UDB/Apis/GetUDBAccessInfoRequest.php @@ -0,0 +1,113 @@ + "GetUDBAccessInfo"]); + $this->markRequired("Region"); + $this->markRequired("Zone"); + $this->markRequired("ProjectId"); + $this->markRequired("DBId"); + } + + + + /** + * 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); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getZone() + { + return $this->get("Zone"); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $zone + */ + public function setZone($zone) + { + $this->set("Zone", $zone); + } + + /** + * 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); + } + + /** + * DBId: 实例ID + * + * @return string|null + */ + public function getDBId() + { + return $this->get("DBId"); + } + + /** + * DBId: 实例ID + * + * @param string $dbId + */ + public function setDBId($dbId) + { + $this->set("DBId", $dbId); + } +} diff --git a/src/UDB/Apis/GetUDBAccessInfoResponse.php b/src/UDB/Apis/GetUDBAccessInfoResponse.php new file mode 100644 index 00000000..f4520273 --- /dev/null +++ b/src/UDB/Apis/GetUDBAccessInfoResponse.php @@ -0,0 +1,90 @@ +get("ExternalInfo"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new ExternalInfo($item)); + } + return $result; + } + + /** + * ExternalInfo: 实例外网访问信息,含状态、地址、端口、带宽与白名单 + * + * @param ExternalInfo[] $externalInfo + */ + public function setExternalInfo(array $externalInfo) + { + $result = []; + foreach ($externalInfo as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * PrivateInfo: 实例内网访问信息,含 VPC、子网、内网 IP、内网域名与端口 + * + * @return PrivateInfo[]|null + */ + public function getPrivateInfo() + { + $items = $this->get("PrivateInfo"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new PrivateInfo($item)); + } + return $result; + } + + /** + * PrivateInfo: 实例内网访问信息,含 VPC、子网、内网 IP、内网域名与端口 + * + * @param PrivateInfo[] $privateInfo + */ + public function setPrivateInfo(array $privateInfo) + { + $result = []; + foreach ($privateInfo as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/UDB/Models/ExternalInfo.php b/src/UDB/Models/ExternalInfo.php new file mode 100644 index 00000000..757d166a --- /dev/null +++ b/src/UDB/Models/ExternalInfo.php @@ -0,0 +1,144 @@ +get("Status"); + } + + /** + * Status: 外网访问状态,字符串枚举,取值见下表 + * + * @param string $status + */ + public function setStatus($status) + { + $this->set("Status", $status); + } + + /** + * ExternalAddress: 外网访问地址;未开通外网访问时为空字符串 + * + * @return string|null + */ + public function getExternalAddress() + { + return $this->get("ExternalAddress"); + } + + /** + * ExternalAddress: 外网访问地址;未开通外网访问时为空字符串 + * + * @param string $externalAddress + */ + public function setExternalAddress($externalAddress) + { + $this->set("ExternalAddress", $externalAddress); + } + + /** + * ExternalPort: 外网访问端口;未开通时为 0 + * + * @return integer|null + */ + public function getExternalPort() + { + return $this->get("ExternalPort"); + } + + /** + * ExternalPort: 外网访问端口;未开通时为 0 + * + * @param int $externalPort + */ + public function setExternalPort($externalPort) + { + $this->set("ExternalPort", $externalPort); + } + + /** + * Bindwidth: 外网带宽,单位 Mbps,取自 EIP 带宽;无 EIP 时为 0 + * + * @return integer|null + */ + public function getBindwidth() + { + return $this->get("Bindwidth"); + } + + /** + * Bindwidth: 外网带宽,单位 Mbps,取自 EIP 带宽;无 EIP 时为 0 + * + * @param int $bindwidth + */ + public function setBindwidth($bindwidth) + { + $this->set("Bindwidth", $bindwidth); + } + + /** + * WhiteList: 外网访问白名单,多个 IP 以逗号分隔,取自 NLB 白名单 + * + * @return string|null + */ + public function getWhiteList() + { + return $this->get("WhiteList"); + } + + /** + * WhiteList: 外网访问白名单,多个 IP 以逗号分隔,取自 NLB 白名单 + * + * @param string $whiteList + */ + public function setWhiteList($whiteList) + { + $this->set("WhiteList", $whiteList); + } + + /** + * Support: 实例是否支持外网访问能力:1 支持;当前实现恒返回 1 + * + * @return integer|null + */ + public function getSupport() + { + return $this->get("Support"); + } + + /** + * Support: 实例是否支持外网访问能力:1 支持;当前实现恒返回 1 + * + * @param int $support + */ + public function setSupport($support) + { + $this->set("Support", $support); + } +} diff --git a/src/UDB/Models/PrivateInfo.php b/src/UDB/Models/PrivateInfo.php new file mode 100644 index 00000000..aeadde7b --- /dev/null +++ b/src/UDB/Models/PrivateInfo.php @@ -0,0 +1,144 @@ +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); + } + + /** + * PrivateIP: 实例内网服务地址(VIP) + * + * @return string|null + */ + public function getPrivateIP() + { + return $this->get("PrivateIP"); + } + + /** + * PrivateIP: 实例内网服务地址(VIP) + * + * @param string $privateIP + */ + public function setPrivateIP($privateIP) + { + $this->set("PrivateIP", $privateIP); + } + + /** + * PrivateDomain: 实例的内网域名;未开通内网域名时为空字符串 + * + * @return string|null + */ + public function getPrivateDomain() + { + return $this->get("PrivateDomain"); + } + + /** + * PrivateDomain: 实例的内网域名;未开通内网域名时为空字符串 + * + * @param string $privateDomain + */ + public function setPrivateDomain($privateDomain) + { + $this->set("PrivateDomain", $privateDomain); + } + + /** + * PrivatePort: 内网域名状态,字符串枚举,取值与 Status 同源;未开通内网域名时返回NetworkConnectionDisabled + * + * @return integer|null + */ + public function getPrivatePort() + { + return $this->get("PrivatePort"); + } + + /** + * PrivatePort: 内网域名状态,字符串枚举,取值与 Status 同源;未开通内网域名时返回NetworkConnectionDisabled + * + * @param int $privatePort + */ + public function setPrivatePort($privatePort) + { + $this->set("PrivatePort", $privatePort); + } + + /** + * PrivateDomainStatus: 实例内网服务端口 + * + * @return string|null + */ + public function getPrivateDomainStatus() + { + return $this->get("PrivateDomainStatus"); + } + + /** + * PrivateDomainStatus: 实例内网服务端口 + * + * @param string $privateDomainStatus + */ + public function setPrivateDomainStatus($privateDomainStatus) + { + $this->set("PrivateDomainStatus", $privateDomainStatus); + } +} diff --git a/src/UDB/UDBClient.php b/src/UDB/UDBClient.php index 5c0f68c4..4cea2f22 100644 --- a/src/UDB/UDBClient.php +++ b/src/UDB/UDBClient.php @@ -108,6 +108,8 @@ use UCloud\UDB\Apis\ExtractUDBParamGroupResponse; use UCloud\UDB\Apis\FetchUDBInstanceEarliestRecoverTimeRequest; use UCloud\UDB\Apis\FetchUDBInstanceEarliestRecoverTimeResponse; +use UCloud\UDB\Apis\GetUDBAccessInfoRequest; +use UCloud\UDB\Apis\GetUDBAccessInfoResponse; use UCloud\UDB\Apis\GetUDBClientConnNumRequest; use UCloud\UDB\Apis\GetUDBClientConnNumResponse; use UCloud\UDB\Apis\GetUDBInstanceSSLCertURLRequest; @@ -1930,6 +1932,54 @@ public function fetchUDBInstanceEarliestRecoverTime(FetchUDBInstanceEarliestReco return new FetchUDBInstanceEarliestRecoverTimeResponse($resp->toArray(), $resp->getRequestId()); } + /** + * GetUDBAccessInfo - 查询 UDB 实例的内网与外网访问信息,包含外网地址端口、带宽、白名单,以及内网 VPC、子网、内网 IP、内网域名与端口1 + * + * See also: https://docs.ucloud.cn/api/udb-api/get_udb_access_info + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "Zone" => (string) 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "DBId" => (string) 实例ID + * ] + * + * Outputs: + * + * $outputs = [ + * "ExternalInfo" => (array) 实例外网访问信息,含状态、地址、端口、带宽与白名单[ + * [ + * "Status" => (string) 外网访问状态,字符串枚举,取值见下表 + * "ExternalAddress" => (string) 外网访问地址;未开通外网访问时为空字符串 + * "ExternalPort" => (integer) 外网访问端口;未开通时为 0 + * "Bindwidth" => (integer) 外网带宽,单位 Mbps,取自 EIP 带宽;无 EIP 时为 0 + * "WhiteList" => (string) 外网访问白名单,多个 IP 以逗号分隔,取自 NLB 白名单 + * "Support" => (integer) 实例是否支持外网访问能力:1 支持;当前实现恒返回 1 + * ] + * ] + * "PrivateInfo" => (array) 实例内网访问信息,含 VPC、子网、内网 IP、内网域名与端口[ + * [ + * "VPCId" => (string) 实例内网所在的 VPC ID + * "SubnetId" => (string) 实例内网所在的子网 ID + * "PrivateIP" => (string) 实例内网服务地址(VIP) + * "PrivateDomain" => (string) 实例的内网域名;未开通内网域名时为空字符串 + * "PrivatePort" => (integer) 内网域名状态,字符串枚举,取值与 Status 同源;未开通内网域名时返回NetworkConnectionDisabled + * "PrivateDomainStatus" => (string) 实例内网服务端口 + * ] + * ] + * ] + * + * @return GetUDBAccessInfoResponse + * @throws UCloudException + */ + public function getUDBAccessInfo(GetUDBAccessInfoRequest $request = null) + { + $resp = $this->invoke($request); + return new GetUDBAccessInfoResponse($resp->toArray(), $resp->getRequestId()); + } + /** * GetUDBClientConnNum - 输入一个DBID,能够获取客户端来源IP以及对应的连接数 * diff --git a/src/UDBProxy/Apis/DescribeUDBProxyRequest.php b/src/UDBProxy/Apis/DescribeUDBProxyRequest.php new file mode 100644 index 00000000..0f8b6723 --- /dev/null +++ b/src/UDBProxy/Apis/DescribeUDBProxyRequest.php @@ -0,0 +1,112 @@ + "DescribeUDBProxy"]); + $this->markRequired("Region"); + $this->markRequired("Zone"); + $this->markRequired("UDBProxyID"); + } + + + + /** + * 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); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getZone() + { + return $this->get("Zone"); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $zone + */ + public function setZone($zone) + { + $this->set("Zone", $zone); + } + + /** + * 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); + } + + /** + * UDBProxyID: 读写分离ID + * + * @return string|null + */ + public function getUDBProxyID() + { + return $this->get("UDBProxyID"); + } + + /** + * UDBProxyID: 读写分离ID + * + * @param string $udbProxyID + */ + public function setUDBProxyID($udbProxyID) + { + $this->set("UDBProxyID", $udbProxyID); + } +} diff --git a/src/UDBProxy/Apis/DescribeUDBProxyResponse.php b/src/UDBProxy/Apis/DescribeUDBProxyResponse.php new file mode 100644 index 00000000..401b2ec3 --- /dev/null +++ b/src/UDBProxy/Apis/DescribeUDBProxyResponse.php @@ -0,0 +1,471 @@ +get("UDBProxyID"); + } + + /** + * UDBProxyID: UDBProxy实例ID + * + * @param string $udbProxyID + */ + public function setUDBProxyID($udbProxyID) + { + $this->set("UDBProxyID", $udbProxyID); + } + + /** + * UDBProxyIP: UDB代理服务IP + * + * @return string|null + */ + public function getUDBProxyIP() + { + return $this->get("UDBProxyIP"); + } + + /** + * UDBProxyIP: UDB代理服务IP + * + * @param string $udbProxyIP + */ + public function setUDBProxyIP($udbProxyIP) + { + $this->set("UDBProxyIP", $udbProxyIP); + } + + /** + * UDBProxyPort: UDB代理服务端口 + * + * @return integer|null + */ + public function getUDBProxyPort() + { + return $this->get("UDBProxyPort"); + } + + /** + * UDBProxyPort: UDB代理服务端口 + * + * @param int $udbProxyPort + */ + public function setUDBProxyPort($udbProxyPort) + { + $this->set("UDBProxyPort", $udbProxyPort); + } + + /** + * State: 状态 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 状态 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } + + /** + * CreateTime: 创建时间 + * + * @return integer|null + */ + public function getCreateTime() + { + return $this->get("CreateTime"); + } + + /** + * CreateTime: 创建时间 + * + * @param int $createTime + */ + public function setCreateTime($createTime) + { + $this->set("CreateTime", $createTime); + } + + /** + * ModifyTime: 修改时间 + * + * @return integer|null + */ + public function getModifyTime() + { + return $this->get("ModifyTime"); + } + + /** + * ModifyTime: 修改时间 + * + * @param int $modifyTime + */ + public function setModifyTime($modifyTime) + { + $this->set("ModifyTime", $modifyTime); + } + + /** + * ReadWeightMode: 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式 + * + * @return integer|null + */ + public function getReadWeightMode() + { + return $this->get("ReadWeightMode"); + } + + /** + * ReadWeightMode: 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式 + * + * @param int $readWeightMode + */ + public function setReadWeightMode($readWeightMode) + { + $this->set("ReadWeightMode", $readWeightMode); + } + + /** + * CPUCores: cpu核数 + * + * @return integer|null + */ + public function getCPUCores() + { + return $this->get("CPUCores"); + } + + /** + * CPUCores: cpu核数 + * + * @param int $cpuCores + */ + public function setCPUCores($cpuCores) + { + $this->set("CPUCores", $cpuCores); + } + + /** + * Memory: 内存 + * + * @return integer|null + */ + public function getMemory() + { + return $this->get("Memory"); + } + + /** + * Memory: 内存 + * + * @param int $memory + */ + public function setMemory($memory) + { + $this->set("Memory", $memory); + } + + /** + * NodeCount: 集群实例节点数 + * + * @return integer|null + */ + public function getNodeCount() + { + return $this->get("NodeCount"); + } + + /** + * NodeCount: 集群实例节点数 + * + * @param int $nodeCount + */ + public function setNodeCount($nodeCount) + { + $this->set("NodeCount", $nodeCount); + } + + /** + * ZoneId: 可用区id + * + * @return integer|null + */ + public function getZoneId() + { + return $this->get("ZoneId"); + } + + /** + * ZoneId: 可用区id + * + * @param int $zoneId + */ + public function setZoneId($zoneId) + { + $this->set("ZoneId", $zoneId); + } + + /** + * Name: 名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * MaxConnection: UDB代理服务最大连接数 + * + * @return integer|null + */ + public function getMaxConnection() + { + return $this->get("MaxConnection"); + } + + /** + * MaxConnection: UDB代理服务最大连接数 + * + * @param int $maxConnection + */ + public function setMaxConnection($maxConnection) + { + $this->set("MaxConnection", $maxConnection); + } + + /** + * DelayThreshold: 延迟阈值(单位s) + * + * @return integer|null + */ + public function getDelayThreshold() + { + return $this->get("DelayThreshold"); + } + + /** + * DelayThreshold: 延迟阈值(单位s) + * + * @param int $delayThreshold + */ + public function setDelayThreshold($delayThreshold) + { + $this->set("DelayThreshold", $delayThreshold); + } + + /** + * UDBReplicas: UDB集群数据 + * + * @return Replica[]|null + */ + public function getUDBReplicas() + { + $items = $this->get("UDBReplicas"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Replica($item)); + } + return $result; + } + + /** + * UDBReplicas: UDB集群数据 + * + * @param Replica[] $udbReplicas + */ + public function setUDBReplicas(array $udbReplicas) + { + $result = []; + foreach ($udbReplicas as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * Nodes: 集群实例服务节点数据 + * + * @return Node[]|null + */ + public function getNodes() + { + $items = $this->get("Nodes"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new Node($item)); + } + return $result; + } + + /** + * Nodes: 集群实例服务节点数据 + * + * @param Node[] $nodes + */ + public function setNodes(array $nodes) + { + $result = []; + foreach ($nodes as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * SQLLimitCount: sql限流数量 + * + * @return integer|null + */ + public function getSQLLimitCount() + { + return $this->get("SQLLimitCount"); + } + + /** + * SQLLimitCount: sql限流数量 + * + * @param int $sqlLimitCount + */ + public function setSQLLimitCount($sqlLimitCount) + { + $this->set("SQLLimitCount", $sqlLimitCount); + } + + /** + * SQLRouterCount: sql路由数量 + * + * @return integer|null + */ + public function getSQLRouterCount() + { + return $this->get("SQLRouterCount"); + } + + /** + * SQLRouterCount: sql路由数量 + * + * @param int $sqlRouterCount + */ + public function setSQLRouterCount($sqlRouterCount) + { + $this->set("SQLRouterCount", $sqlRouterCount); + } + + /** + * InstanceVersion: 实例版本 + * + * @return string|null + */ + public function getInstanceVersion() + { + return $this->get("InstanceVersion"); + } + + /** + * InstanceVersion: 实例版本 + * + * @param string $instanceVersion + */ + public function setInstanceVersion($instanceVersion) + { + $this->set("InstanceVersion", $instanceVersion); + } + + /** + * EnableTransSplit: 是否启用事务拆分(1:启用事务拆分,2:关闭事务拆分) + * + * @return integer|null + */ + public function getEnableTransSplit() + { + return $this->get("EnableTransSplit"); + } + + /** + * EnableTransSplit: 是否启用事务拆分(1:启用事务拆分,2:关闭事务拆分) + * + * @param int $enableTransSplit + */ + public function setEnableTransSplit($enableTransSplit) + { + $this->set("EnableTransSplit", $enableTransSplit); + } + + /** + * PrivateDomainInfo: 代理实例的内网域名及其开关状态,含域名地址、域名开关、域名数据源指向 + * + * @return PrivateDomainInfo|null + */ + public function getPrivateDomainInfo() + { + return new PrivateDomainInfo($this->get("PrivateDomainInfo")); + } + + /** + * PrivateDomainInfo: 代理实例的内网域名及其开关状态,含域名地址、域名开关、域名数据源指向 + * + * @param PrivateDomainInfo $privateDomainInfo + */ + public function setPrivateDomainInfo(array $privateDomainInfo) + { + $this->set("PrivateDomainInfo", $privateDomainInfo->getAll()); + } +} diff --git a/src/UDBProxy/Apis/ListUDBProxyClientRequest.php b/src/UDBProxy/Apis/ListUDBProxyClientRequest.php new file mode 100644 index 00000000..6fd6f494 --- /dev/null +++ b/src/UDBProxy/Apis/ListUDBProxyClientRequest.php @@ -0,0 +1,112 @@ + "ListUDBProxyClient"]); + $this->markRequired("Region"); + $this->markRequired("Zone"); + $this->markRequired("UDBProxyID"); + } + + + + /** + * 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); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getZone() + { + return $this->get("Zone"); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $zone + */ + public function setZone($zone) + { + $this->set("Zone", $zone); + } + + /** + * 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); + } + + /** + * UDBProxyID: 代理ID + * + * @return string|null + */ + public function getUDBProxyID() + { + return $this->get("UDBProxyID"); + } + + /** + * UDBProxyID: 代理ID + * + * @param string $udbProxyID + */ + public function setUDBProxyID($udbProxyID) + { + $this->set("UDBProxyID", $udbProxyID); + } +} diff --git a/src/UDBProxy/Apis/ListUDBProxyClientResponse.php b/src/UDBProxy/Apis/ListUDBProxyClientResponse.php new file mode 100644 index 00000000..9addbe18 --- /dev/null +++ b/src/UDBProxy/Apis/ListUDBProxyClientResponse.php @@ -0,0 +1,78 @@ +get("UDBProxyID"); + } + + /** + * UDBProxyID: 代理ID + * + * @param string $udbProxyID + */ + public function setUDBProxyID($udbProxyID) + { + $this->set("UDBProxyID", $udbProxyID); + } + + /** + * NodeClientInfos: 代理节点客户端IP连接信息 + * + * @return NodeClientInfo[]|null + */ + public function getNodeClientInfos() + { + $items = $this->get("NodeClientInfos"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new NodeClientInfo($item)); + } + return $result; + } + + /** + * NodeClientInfos: 代理节点客户端IP连接信息 + * + * @param NodeClientInfo[] $nodeClientInfos + */ + public function setNodeClientInfos(array $nodeClientInfos) + { + $result = []; + foreach ($nodeClientInfos as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/UDBProxy/Apis/ListUDBProxyInstanceByDBRequest.php b/src/UDBProxy/Apis/ListUDBProxyInstanceByDBRequest.php new file mode 100644 index 00000000..37573ef7 --- /dev/null +++ b/src/UDBProxy/Apis/ListUDBProxyInstanceByDBRequest.php @@ -0,0 +1,112 @@ + "ListUDBProxyInstanceByDB"]); + $this->markRequired("Region"); + $this->markRequired("Zone"); + $this->markRequired("DBID"); + } + + + + /** + * 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); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @return string|null + */ + public function getZone() + { + return $this->get("Zone"); + } + + /** + * Zone: 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * + * @param string $zone + */ + public function setZone($zone) + { + $this->set("Zone", $zone); + } + + /** + * 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); + } + + /** + * DBID: 数据库DB资源ID + * + * @return string|null + */ + public function getDBID() + { + return $this->get("DBID"); + } + + /** + * DBID: 数据库DB资源ID + * + * @param string $dbid + */ + public function setDBID($dbid) + { + $this->set("DBID", $dbid); + } +} diff --git a/src/UDBProxy/Apis/ListUDBProxyInstanceByDBResponse.php b/src/UDBProxy/Apis/ListUDBProxyInstanceByDBResponse.php new file mode 100644 index 00000000..3bd1fb2e --- /dev/null +++ b/src/UDBProxy/Apis/ListUDBProxyInstanceByDBResponse.php @@ -0,0 +1,58 @@ +get("UDBProxyBaseItems"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new UDBProxyBaseItem($item)); + } + return $result; + } + + /** + * UDBProxyBaseItems: 代理列表数据 + * + * @param UDBProxyBaseItem[] $udbProxyBaseItems + */ + public function setUDBProxyBaseItems(array $udbProxyBaseItems) + { + $result = []; + foreach ($udbProxyBaseItems as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/UDBProxy/Models/BaseDBData.php b/src/UDBProxy/Models/BaseDBData.php new file mode 100644 index 00000000..08301345 --- /dev/null +++ b/src/UDBProxy/Models/BaseDBData.php @@ -0,0 +1,84 @@ +get("ID"); + } + + /** + * ID: 数据库ID + * + * @param string $id + */ + public function setID($id) + { + $this->set("ID", $id); + } + + /** + * Name: 数据库名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 数据库名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * ReadWeight: 权重 + * + * @return integer|null + */ + public function getReadWeight() + { + return $this->get("ReadWeight"); + } + + /** + * ReadWeight: 权重 + * + * @param int $readWeight + */ + public function setReadWeight($readWeight) + { + $this->set("ReadWeight", $readWeight); + } +} diff --git a/src/UDBProxy/Models/Node.php b/src/UDBProxy/Models/Node.php new file mode 100644 index 00000000..6145ac65 --- /dev/null +++ b/src/UDBProxy/Models/Node.php @@ -0,0 +1,64 @@ +get("ID"); + } + + /** + * ID: 服务节点id + * + * @param string $id + */ + public function setID($id) + { + $this->set("ID", $id); + } + + /** + * State: 服务节点状态 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 服务节点状态 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } +} diff --git a/src/UDBProxy/Models/NodeClientInfo.php b/src/UDBProxy/Models/NodeClientInfo.php new file mode 100644 index 00000000..ab85da56 --- /dev/null +++ b/src/UDBProxy/Models/NodeClientInfo.php @@ -0,0 +1,96 @@ +get("Records"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new ProxyProcesslist($item)); + } + return $result; + } + + /** + * Records: 客户端IP连接信息 + * + * @param ProxyProcesslist[] $records + */ + public function setRecords(array $records) + { + $result = []; + foreach ($records as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } + + /** + * 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); + } + + /** + * IP: 代理节点IP + * + * @return string|null + */ + public function getIP() + { + return $this->get("IP"); + } + + /** + * IP: 代理节点IP + * + * @param string $ip + */ + public function setIP($ip) + { + $this->set("IP", $ip); + } +} diff --git a/src/UDBProxy/Models/PrivateDomainInfo.php b/src/UDBProxy/Models/PrivateDomainInfo.php new file mode 100644 index 00000000..1ef8a163 --- /dev/null +++ b/src/UDBProxy/Models/PrivateDomainInfo.php @@ -0,0 +1,84 @@ +get("PrivateDomain"); + } + + /** + * PrivateDomain: 实例的内网域名地址,形如 xxx.ucloudcs.com;未开通内网域名时为空字符串 + * + * @param string $privateDomain + */ + public function setPrivateDomain($privateDomain) + { + $this->set("PrivateDomain", $privateDomain); + } + + /** + * EnablePrivateDomain: 内网域名是否已开启:1 已开启,2 已关闭;未开通内网域名时返回 2 + * + * @return integer|null + */ + public function getEnablePrivateDomain() + { + return $this->get("EnablePrivateDomain"); + } + + /** + * EnablePrivateDomain: 内网域名是否已开启:1 已开启,2 已关闭;未开通内网域名时返回 2 + * + * @param int $enablePrivateDomain + */ + public function setEnablePrivateDomain($enablePrivateDomain) + { + $this->set("EnablePrivateDomain", $enablePrivateDomain); + } + + /** + * EnableConnectToDB: 内网域名指向的数据源:1 指向主库(可直连数据库),2 指向代理(经 UDBProxy访问);未开通时返回 2 + * + * @return integer|null + */ + public function getEnableConnectToDB() + { + return $this->get("EnableConnectToDB"); + } + + /** + * EnableConnectToDB: 内网域名指向的数据源:1 指向主库(可直连数据库),2 指向代理(经 UDBProxy访问);未开通时返回 2 + * + * @param int $enableConnectToDB + */ + public function setEnableConnectToDB($enableConnectToDB) + { + $this->set("EnableConnectToDB", $enableConnectToDB); + } +} diff --git a/src/UDBProxy/Models/ProxyProcesslist.php b/src/UDBProxy/Models/ProxyProcesslist.php new file mode 100644 index 00000000..e26ae3a2 --- /dev/null +++ b/src/UDBProxy/Models/ProxyProcesslist.php @@ -0,0 +1,244 @@ +get("ID"); + } + + /** + * ID: 当前连接DB进程ID + * + * @param int $id + */ + public function setID($id) + { + $this->set("ID", $id); + } + + /** + * User: 启动这个线程的用户 + * + * @return string|null + */ + public function getUser() + { + return $this->get("User"); + } + + /** + * User: 启动这个线程的用户 + * + * @param string $user + */ + public function setUser($user) + { + $this->set("User", $user); + } + + /** + * Host: 代理连接DB地址 + * + * @return string|null + */ + public function getHost() + { + return $this->get("Host"); + } + + /** + * Host: 代理连接DB地址 + * + * @param string $host + */ + public function setHost($host) + { + $this->set("Host", $host); + } + + /** + * DB: 当前执行的命令是在哪一个数据库上。如果没有指定数据库,则该值为 NULL + * + * @return string|null + */ + public function getDB() + { + return $this->get("DB"); + } + + /** + * DB: 当前执行的命令是在哪一个数据库上。如果没有指定数据库,则该值为 NULL + * + * @param string $db + */ + public function setDB($db) + { + $this->set("DB", $db); + } + + /** + * Command: 显示当前连接的执行的命令 + * + * @return string|null + */ + public function getCommand() + { + return $this->get("Command"); + } + + /** + * Command: 显示当前连接的执行的命令 + * + * @param string $command + */ + public function setCommand($command) + { + $this->set("Command", $command); + } + + /** + * Time: 表示该线程处于当前状态的时间 + * + * @return integer|null + */ + public function getTime() + { + return $this->get("Time"); + } + + /** + * Time: 表示该线程处于当前状态的时间 + * + * @param int $time + */ + public function setTime($time) + { + $this->set("Time", $time); + } + + /** + * State: 线程的状态,和 Command 对应 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 线程的状态,和 Command 对应 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } + + /** + * Info: 一般记录的是线程执行的语句 + * + * @return string|null + */ + public function getInfo() + { + return $this->get("Info"); + } + + /** + * Info: 一般记录的是线程执行的语句 + * + * @param string $info + */ + public function setInfo($info) + { + $this->set("Info", $info); + } + + /** + * ClientHost: 客户端来源IP地址 + * + * @return string|null + */ + public function getClientHost() + { + return $this->get("ClientHost"); + } + + /** + * ClientHost: 客户端来源IP地址 + * + * @param string $clientHost + */ + public function setClientHost($clientHost) + { + $this->set("ClientHost", $clientHost); + } + + /** + * DBID: 数据库资源ID + * + * @return string|null + */ + public function getDBID() + { + return $this->get("DBID"); + } + + /** + * DBID: 数据库资源ID + * + * @param string $dbid + */ + public function setDBID($dbid) + { + $this->set("DBID", $dbid); + } + + /** + * Role: 数据库角色(主库/从库) + * + * @return string|null + */ + public function getRole() + { + return $this->get("Role"); + } + + /** + * Role: 数据库角色(主库/从库) + * + * @param string $role + */ + public function setRole($role) + { + $this->set("Role", $role); + } +} diff --git a/src/UDBProxy/Models/Replica.php b/src/UDBProxy/Models/Replica.php new file mode 100644 index 00000000..5d809792 --- /dev/null +++ b/src/UDBProxy/Models/Replica.php @@ -0,0 +1,224 @@ +get("ID"); + } + + /** + * ID: 数据库ID + * + * @param string $id + */ + public function setID($id) + { + $this->set("ID", $id); + } + + /** + * IP: 数据库IP + * + * @return string|null + */ + public function getIP() + { + return $this->get("IP"); + } + + /** + * IP: 数据库IP + * + * @param string $ip + */ + public function setIP($ip) + { + $this->set("IP", $ip); + } + + /** + * Port: 数据库服务端口 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 数据库服务端口 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * ReadWeight: 读权重 + * + * @return integer|null + */ + public function getReadWeight() + { + return $this->get("ReadWeight"); + } + + /** + * ReadWeight: 读权重 + * + * @param int $readWeight + */ + public function setReadWeight($readWeight) + { + $this->set("ReadWeight", $readWeight); + } + + /** + * State: 状态 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 状态 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } + + /** + * Role: 角色[master-主库,slave-从库] + * + * @return string|null + */ + public function getRole() + { + return $this->get("Role"); + } + + /** + * Role: 角色[master-主库,slave-从库] + * + * @param string $role + */ + public function setRole($role) + { + $this->set("Role", $role); + } + + /** + * CreateTime: 创建时间 + * + * @return integer|null + */ + public function getCreateTime() + { + return $this->get("CreateTime"); + } + + /** + * CreateTime: 创建时间 + * + * @param int $createTime + */ + public function setCreateTime($createTime) + { + $this->set("CreateTime", $createTime); + } + + /** + * ModifyTime: 修改时间 + * + * @return integer|null + */ + public function getModifyTime() + { + return $this->get("ModifyTime"); + } + + /** + * ModifyTime: 修改时间 + * + * @param int $modifyTime + */ + public function setModifyTime($modifyTime) + { + $this->set("ModifyTime", $modifyTime); + } + + /** + * JoinState: 是否加入代理服务(true:加入,false:未加入) + * + * @return boolean|null + */ + public function getJoinState() + { + return $this->get("JoinState"); + } + + /** + * JoinState: 是否加入代理服务(true:加入,false:未加入) + * + * @param boolean $joinState + */ + public function setJoinState($joinState) + { + $this->set("JoinState", $joinState); + } + + /** + * Name: 数据库名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 数据库名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } +} diff --git a/src/UDBProxy/Models/UDBProxyBaseItem.php b/src/UDBProxy/Models/UDBProxyBaseItem.php new file mode 100644 index 00000000..f8253e39 --- /dev/null +++ b/src/UDBProxy/Models/UDBProxyBaseItem.php @@ -0,0 +1,296 @@ +get("ReadWeightMode"); + } + + /** + * ReadWeightMode: 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式 + * + * @param int $readWeightMode + */ + public function setReadWeightMode($readWeightMode) + { + $this->set("ReadWeightMode", $readWeightMode); + } + + /** + * CreateTime: 创建时间 + * + * @return integer|null + */ + public function getCreateTime() + { + return $this->get("CreateTime"); + } + + /** + * CreateTime: 创建时间 + * + * @param int $createTime + */ + public function setCreateTime($createTime) + { + $this->set("CreateTime", $createTime); + } + + /** + * 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); + } + + /** + * IP: 代理IP + * + * @return string|null + */ + public function getIP() + { + return $this->get("IP"); + } + + /** + * IP: 代理IP + * + * @param string $ip + */ + public function setIP($ip) + { + $this->set("IP", $ip); + } + + /** + * Port: 代理端口 + * + * @return integer|null + */ + public function getPort() + { + return $this->get("Port"); + } + + /** + * Port: 代理端口 + * + * @param int $port + */ + public function setPort($port) + { + $this->set("Port", $port); + } + + /** + * State: 状态 + * + * @return string|null + */ + public function getState() + { + return $this->get("State"); + } + + /** + * State: 状态 + * + * @param string $state + */ + public function setState($state) + { + $this->set("State", $state); + } + + /** + * ZoneID: 可用区ID + * + * @return integer|null + */ + public function getZoneID() + { + return $this->get("ZoneID"); + } + + /** + * ZoneID: 可用区ID + * + * @param int $zoneID + */ + public function setZoneID($zoneID) + { + $this->set("ZoneID", $zoneID); + } + + /** + * NodeCount: 代理节点数 + * + * @return integer|null + */ + public function getNodeCount() + { + return $this->get("NodeCount"); + } + + /** + * NodeCount: 代理节点数 + * + * @param int $nodeCount + */ + public function setNodeCount($nodeCount) + { + $this->set("NodeCount", $nodeCount); + } + + /** + * CPUCores: 单个代理节点CPU核数 + * + * @return integer|null + */ + public function getCPUCores() + { + return $this->get("CPUCores"); + } + + /** + * CPUCores: 单个代理节点CPU核数 + * + * @param int $cpuCores + */ + public function setCPUCores($cpuCores) + { + $this->set("CPUCores", $cpuCores); + } + + /** + * Memory: 单个代理内存 + * + * @return integer|null + */ + public function getMemory() + { + return $this->get("Memory"); + } + + /** + * Memory: 单个代理内存 + * + * @param int $memory + */ + public function setMemory($memory) + { + $this->set("Memory", $memory); + } + + /** + * Name: 代理名称 + * + * @return string|null + */ + public function getName() + { + return $this->get("Name"); + } + + /** + * Name: 代理名称 + * + * @param string $name + */ + public function setName($name) + { + $this->set("Name", $name); + } + + /** + * InstanceVersion: 实例版本 + * + * @return string|null + */ + public function getInstanceVersion() + { + return $this->get("InstanceVersion"); + } + + /** + * InstanceVersion: 实例版本 + * + * @param string $instanceVersion + */ + public function setInstanceVersion($instanceVersion) + { + $this->set("InstanceVersion", $instanceVersion); + } + + /** + * BaseDBDataArr: 加入代理DB信息 + * + * @return BaseDBData[]|null + */ + public function getBaseDBDataArr() + { + $items = $this->get("BaseDBDataArr"); + if ($items == null) { + return []; + } + $result = []; + foreach ($items as $i => $item) { + array_push($result, new BaseDBData($item)); + } + return $result; + } + + /** + * BaseDBDataArr: 加入代理DB信息 + * + * @param BaseDBData[] $baseDBDataArr + */ + public function setBaseDBDataArr(array $baseDBDataArr) + { + $result = []; + foreach ($baseDBDataArr as $i => $item) { + array_push($result, $item->getAll()); + } + return $result; + } +} diff --git a/src/UDBProxy/UDBProxyClient.php b/src/UDBProxy/UDBProxyClient.php new file mode 100644 index 00000000..ddeb8cc3 --- /dev/null +++ b/src/UDBProxy/UDBProxyClient.php @@ -0,0 +1,205 @@ + (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "Zone" => (string) 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "UDBProxyID" => (string) 读写分离ID + * ] + * + * Outputs: + * + * $outputs = [ + * "UDBProxyID" => (string) UDBProxy实例ID + * "UDBProxyIP" => (string) UDB代理服务IP + * "UDBProxyPort" => (integer) UDB代理服务端口 + * "State" => (string) 状态 + * "CreateTime" => (integer) 创建时间 + * "ModifyTime" => (integer) 修改时间 + * "ReadWeightMode" => (integer) 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式 + * "CPUCores" => (integer) cpu核数 + * "Memory" => (integer) 内存 + * "NodeCount" => (integer) 集群实例节点数 + * "ZoneId" => (integer) 可用区id + * "Name" => (string) 名称 + * "MaxConnection" => (integer) UDB代理服务最大连接数 + * "DelayThreshold" => (integer) 延迟阈值(单位s) + * "UDBReplicas" => (array) UDB集群数据[ + * [ + * "ID" => (string) 数据库ID + * "IP" => (string) 数据库IP + * "Port" => (integer) 数据库服务端口 + * "ReadWeight" => (integer) 读权重 + * "State" => (string) 状态 + * "Role" => (string) 角色[master-主库,slave-从库] + * "CreateTime" => (integer) 创建时间 + * "ModifyTime" => (integer) 修改时间 + * "JoinState" => (boolean) 是否加入代理服务(true:加入,false:未加入) + * "Name" => (string) 数据库名称 + * ] + * ] + * "Nodes" => (array) 集群实例服务节点数据[ + * [ + * "ID" => (string) 服务节点id + * "State" => (string) 服务节点状态 + * ] + * ] + * "SQLLimitCount" => (integer) sql限流数量 + * "SQLRouterCount" => (integer) sql路由数量 + * "InstanceVersion" => (string) 实例版本 + * "EnableTransSplit" => (integer) 是否启用事务拆分(1:启用事务拆分,2:关闭事务拆分) + * "PrivateDomainInfo" => (object) 代理实例的内网域名及其开关状态,含域名地址、域名开关、域名数据源指向[ + * "PrivateDomain" => (string) 实例的内网域名地址,形如 xxx.ucloudcs.com;未开通内网域名时为空字符串 + * "EnablePrivateDomain" => (integer) 内网域名是否已开启:1 已开启,2 已关闭;未开通内网域名时返回 2 + * "EnableConnectToDB" => (integer) 内网域名指向的数据源:1 指向主库(可直连数据库),2 指向代理(经 UDBProxy访问);未开通时返回 2 + * ] + * ] + * + * @return DescribeUDBProxyResponse + * @throws UCloudException + */ + public function describeUDBProxy(DescribeUDBProxyRequest $request = null) + { + $resp = $this->invoke($request); + return new DescribeUDBProxyResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ListUDBProxyClient - 查询代理客户端连接IP信息(实时) + * + * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_client + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "Zone" => (string) 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "UDBProxyID" => (string) 代理ID + * ] + * + * Outputs: + * + * $outputs = [ + * "UDBProxyID" => (string) 代理ID + * "NodeClientInfos" => (array) 代理节点客户端IP连接信息[ + * [ + * "Records" => (array) 客户端IP连接信息[ + * [ + * "ID" => (integer) 当前连接DB进程ID + * "User" => (string) 启动这个线程的用户 + * "Host" => (string) 代理连接DB地址 + * "DB" => (string) 当前执行的命令是在哪一个数据库上。如果没有指定数据库,则该值为 NULL + * "Command" => (string) 显示当前连接的执行的命令 + * "Time" => (integer) 表示该线程处于当前状态的时间 + * "State" => (string) 线程的状态,和 Command 对应 + * "Info" => (string) 一般记录的是线程执行的语句 + * "ClientHost" => (string) 客户端来源IP地址 + * "DBID" => (string) 数据库资源ID + * "Role" => (string) 数据库角色(主库/从库) + * ] + * ] + * "ID" => (string) 代理节点ID + * "IP" => (string) 代理节点IP + * ] + * ] + * ] + * + * @return ListUDBProxyClientResponse + * @throws UCloudException + */ + public function listUDBProxyClient(ListUDBProxyClientRequest $request = null) + { + $resp = $this->invoke($request); + return new ListUDBProxyClientResponse($resp->toArray(), $resp->getRequestId()); + } + + /** + * ListUDBProxyInstanceByDB - 查询DB启用代理数据 + * + * See also: https://docs.ucloud.cn/api/udbproxy-api/list_udb_proxy_instance_by_db + * + * Arguments: + * + * $args = [ + * "Region" => (string) 地域。 参见 [地域和可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "Zone" => (string) 可用区。参见 [可用区列表](https://docs.ucloud.cn/api/summary/regionlist) + * "ProjectId" => (string) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](https://docs.ucloud.cn/api/summary/get_project_list) + * "DBID" => (string) 数据库DB资源ID + * ] + * + * Outputs: + * + * $outputs = [ + * "UDBProxyBaseItems" => (array) 代理列表数据[ + * [ + * "ReadWeightMode" => (integer) 读权重模式:1-主节点模式;2-节点均衡模式;3-从节点均衡(排除主节点);5-用户自定义模式 + * "CreateTime" => (integer) 创建时间 + * "ID" => (string) 代理ID + * "IP" => (string) 代理IP + * "Port" => (integer) 代理端口 + * "State" => (string) 状态 + * "ZoneID" => (integer) 可用区ID + * "NodeCount" => (integer) 代理节点数 + * "CPUCores" => (integer) 单个代理节点CPU核数 + * "Memory" => (integer) 单个代理内存 + * "Name" => (string) 代理名称 + * "InstanceVersion" => (string) 实例版本 + * "BaseDBDataArr" => (array) 加入代理DB信息[ + * [ + * "ID" => (string) 数据库ID + * "Name" => (string) 数据库名称 + * "ReadWeight" => (integer) 权重 + * ] + * ] + * ] + * ] + * ] + * + * @return ListUDBProxyInstanceByDBResponse + * @throws UCloudException + */ + public function listUDBProxyInstanceByDB(ListUDBProxyInstanceByDBRequest $request = null) + { + $resp = $this->invoke($request); + return new ListUDBProxyInstanceByDBResponse($resp->toArray(), $resp->getRequestId()); + } +}