Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.77
0.3.78
113 changes: 113 additions & 0 deletions src/UDB/Apis/GetUDBAccessInfoRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?php
/**
* Copyright 2026 UCloud Technology Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace UCloud\UDB\Apis;

use UCloud\Core\Request\Request;

class GetUDBAccessInfoRequest extends Request
{
public function __construct()
{
parent::__construct(["Action" => "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);
}
}
90 changes: 90 additions & 0 deletions src/UDB/Apis/GetUDBAccessInfoResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?php
/**
* Copyright 2026 UCloud Technology Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace UCloud\UDB\Apis;

use UCloud\Core\Response\Response;
use UCloud\UDB\Models\ExternalInfo;
use UCloud\UDB\Models\PrivateInfo;

class GetUDBAccessInfoResponse extends Response
{


/**
* ExternalInfo: 实例外网访问信息,含状态、地址、端口、带宽与白名单
*
* @return ExternalInfo[]|null
*/
public function getExternalInfo()
{
$items = $this->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;
}
}
144 changes: 144 additions & 0 deletions src/UDB/Models/ExternalInfo.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
<?php
/**
* Copyright 2026 UCloud Technology Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace UCloud\UDB\Models;

use UCloud\Core\Response\Response;

class ExternalInfo extends Response
{


/**
* Status: 外网访问状态,字符串枚举,取值见下表
*
* @return string|null
*/
public function getStatus()
{
return $this->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);
}
}
Loading