Skip to content
Open
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.10
0.3.11
390 changes: 390 additions & 0 deletions src/UCompShare/Apis/CreateCompShareInstanceRequest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,390 @@
<?php
/**
* Copyright 2025 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\UCompShare\Apis;

use UCloud\Core\Request\Request;
use UCloud\UCompShare\Params\CreateCompShareInstanceParamDisks;

class CreateCompShareInstanceRequest extends Request
{
public function __construct()
{
parent::__construct(["Action" => "CreateCompShareInstance"]);
$this->markRequired("Region");
$this->markRequired("Zone");
$this->markRequired("MachineType");
$this->markRequired("GPU");
$this->markRequired("Memory");
$this->markRequired("CPU");
$this->markRequired("GpuType");
$this->markRequired("CompShareImageId");
}



/**
* 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);
}

/**
* Disks:
*
* @return CreateCompShareInstanceParamDisks[]|null
*/
public function getDisks()
{
$items = $this->get("Disks");
if ($items == null) {
return [];
}
$result = [];
foreach ($items as $i => $item) {
array_push($result, new CreateCompShareInstanceParamDisks($item));
}
return $result;
}

/**
* Disks:
*
* @param CreateCompShareInstanceParamDisks[] $disks
*/
public function setDisks(array $disks)
{
$result = [];
foreach ($disks as $i => $item) {
array_push($result, $item->getAll());
}
return $result;
}

/**
* MachineType: 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OS", "OM", "OPRO", "OMAX", "O.BM", "O.EPC"]。参考[[api:uhost-api:uhost_type|云主机机型说明]]。
*
* @return string|null
*/
public function getMachineType()
{
return $this->get("MachineType");
}

/**
* MachineType: 云主机机型(V2.0),在本字段和字段UHostType中,仅需要其中1个字段即可。枚举值["N", "C", "G", "O", "OS", "OM", "OPRO", "OMAX", "O.BM", "O.EPC"]。参考[[api:uhost-api:uhost_type|云主机机型说明]]。
*
* @param string $machineType
*/
public function setMachineType($machineType)
{
$this->set("MachineType", $machineType);
}

/**
* GPU: GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
*
* @return integer|null
*/
public function getGPU()
{
return $this->get("GPU");
}

/**
* GPU: GPU卡核心数。仅GPU机型支持此字段(可选范围与MachineType+GpuType相关)
*
* @param int $gpu
*/
public function setGPU($gpu)
{
$this->set("GPU", $gpu);
}

/**
* Memory: 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
*
* @return integer|null
*/
public function getMemory()
{
return $this->get("Memory");
}

/**
* Memory: 内存大小。单位:MB。范围 :[1024, 262144],取值为1024的倍数(可选范围参考控制台)。默认值:8192
*
* @param int $memory
*/
public function setMemory($memory)
{
$this->set("Memory", $memory);
}

/**
* CPU: 虚拟CPU核数。可选参数:1-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
*
* @return integer|null
*/
public function getCPU()
{
return $this->get("CPU");
}

/**
* CPU: 虚拟CPU核数。可选参数:1-64(具体机型与CPU的对应关系参照控制台)。默认值: 4。
*
* @param int $cpu
*/
public function setCPU($cpu)
{
$this->set("CPU", $cpu);
}

/**
* GpuType: GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","A100"],MachineType为G时必填
*
* @return string|null
*/
public function getGpuType()
{
return $this->get("GpuType");
}

/**
* GpuType: GPU类型,枚举值["K80", "P40", "V100", "T4","T4A", "T4S","2080Ti","2080Ti-4C","1080Ti", "T4/4", "MI100", "V100S",2080","2080TiS","2080TiPro","3090","A100"],MachineType为G时必填
*
* @param string $gpuType
*/
public function setGpuType($gpuType)
{
$this->set("GpuType", $gpuType);
}

/**
* CompShareImageId: 镜像ID
*
* @return string|null
*/
public function getCompShareImageId()
{
return $this->get("CompShareImageId");
}

/**
* CompShareImageId: 镜像ID
*
* @param string $compShareImageId
*/
public function setCompShareImageId($compShareImageId)
{
$this->set("CompShareImageId", $compShareImageId);
}

/**
* LoginMode: 主机登陆模式。密码(默认选项): Password
*
* @return string|null
*/
public function getLoginMode()
{
return $this->get("LoginMode");
}

/**
* LoginMode: 主机登陆模式。密码(默认选项): Password
*
* @param string $loginMode
*/
public function setLoginMode($loginMode)
{
$this->set("LoginMode", $loginMode);
}

/**
* ChargeType: 计费模式。枚举值为: \\ > Month,按月付费;\\ > Day,按天付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ > Spot计费为抢占式实例(内测阶段) \\ 默认为月付
*
* @return string|null
*/
public function getChargeType()
{
return $this->get("ChargeType");
}

/**
* ChargeType: 计费模式。枚举值为: \\ > Month,按月付费;\\ > Day,按天付费;\\ > Dynamic,按小时预付费 \\ > Postpay,按小时后付费(支持关机不收费,目前仅部分可用区支持,请联系您的客户经理) \\ > Spot计费为抢占式实例(内测阶段) \\ 默认为月付
*
* @param string $chargeType
*/
public function setChargeType($chargeType)
{
$this->set("ChargeType", $chargeType);
}

/**
* Quantity: 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
*
* @return integer|null
*/
public function getQuantity()
{
return $this->get("Quantity");
}

/**
* Quantity: 购买时长。默认:值 1。按小时购买(Dynamic/Postpay)时无需此参数。 月付时,此参数传0,代表购买至月末。
*
* @param int $quantity
*/
public function setQuantity($quantity)
{
$this->set("Quantity", $quantity);
}

/**
* MinimalCpuPlatform: 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake", "Intel/CascadelakeR", "Intel/IceLake", "Amd/Epyc2", "Amd/Auto","Ampere/Auto","Ampere/Altra"],默认值是"Intel/Auto"。
*
* @return string|null
*/
public function getMinimalCpuPlatform()
{
return $this->get("MinimalCpuPlatform");
}

/**
* MinimalCpuPlatform: 最低cpu平台,枚举值["Intel/Auto", "Intel/IvyBridge", "Intel/Haswell", "Intel/Broadwell", "Intel/Skylake", "Intel/Cascadelake", "Intel/CascadelakeR", "Intel/IceLake", "Amd/Epyc2", "Amd/Auto","Ampere/Auto","Ampere/Altra"],默认值是"Intel/Auto"。
*
* @param string $minimalCpuPlatform
*/
public function setMinimalCpuPlatform($minimalCpuPlatform)
{
$this->set("MinimalCpuPlatform", $minimalCpuPlatform);
}

/**
* Password: UHost密码。请遵照[[api:uhost-api:specification|字段规范]]设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx。
*
* @return string|null
*/
public function getPassword()
{
return $this->get("Password");
}

/**
* Password: UHost密码。请遵照[[api:uhost-api:specification|字段规范]]设定密码。密码需使用base64进行编码,举例如下:# echo -n Password1 | base64UGFzc3dvcmQx。
*
* @param string $password
*/
public function setPassword($password)
{
$this->set("Password", $password);
}

/**
* Name: 实例名称
*
* @return string|null
*/
public function getName()
{
return $this->get("Name");
}

/**
* Name: 实例名称
*
* @param string $name
*/
public function setName($name)
{
$this->set("Name", $name);
}

/**
* SecurityGroupId: 防火墙Id
*
* @return string|null
*/
public function getSecurityGroupId()
{
return $this->get("SecurityGroupId");
}

/**
* SecurityGroupId: 防火墙Id
*
* @param string $securityGroupId
*/
public function setSecurityGroupId($securityGroupId)
{
$this->set("SecurityGroupId", $securityGroupId);
}
}
Loading