-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathCreateCompShareInstanceRequest.php
More file actions
390 lines (352 loc) · 11 KB
/
CreateCompShareInstanceRequest.php
File metadata and controls
390 lines (352 loc) · 11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
<?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);
}
}