2323use UCloud \UK8S \Params \CreateUK8SClusterV2ParamNodesNetworkInterface ;
2424use UCloud \UK8S \Params \CreateUK8SClusterV2ParamNodesNetworkInterfaceEIP ;
2525use UCloud \UK8S \Params \CreateUK8SClusterV2ParamNodesSecGroupId ;
26+ use UCloud \UK8S \Params \CreateUK8SClusterV2ParamNodesKubeletConfiguration ;
2627use UCloud \UK8S \Params \CreateUK8SClusterV2ParamKubeProxy ;
28+ use UCloud \UK8S \Params \CreateUK8SClusterV2ParamUserLabels ;
2729
2830class CreateUK8SClusterV2Request extends Request
2931{
@@ -40,6 +42,8 @@ public function __construct()
4042 $ this ->markRequired ("MasterMachineType " );
4143 $ this ->markRequired ("MasterCPU " );
4244 $ this ->markRequired ("MasterMem " );
45+ $ this ->markRequired ("K8sVersion " );
46+ $ this ->markRequired ("ImageId " );
4347 }
4448
4549
@@ -184,38 +188,6 @@ public function setPassword($password)
184188 $ this ->set ("Password " , $ password );
185189 }
186190
187- /**
188- * Master:
189- *
190- * @return CreateUK8SClusterV2ParamMaster[]|null
191- */
192- public function getMaster ()
193- {
194- $ items = $ this ->get ("Master " );
195- if ($ items == null ) {
196- return [];
197- }
198- $ result = [];
199- foreach ($ items as $ i => $ item ) {
200- array_push ($ result , new CreateUK8SClusterV2ParamMaster ($ item ));
201- }
202- return $ result ;
203- }
204-
205- /**
206- * Master:
207- *
208- * @param CreateUK8SClusterV2ParamMaster[] $master
209- */
210- public function setMaster (array $ master )
211- {
212- $ result = [];
213- foreach ($ master as $ i => $ item ) {
214- array_push ($ result , $ item ->getAll ());
215- }
216- return $ result ;
217- }
218-
219191 /**
220192 * MasterMachineType: Master节点的云主机机型(V2.0),如["N", "C", "O", "OS"],具体请参照云主机机型。
221193 *
@@ -276,6 +248,38 @@ public function setMasterMem($masterMem)
276248 $ this ->set ("MasterMem " , $ masterMem );
277249 }
278250
251+ /**
252+ * Master:
253+ *
254+ * @return CreateUK8SClusterV2ParamMaster[]|null
255+ */
256+ public function getMaster ()
257+ {
258+ $ items = $ this ->get ("Master " );
259+ if ($ items == null ) {
260+ return [];
261+ }
262+ $ result = [];
263+ foreach ($ items as $ i => $ item ) {
264+ array_push ($ result , new CreateUK8SClusterV2ParamMaster ($ item ));
265+ }
266+ return $ result ;
267+ }
268+
269+ /**
270+ * Master:
271+ *
272+ * @param CreateUK8SClusterV2ParamMaster[] $master
273+ */
274+ public function setMaster (array $ master )
275+ {
276+ $ result = [];
277+ foreach ($ master as $ i => $ item ) {
278+ array_push ($ result , $ item ->getAll ());
279+ }
280+ return $ result ;
281+ }
282+
279283 /**
280284 * Nodes:
281285 *
@@ -308,6 +312,46 @@ public function setNodes(array $nodes)
308312 return $ result ;
309313 }
310314
315+ /**
316+ * K8sVersion: k8s集群的版本,版本信息请参考UK8S集群创建页。
317+ *
318+ * @return string|null
319+ */
320+ public function getK8sVersion ()
321+ {
322+ return $ this ->get ("K8sVersion " );
323+ }
324+
325+ /**
326+ * K8sVersion: k8s集群的版本,版本信息请参考UK8S集群创建页。
327+ *
328+ * @param string $k8sVersion
329+ */
330+ public function setK8sVersion ($ k8sVersion )
331+ {
332+ $ this ->set ("K8sVersion " , $ k8sVersion );
333+ }
334+
335+ /**
336+ * ImageId: Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。
337+ *
338+ * @return string|null
339+ */
340+ public function getImageId ()
341+ {
342+ return $ this ->get ("ImageId " );
343+ }
344+
345+ /**
346+ * ImageId: Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。
347+ *
348+ * @param string $imageId
349+ */
350+ public function setImageId ($ imageId )
351+ {
352+ $ this ->set ("ImageId " , $ imageId );
353+ }
354+
311355 /**
312356 * MasterBootDiskType: Master节点系统盘类型。请参考[[api:uhost-api:disk_type|磁盘类型]]。默认为SSD云盘
313357 *
@@ -408,26 +452,6 @@ public function setChargeType($chargeType)
408452 $ this ->set ("ChargeType " , $ chargeType );
409453 }
410454
411- /**
412- * K8sVersion: k8s集群的版本,版本信息请参考UK8S集群创建页,不指定的话默认为当前支持的最高版本。
413- *
414- * @return string|null
415- */
416- public function getK8sVersion ()
417- {
418- return $ this ->get ("K8sVersion " );
419- }
420-
421- /**
422- * K8sVersion: k8s集群的版本,版本信息请参考UK8S集群创建页,不指定的话默认为当前支持的最高版本。
423- *
424- * @param string $k8sVersion
425- */
426- public function setK8sVersion ($ k8sVersion )
427- {
428- $ this ->set ("K8sVersion " , $ k8sVersion );
429- }
430-
431455 /**
432456 * Quantity: 购买时长。默认为1。按小时购买(Dynamic)时无需此参数。 月付时,此参数传0,代表了购买至月末。
433457 *
@@ -508,26 +532,6 @@ public function setKubeProxy(array $kubeProxy)
508532 $ this ->set ("KubeProxy " , $ kubeProxy ->getAll ());
509533 }
510534
511- /**
512- * ImageId: Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。
513- *
514- * @return string|null
515- */
516- public function getImageId ()
517- {
518- return $ this ->get ("ImageId " );
519- }
520-
521- /**
522- * ImageId: Master节点和Node节点的镜像 ID,不填则随机选择可用的基础镜像。支持用户自定义镜像。
523- *
524- * @param string $imageId
525- */
526- public function setImageId ($ imageId )
527- {
528- $ this ->set ("ImageId " , $ imageId );
529- }
530-
531535 /**
532536 * UserData: 用户自定义数据。注意:1、总数据量大小不超多16K;2、使用base64编码。
533537 *
@@ -689,22 +693,114 @@ public function setForwardSrcIPMethod($forwardSrcIPMethod)
689693 }
690694
691695 /**
692- * UserLabels: UK8S用户标签,key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
696+ * MasterUHostFamily: Master节点规格族,如o1a, o1i
697+ *
698+ * @return string|null
699+ */
700+ public function getMasterUHostFamily ()
701+ {
702+ return $ this ->get ("MasterUHostFamily " );
703+ }
704+
705+ /**
706+ * MasterUHostFamily: Master节点规格族,如o1a, o1i
707+ *
708+ * @param string $masterUHostFamily
709+ */
710+ public function setMasterUHostFamily ($ masterUHostFamily )
711+ {
712+ $ this ->set ("MasterUHostFamily " , $ masterUHostFamily );
713+ }
714+
715+ /**
716+ * KmsPluginKeyId: 开启 kms 插件的 key id
693717 *
694718 * @return string|null
695719 */
720+ public function getKmsPluginKeyId ()
721+ {
722+ return $ this ->get ("KmsPluginKeyId " );
723+ }
724+
725+ /**
726+ * KmsPluginKeyId: 开启 kms 插件的 key id
727+ *
728+ * @param string $kmsPluginKeyId
729+ */
730+ public function setKmsPluginKeyId ($ kmsPluginKeyId )
731+ {
732+ $ this ->set ("KmsPluginKeyId " , $ kmsPluginKeyId );
733+ }
734+
735+ /**
736+ * MasterDataDiskKmsKeyId: master 节点数据盘使用的 kms key id
737+ *
738+ * @return string|null
739+ */
740+ public function getMasterDataDiskKmsKeyId ()
741+ {
742+ return $ this ->get ("MasterDataDiskKmsKeyId " );
743+ }
744+
745+ /**
746+ * MasterDataDiskKmsKeyId: master 节点数据盘使用的 kms key id
747+ *
748+ * @param string $masterDataDiskKmsKeyId
749+ */
750+ public function setMasterDataDiskKmsKeyId ($ masterDataDiskKmsKeyId )
751+ {
752+ $ this ->set ("MasterDataDiskKmsKeyId " , $ masterDataDiskKmsKeyId );
753+ }
754+
755+ /**
756+ * KmsPluginResource: kms 加密的资源
757+ *
758+ * @return string[]|null
759+ */
760+ public function getKmsPluginResource ()
761+ {
762+ return $ this ->get ("KmsPluginResource " );
763+ }
764+
765+ /**
766+ * KmsPluginResource: kms 加密的资源
767+ *
768+ * @param string[] $kmsPluginResource
769+ */
770+ public function setKmsPluginResource (array $ kmsPluginResource )
771+ {
772+ $ this ->set ("KmsPluginResource " , $ kmsPluginResource );
773+ }
774+
775+ /**
776+ * UserLabels:
777+ *
778+ * @return CreateUK8SClusterV2ParamUserLabels[]|null
779+ */
696780 public function getUserLabels ()
697781 {
698- return $ this ->get ("UserLabels " );
782+ $ items = $ this ->get ("UserLabels " );
783+ if ($ items == null ) {
784+ return [];
785+ }
786+ $ result = [];
787+ foreach ($ items as $ i => $ item ) {
788+ array_push ($ result , new CreateUK8SClusterV2ParamUserLabels ($ item ));
789+ }
790+ return $ result ;
699791 }
700792
701793 /**
702- * UserLabels: UK8S用户标签,key=value形式,多组用”,“隔开,最多5组。 如env=pro,type=game
794+ * UserLabels:
703795 *
704- * @param string $userLabels
796+ * @param CreateUK8SClusterV2ParamUserLabels[] $userLabels
705797 */
706- public function setUserLabels ($ userLabels )
798+ public function setUserLabels (array $ userLabels )
707799 {
708- $ this ->set ("UserLabels " , $ userLabels );
800+ $ result = [];
801+ foreach ($ userLabels as $ i => $ item ) {
802+ array_push ($ result , $ item ->getAll ());
803+ }
804+ return $ result ;
709805 }
710806}
0 commit comments