ProductConfigurationRepository.php 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566
  1. <?php
  2. /* * ********************************************************************
  3. * ProxmoxVPS product developed. (2019-09-06)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\Repositories\Vps;
  20. use ModulesGarden\ProxmoxAddon\App\Repositories\AbstractProductConfigurationRepository;
  21. /**
  22. * Description of ProductConfigurationRepository
  23. * @author Pawel Kopec <pawelk@modulesgarden.com>
  24. * @version 1.0.0
  25. */
  26. class ProductConfigurationRepository extends AbstractProductConfigurationRepository
  27. {
  28. public function isDebug()
  29. {
  30. return $this->get("debugMode") == "on";
  31. }
  32. public function getVirtualization()
  33. {
  34. return $this->get("virtualization", 'qemu');
  35. }
  36. public function isQemu()
  37. {
  38. return $this->getVirtualization() == "qemu";
  39. }
  40. public function isLxc()
  41. {
  42. return $this->getVirtualization() == "lxc";
  43. }
  44. public function getDefaultNode()
  45. {
  46. return $this->get("defaultNode");
  47. }
  48. public function isCheckResources()
  49. {
  50. return $this->get('checkResources') == "on";
  51. }
  52. public function isBackupVmBeforeReinstall()
  53. {
  54. return $this->get('backupVmBeforeReinstall') == "on";
  55. }
  56. public function isRebootVmAfterChangePackage()
  57. {
  58. return $this->get('rebootVmAfterChangePackage') == "on";
  59. }
  60. public function isDeleteBackups()
  61. {
  62. return $this->get('deleteBackups') == "on";
  63. }
  64. public function isServerNameservers()
  65. {
  66. return $this->get('serverNameservers') == "on";
  67. }
  68. public function getConsoleHost()
  69. {
  70. return $this->get("consoleHost");
  71. }
  72. public function isOneUserPerVps()
  73. {
  74. return $this->get('oneUserPerVps') == "on";
  75. }
  76. public function getUserPrefix()
  77. {
  78. return $this->get("userPrefix");
  79. }
  80. public function getRealm()
  81. {
  82. return $this->get("realm", "pve");
  83. }
  84. public function getUserComment()
  85. {
  86. return $this->get("userComment");
  87. }
  88. public function getUserRole()
  89. {
  90. return $this->get("userRole");
  91. }
  92. public function getWelcomeEmailTemplateId()
  93. {
  94. return $this->get("welcomeEmailTemplateId");
  95. }
  96. public function getReinstallEmailTemplateId()
  97. {
  98. return $this->get("reinstallEmailTemplateId");
  99. }
  100. public function getServiceCreationFailedTemplateId()
  101. {
  102. return $this->get("serviceCreationFailedTemplateId");
  103. }
  104. public function getUpgradeNotificationTemplateId()
  105. {
  106. return $this->get("upgradeNotificationTemplateId");
  107. }
  108. public function isToDoList()
  109. {
  110. return $this->get("toDoList") == "on";
  111. }
  112. public function getCmode()
  113. {
  114. return $this->get("cmode") == "on";
  115. }
  116. public function getOsType()
  117. {
  118. return $this->get("ostype");
  119. }
  120. public function getPool()
  121. {
  122. return $this->get("pool");
  123. }
  124. public function getDescription()
  125. {
  126. return $this->get("description");
  127. }
  128. public function getTty()
  129. {
  130. return $this->get("tty");
  131. }
  132. public function isSshKeyPairs()
  133. {
  134. return $this->get("sshKeyPairs") == "on";
  135. }
  136. public function getArch()
  137. {
  138. return $this->get("arch");
  139. }
  140. public function isConsole()
  141. {
  142. return $this->get("console") == "on";
  143. }
  144. public function isOnboot()
  145. {
  146. return $this->get("onboot") == "on";
  147. }
  148. public function isProtection()
  149. {
  150. return $this->get("protection") == "on";
  151. }
  152. public function isStartup()
  153. {
  154. return $this->get("startup") == "on";
  155. }
  156. public function isSshDeletePrivateKey()
  157. {
  158. return $this->get("sshDeletePrivateKey") == "on";
  159. }
  160. public function getOsTemplate()
  161. {
  162. return $this->get("osTemplate");
  163. }
  164. public function getCpuunits()
  165. {
  166. return $this->get("cpuunits");
  167. }
  168. /**
  169. * @return int
  170. */
  171. public function getMemory()
  172. {
  173. return $this->get("memory");
  174. }
  175. /**
  176. * @return int
  177. */
  178. public function getProductId()
  179. {
  180. return $this->productId;
  181. }
  182. /**
  183. * @return int
  184. */
  185. public function getDiskSize()
  186. {
  187. return $this->get("diskSize");
  188. }
  189. /**
  190. * @return int
  191. */
  192. public function getAdditionalDiskSize()
  193. {
  194. return $this->get("additionalDiskSize");
  195. }
  196. /**
  197. * @return int
  198. */
  199. public function getMinimumRate()
  200. {
  201. return $this->get("minimumRate");
  202. }
  203. /**
  204. * @return int
  205. */
  206. public function getIpv4()
  207. {
  208. return $this->get("ipv4");
  209. }
  210. /**
  211. * @return int
  212. */
  213. public function getIpv6()
  214. {
  215. return $this->get("ipv6");
  216. }
  217. /**
  218. * @return int
  219. */
  220. public function getBackupMaxFiles()
  221. {
  222. return $this->get("backupMaxFiles");
  223. }
  224. /**
  225. * @return int
  226. */
  227. public function getCpulimit()
  228. {
  229. return $this->get("cpulimit");
  230. }
  231. /**
  232. * @return int
  233. */
  234. public function getCores()
  235. {
  236. return $this->get("cores");
  237. }
  238. /**
  239. * @return int
  240. */
  241. public function getSwap()
  242. {
  243. return $this->get("swap");
  244. }
  245. /**
  246. * @return int
  247. */
  248. public function getRate()
  249. {
  250. return $this->get("rate");
  251. }
  252. /**
  253. * @return int
  254. */
  255. public function getBackupMaxSize()
  256. {
  257. return $this->get("backupMaxSize");
  258. }
  259. /**
  260. * @return int
  261. */
  262. public function getBandwidth()
  263. {
  264. return $this->get("bandwidth");
  265. }
  266. /**
  267. * @return int
  268. */
  269. public function getSnapshotMaxFiles()
  270. {
  271. return $this->get("snapshotMaxFiles");
  272. }
  273. /**
  274. * @return int
  275. */
  276. public function getMountPointStorage()
  277. {
  278. return $this->get("mountPointStorage");
  279. }
  280. /**
  281. * @return int
  282. */
  283. public function isMountPointRo()
  284. {
  285. return $this->get("mountPointRo") == "on";
  286. }
  287. /**
  288. * @return int
  289. */
  290. public function isReplicate()
  291. {
  292. return $this->get("replicate") == "on";
  293. }
  294. /**
  295. * @return int
  296. */
  297. public function getMountPointAcl()
  298. {
  299. return $this->get("mountPointAcl");
  300. }
  301. /**
  302. * @return int
  303. */
  304. public function isMountPointQuota()
  305. {
  306. return $this->get("mountPointQuota") == "on";
  307. }
  308. /**
  309. * @return string
  310. */
  311. public function getIpv4NetworkMode()
  312. {
  313. return $this->get("ipv4NetworkMode");
  314. }
  315. /**
  316. * @return string
  317. */
  318. public function getIpv6NetworkMode()
  319. {
  320. return $this->get("ipv6NetworkMode");
  321. }
  322. /**
  323. * @return string
  324. */
  325. public function getPrivateBridge()
  326. {
  327. return $this->get("privateBridge");
  328. }
  329. /**
  330. * @return string
  331. */
  332. public function getBridge()
  333. {
  334. return $this->get("bridge");
  335. }
  336. /**
  337. * @return boolean
  338. */
  339. public function isNetworkFirewall()
  340. {
  341. return $this->get("networkFirewall") == "on";
  342. }
  343. /**
  344. * @return int
  345. */
  346. public function getTagFrom()
  347. {
  348. return $this->get("tagFrom");
  349. }
  350. /**
  351. * @return int
  352. */
  353. public function getTagTo()
  354. {
  355. return $this->get("tagTo");
  356. }
  357. /**
  358. * @return string
  359. */
  360. public function getSwapUnit()
  361. {
  362. return $this->get("swapUnit", "mb");
  363. }
  364. /**
  365. * @return string
  366. */
  367. public function getDiskUnit()
  368. {
  369. return $this->get("diskUnit", "gb");
  370. }
  371. /**
  372. * @return string
  373. */
  374. public function getMemoryUnit()
  375. {
  376. return $this->get("memoryUnit", "mb");
  377. }
  378. /**
  379. * @return string
  380. */
  381. public function getAdditionalDiskUnit()
  382. {
  383. return $this->get("additionalDiskUnit", "gb");
  384. }
  385. /**
  386. * @return array
  387. */
  388. public function getFirewallInterfaces()
  389. {
  390. return $this->get("firewallInterfaces");
  391. }
  392. /**
  393. * @return int
  394. */
  395. public function getFirewallMaxRules()
  396. {
  397. return $this->get("firewallMaxRules");
  398. }
  399. /**
  400. * @return bool
  401. */
  402. public function isLoadBalancer()
  403. {
  404. return $this->get("loadBalancer") == "on";
  405. }
  406. /**
  407. * @return bool
  408. */
  409. public function isLoadBalancerShutdownOnUpgrade()
  410. {
  411. return $this->get("loadBalancerShutdownOnUpgrade") == "on";
  412. }
  413. /**
  414. * @return string
  415. */
  416. public function getLoadBalancerOnUpgrade()
  417. {
  418. return $this->get("loadBalancerOnUpgrade");
  419. }
  420. /**
  421. * @return bool
  422. */
  423. public function isLoadBalancerStopOnUpgrade()
  424. {
  425. return $this->get("loadBalancerStopOnUpgrade") == "on";
  426. }
  427. /**
  428. * @return string
  429. */
  430. public function getBackupStorage()
  431. {
  432. return $this->get("backupStorage");
  433. }
  434. /**
  435. * @return bool
  436. */
  437. public function isBackupRouting()
  438. {
  439. return $this->get("backupRouting") == "on";
  440. }
  441. /**
  442. * @return int
  443. */
  444. public function getBackupStoreDays()
  445. {
  446. return $this->get("backupStoreDays");
  447. }
  448. /**
  449. * @return string
  450. */
  451. public function getClusterState()
  452. {
  453. return $this->get("clusterState");
  454. }
  455. /**
  456. * @return int
  457. */
  458. public function getClusterMaxRestart()
  459. {
  460. return $this->get("clusterMaxRestart");
  461. }
  462. /**
  463. * @return string
  464. */
  465. public function getClusterGroup()
  466. {
  467. return $this->get("clusterGroup");
  468. }
  469. /**
  470. * @return int
  471. */
  472. public function getClusterMaxRelocate()
  473. {
  474. return $this->get("clusterMaxRelocate");
  475. }
  476. /**
  477. * @return bool
  478. */
  479. public function isPermissionStart()
  480. {
  481. return $this->get("permissionStart") == "on";
  482. }
  483. /**
  484. * @return bool
  485. */
  486. public function isPermissionStop()
  487. {
  488. return $this->get("permissionStop") == "on";
  489. }
  490. /**
  491. * @return bool
  492. */
  493. public function isPermissionNovnc()
  494. {
  495. return $this->get("permissionNovnc") == "on";
  496. }
  497. /**
  498. * @return bool
  499. */
  500. public function isPermissionXtermjs()
  501. {
  502. return $this->get("permissionXtermjs") == "on";
  503. }
  504. /**
  505. * @return bool
  506. */
  507. public function isPermissionOsTemplate()
  508. {
  509. return $this->get("permissionOsTemplate") == "on";
  510. }
  511. /**
  512. * @return bool
  513. */
  514. public function isPermissionIsoImage()
  515. {
  516. return $this->get("permissionIsoImage") == "on";
  517. }
  518. /**
  519. * @return bool
  520. */
  521. public function isPermissionGraph()
  522. {
  523. return $this->get("permissionGraph") == "on";
  524. }
  525. /**
  526. * @return bool
  527. */
  528. public function isPermissionBackupJob()
  529. {
  530. return $this->get("permissionBackupJob") == "on";
  531. }
  532. /**
  533. * @return bool
  534. */
  535. public function isPermissionNetwork()
  536. {
  537. return $this->get("permissionNetwork") == "on";
  538. }
  539. /**
  540. * @return bool
  541. */
  542. public function isPermissionFirewall()
  543. {
  544. return $this->get("permissionFirewall") == "on";
  545. }
  546. /**
  547. * @return bool
  548. */
  549. public function isPermissionDisk()
  550. {
  551. return $this->get("permissionDisk") == "on";
  552. }
  553. /**
  554. * @return bool
  555. */
  556. public function isPermissionReboot()
  557. {
  558. return $this->get("permissionReboot") == "on";
  559. }
  560. /**
  561. * @return bool
  562. */
  563. public function isPermissionShutdown()
  564. {
  565. return $this->get("permissionShutdown") == "on";
  566. }
  567. /**
  568. * @return bool
  569. */
  570. public function isPermissionSpice()
  571. {
  572. return $this->get("permissionSpice") == "on";
  573. }
  574. /**
  575. * @return bool
  576. */
  577. public function isPermissionReinstall()
  578. {
  579. return $this->get("permissionReinstall") == "on";
  580. }
  581. /**
  582. * @return array
  583. */
  584. public function getPermissionOsTemplates()
  585. {
  586. return $this->get("permissionOsTemplates");
  587. }
  588. public function isPermissionOsTemplates()
  589. {
  590. return !empty($this->get("permissionOsTemplates"));
  591. }
  592. /**
  593. * @return bool
  594. */
  595. public function isPermissionBackup()
  596. {
  597. return $this->get("permissionBackup") == "on";
  598. }
  599. /**
  600. * @return bool
  601. */
  602. public function isPermissionTaskHistory()
  603. {
  604. return $this->get("permissionTaskHistory") == "on";
  605. }
  606. /**
  607. * @return bool
  608. */
  609. public function isPermissionSnapshot()
  610. {
  611. return $this->get("permissionSnapshot") == "on";
  612. }
  613. /**
  614. * @return bool
  615. */
  616. public function isPermissionFirewallOption()
  617. {
  618. return $this->get("permissionFirewallOption") == "on";
  619. }
  620. public function getNetworkModel()
  621. {
  622. return $this->get("networkModel");
  623. }
  624. public function getNetworkPrivateModel()
  625. {
  626. return $this->get("networkPrivateModel");
  627. }
  628. public function isCloudInit()
  629. {
  630. return $this->get("cloudInit") == "on";
  631. }
  632. /**
  633. * @return int
  634. */
  635. public function getAdditionalDiskMbpsRd()
  636. {
  637. return $this->get("additionalDiskMbps_rd");
  638. }
  639. /**
  640. * @return int
  641. */
  642. public function getAdditionalDiskIopsRd()
  643. {
  644. return $this->get("additionalDiskIops_rd");
  645. }
  646. /**
  647. * @return int
  648. */
  649. public function getAdditionalDiskIopsWr()
  650. {
  651. return $this->get("additionalDiskIops_wr");
  652. }
  653. /**
  654. * @return int
  655. */
  656. public function getAdditionalDiskMbpsWr()
  657. {
  658. return $this->get("additionalDiskMbps_wr");
  659. }
  660. /**
  661. * @return int
  662. */
  663. public function getAdditionalDiskIopsRdMax()
  664. {
  665. return $this->get("additionalDiskIops_rd_max");
  666. }
  667. /**
  668. * @return int
  669. */
  670. public function getAdditionalDiskIopsWrMax()
  671. {
  672. return $this->get("additionalDiskIops_wr_max");
  673. }
  674. /**
  675. * @return string
  676. */
  677. public function getAdditionalDiskStorage()
  678. {
  679. return $this->get("additionalDiskStorage");
  680. }
  681. /**
  682. * @return string
  683. */
  684. public function getAdditionalDiskFormat()
  685. {
  686. return $this->get("additionalDiskFormat");
  687. }
  688. /**
  689. * @return string
  690. */
  691. public function getAdditionalDiskCache()
  692. {
  693. return $this->get("additionalDiskCache");
  694. }
  695. /**
  696. * @return bool
  697. */
  698. public function isAdditionalDiskIoThread()
  699. {
  700. return $this->get("additionalDiskIoThread") == "on";
  701. }
  702. /**
  703. * @return string
  704. */
  705. public function getAdditionalDiskType()
  706. {
  707. return $this->get("additionalDiskType");
  708. }
  709. /**
  710. * @return bool
  711. */
  712. public function isAdditionalDiskReplicate()
  713. {
  714. return $this->get("additionalDiskReplicate") == "on";
  715. }
  716. /**
  717. * @return bool
  718. */
  719. public function isAdditionalDiskDiscard()
  720. {
  721. return $this->get("additionalDiskDiscard") == "on";
  722. }
  723. /**
  724. * @return bool
  725. */
  726. public function isPermissionAdditionalDiskBackup()
  727. {
  728. return $this->get("permissionAdditionalDiskBackup") == "on";
  729. }
  730. public function isPermissionMountPointBackup()
  731. {
  732. return $this->get("permissionMountPointBackup") == "on";
  733. }
  734. public function isMountPointReplicate()
  735. {
  736. return $this->get("mountPointReplicate") == "on";
  737. }
  738. public function isOsTemplatesInAllNodes()
  739. {
  740. return $this->get("osTemplatesInAllNodes") == "on";
  741. }
  742. public function getPermissionIsoImages()
  743. {
  744. return $this->get("permissionIsoImages");
  745. }
  746. public function isPermissionIsoImages()
  747. {
  748. return !empty($this->get("permissionIsoImages"));
  749. }
  750. public function getStorage()
  751. {
  752. return $this->get("storage");
  753. }
  754. /**
  755. * @return bool
  756. */
  757. public function isAgent()
  758. {
  759. return $this->get('agent') == "on";
  760. }
  761. /**
  762. * @return string
  763. */
  764. public function getCdrom()
  765. {
  766. return $this->get('cdrom');
  767. }
  768. /**
  769. * @return bool
  770. */
  771. public function isNuma()
  772. {
  773. return $this->get('numa') == "on";
  774. }
  775. /**
  776. * @return bool
  777. */
  778. public function isSpec()
  779. {
  780. return $this->get('spec') == "on";
  781. }
  782. /**
  783. * @return bool
  784. */
  785. public function isFreeze()
  786. {
  787. return $this->get('freeze') == "on";
  788. }
  789. /**
  790. * @return string
  791. */
  792. public function getKeyboard()
  793. {
  794. return $this->get('keyboard');
  795. }
  796. /**
  797. * @return string
  798. */
  799. public function getVga()
  800. {
  801. return $this->get('vga');
  802. }
  803. public function getVgaMemory()
  804. {
  805. return $this->get('vgaMemory');
  806. }
  807. /**
  808. * @return string
  809. */
  810. public function getClientNameForContainer()
  811. {
  812. return $this->get('clientNameForContainer');
  813. }
  814. /**
  815. * @return bool
  816. */
  817. public function isAcpi()
  818. {
  819. return $this->get('acpi') == "on";
  820. }
  821. /**
  822. * @return bool
  823. */
  824. public function isAutostart()
  825. {
  826. return $this->get('autostart') == "on";
  827. }
  828. /**
  829. * @return bool
  830. */
  831. public function isPcid()
  832. {
  833. return $this->get('pcid') == "on";
  834. }
  835. /**
  836. * @return bool
  837. */
  838. public function getHotplug()
  839. {
  840. return implode(",",$this->get('hotplug')) ;
  841. }
  842. /**
  843. * @return bool
  844. */
  845. public function isKvm()
  846. {
  847. return $this->get('kvm') == "on";
  848. }
  849. /**
  850. * @return bool
  851. */
  852. public function isReboot()
  853. {
  854. return $this->get('reboot') == "on";
  855. }
  856. /**
  857. * @return bool
  858. */
  859. public function isTablet()
  860. {
  861. return $this->get('tablet') == "on";
  862. }
  863. /**
  864. * @return string
  865. */
  866. public function getContainerPrefix()
  867. {
  868. return $this->get('containerPrefix');
  869. }
  870. /**
  871. * @return string
  872. */
  873. public function getCloneMode()
  874. {
  875. return $this->get('cloneMode');
  876. }
  877. /**
  878. * @return string
  879. */
  880. public function getBalloon()
  881. {
  882. return $this->get('balloon');
  883. }
  884. /**
  885. * @return string
  886. */
  887. public function getArgs()
  888. {
  889. return $this->get('args');
  890. }
  891. /**
  892. * @return string
  893. */
  894. public function getMigrateSpeed()
  895. {
  896. return $this->get('migrate_speed');
  897. }
  898. /**
  899. * @return string
  900. */
  901. public function getMigrateDowntime()
  902. {
  903. return $this->get('migrate_downtime');
  904. }
  905. /**
  906. * @return string
  907. */
  908. public function getStartdate()
  909. {
  910. return $this->get('startdate');
  911. }
  912. /**
  913. * @return string
  914. */
  915. public function getShares()
  916. {
  917. return $this->get('shares');
  918. }
  919. /**
  920. * @return bool
  921. */
  922. public function isLocaltime()
  923. {
  924. return $this->get('localtime') == "on";
  925. }
  926. /**
  927. * @return string
  928. */
  929. public function getWatchdog()
  930. {
  931. return $this->get('watchdog');
  932. }
  933. /**
  934. * @return string
  935. */
  936. public function getStartup()
  937. {
  938. return $this->get('startup');
  939. }
  940. /**
  941. * @return bool
  942. */
  943. public function isTdf()
  944. {
  945. return $this->get('tdf') == "on";
  946. }
  947. /**
  948. * @return string
  949. */
  950. public function getSockets()
  951. {
  952. return $this->get('sockets');
  953. }
  954. /**
  955. * @return string
  956. */
  957. public function getVcpus()
  958. {
  959. return $this->get('vcpus');
  960. }
  961. /**
  962. * @return string
  963. */
  964. public function getIsoImage()
  965. {
  966. return $this->get('isoImage');
  967. }
  968. public function getCdromType()
  969. {
  970. return $this->get('cdromType');
  971. }
  972. /**
  973. * @return string
  974. */
  975. public function getDiskStorage()
  976. {
  977. return $this->get('diskStorage');
  978. }
  979. /**
  980. * @return string
  981. */
  982. public function getDiskFormat()
  983. {
  984. return $this->get('diskFormat');
  985. }
  986. /**
  987. * @return string
  988. */
  989. public function getScsihw()
  990. {
  991. return $this->get('scsihw');
  992. }
  993. /**
  994. * @return string
  995. */
  996. public function getDiskType()
  997. {
  998. return $this->get('diskType');
  999. }
  1000. /**
  1001. * @return string
  1002. */
  1003. public function getDiskCache()
  1004. {
  1005. return $this->get('diskCache');
  1006. }
  1007. /**
  1008. * @return bool
  1009. */
  1010. public function isDiscard()
  1011. {
  1012. return $this->get('discard') == "on";
  1013. }
  1014. /**
  1015. * @return bool
  1016. */
  1017. public function isIoThread()
  1018. {
  1019. return $this->get('ioThread') == "on";
  1020. }
  1021. /**
  1022. * @return string
  1023. */
  1024. public function getMbpsRd()
  1025. {
  1026. return $this->get('mbps_rd');
  1027. }
  1028. /**
  1029. * @return string
  1030. */
  1031. public function getIopsRd()
  1032. {
  1033. return $this->get('iops_rd');
  1034. }
  1035. /**
  1036. * @return string
  1037. */
  1038. public function getIopsWr()
  1039. {
  1040. return $this->get('iops_wr');
  1041. }
  1042. /**
  1043. * @return string
  1044. */
  1045. public function getMbpsWr()
  1046. {
  1047. return $this->get('mbps_wr');
  1048. }
  1049. /**
  1050. * @return string
  1051. */
  1052. public function getIopsRdMax()
  1053. {
  1054. return $this->get('iops_rd_max');
  1055. }
  1056. /**
  1057. * @return string
  1058. */
  1059. public function getIopsWrMax()
  1060. {
  1061. return $this->get('iops_wr_max');
  1062. }
  1063. /**
  1064. * @return bool
  1065. */
  1066. public function isEtworkOneDevice()
  1067. {
  1068. return $this->get('etworkOneDevice') == "on";
  1069. }
  1070. /**
  1071. * @return string
  1072. */
  1073. public function getQueues()
  1074. {
  1075. return $this->get('queues');
  1076. }
  1077. /**
  1078. * @return string
  1079. */
  1080. public function getBootDevice1()
  1081. {
  1082. return $this->get('bootDevice1');
  1083. }
  1084. /**
  1085. * @return string
  1086. */
  1087. public function getBootDevice2()
  1088. {
  1089. return $this->get('bootDevice2');
  1090. }
  1091. /**
  1092. * @return string
  1093. */
  1094. public function getBootDevice3()
  1095. {
  1096. return $this->get('bootDevice3');
  1097. }
  1098. /**
  1099. * @return string
  1100. */
  1101. public function getBootdisk()
  1102. {
  1103. return $this->get('bootdisk');
  1104. }
  1105. /**
  1106. * @return bool
  1107. */
  1108. public function isCloudInitServicePassword()
  1109. {
  1110. return $this->get('cloudInitServicePassword') == "on";
  1111. }
  1112. /**
  1113. * @return bool
  1114. */
  1115. public function isCloudInitServiceUsername()
  1116. {
  1117. return $this->get('cloudInitServiceUsername') == "on";
  1118. }
  1119. /**
  1120. * @return bool
  1121. */
  1122. public function isCloudInitServiceNameservers()
  1123. {
  1124. return $this->get('cloudInitServiceNameservers') == "on";
  1125. }
  1126. /**
  1127. * @return string
  1128. */
  1129. public function getCiuser()
  1130. {
  1131. return $this->get('ciuser');
  1132. }
  1133. public function getSearchdomain()
  1134. {
  1135. return $this->get('searchdomain');
  1136. }
  1137. public function isRandomHostname()
  1138. {
  1139. return $this->get('randomHostname') == "on";
  1140. }
  1141. public function isUnprivileged()
  1142. {
  1143. return $this->get('unprivileged') == "on";
  1144. }
  1145. public function isIpsetIpFilter()
  1146. {
  1147. return $this->get("ipsetIpFilter") == "on";
  1148. }
  1149. public function getBootOrder()
  1150. {
  1151. $boot = [];
  1152. if ($this->getBootDevice1())
  1153. {
  1154. $boot[] = $this->getBootDevice1();
  1155. }
  1156. if ($this->getBootDevice2())
  1157. {
  1158. $boot[] = $this->getBootDevice2();
  1159. }
  1160. if ($this->getBootDevice3())
  1161. {
  1162. $boot[] = $this->getBootDevice3();
  1163. }
  1164. return implode("", $boot);
  1165. }
  1166. public function isOneNetworkDevice()
  1167. {
  1168. return $this->get("oneNetworkDevice") == "on";
  1169. }
  1170. public function getCpu()
  1171. {
  1172. return $this->get("cpu");
  1173. }
  1174. public function getSuspensionAction()
  1175. {
  1176. return $this->get("suspensionAction");
  1177. }
  1178. public function isSuspendOnBandwidthOverage()
  1179. {
  1180. return $this->get("suspendOnBandwidthOverage") == "on";
  1181. }
  1182. public function isStart()
  1183. {
  1184. return $this->get("start") == "on";
  1185. }
  1186. /**
  1187. * @return array
  1188. */
  1189. public function getTags()
  1190. {
  1191. return $this->get("tags");
  1192. }
  1193. public function getCicustom()
  1194. {
  1195. return $this->get('cicustom');
  1196. }
  1197. /**
  1198. * @return bool
  1199. */
  1200. public function isPermissionSshkeys()
  1201. {
  1202. return $this->get("permissionSshkeys") == "on";
  1203. }
  1204. public function isPermissionSnapshotJob()
  1205. {
  1206. return $this->get("permissionSnapshotJob") == "on";
  1207. }
  1208. public function getPermissionSnapshotJobPeriod()
  1209. {
  1210. return $this->get("permissionSnapshotJobPeriod");
  1211. }
  1212. public function getSnapshotJobs()
  1213. {
  1214. return $this->get("snapshotJobs");
  1215. }
  1216. public function isAgentTemplateUser()
  1217. {
  1218. return $this->get('agentTemplateUser') == "on";
  1219. }
  1220. public function isAgentServicePassword()
  1221. {
  1222. return $this->get('agentServicePassword') == "on";
  1223. }
  1224. public function isAgentConfigureNetwork()
  1225. {
  1226. return $this->get('agentConfigureNetwork') == "on";
  1227. }
  1228. /**
  1229. * @return bool
  1230. */
  1231. public function isCloneOnTheSameStorage()
  1232. {
  1233. return $this->get('cloneOnTheSameStorage') == "on";
  1234. }
  1235. public function isFeatureKeyctl()
  1236. {
  1237. return $this->get('featureKeyctl') == "on";
  1238. }
  1239. public function isFeatureNesting()
  1240. {
  1241. return $this->get('featureNesting') == "on";
  1242. }
  1243. public function isFeatureNfs()
  1244. {
  1245. return $this->get('featureNfs') == "on";
  1246. }
  1247. public function isFeatureCifs()
  1248. {
  1249. return $this->get('featureCifs') == "on";
  1250. }
  1251. public function isFeatureFuse()
  1252. {
  1253. return $this->get('featureFuse') == "on";
  1254. }
  1255. public function isFeatureMknod()
  1256. {
  1257. return $this->get('featureMknod') == "on";
  1258. }
  1259. public function hasCpuFlags(){
  1260. $configFlags =['md-clear', "pcid", "spec-ctrl", "ssbd", "ibpb", "virt-ssbd",
  1261. "amd-ssbd", "amd-no-ssb", "pdpe1gb", "hv-tlbflush","hv-evmcs", "aes" ];
  1262. foreach ($configFlags as $configFlag) {
  1263. if($this->get($configFlag)=="on"){
  1264. return true;
  1265. }
  1266. }
  1267. return false;
  1268. }
  1269. public function getCpuFlagsAsSource(){
  1270. $configFlags =['md-clear', "pcid", "spec-ctrl", "ssbd", "ibpb", "virt-ssbd",
  1271. "amd-ssbd", "amd-no-ssb", "pdpe1gb", "hv-tlbflush","hv-evmcs", "aes" ];
  1272. $cpuFlags=[];
  1273. foreach ($configFlags as $configFlag) {
  1274. if($this->get($configFlag)=="on"){
  1275. $cpuFlags[] = "+". $configFlag;
  1276. }
  1277. }
  1278. return implode(";", $cpuFlags);
  1279. }
  1280. public function isSsd()
  1281. {
  1282. return $this->get('ssd') == "on";
  1283. }
  1284. public function isAdditionalDiskSsd()
  1285. {
  1286. return $this->get('additionalDiskSsd') == "on";
  1287. }
  1288. public function isPrivateNetwork()
  1289. {
  1290. return $this->get("privateNetwork") == "on";;
  1291. }
  1292. /**
  1293. * @return array
  1294. */
  1295. public function getPermissionFirewalOptions()
  1296. {
  1297. return (array) $this->get("permissionFirewalOptions");
  1298. }
  1299. public function isFirewalOptionEnable()
  1300. {
  1301. return $this->get("firewalOptionEnable") == "on";
  1302. }
  1303. public function isFirewalOptionNdp()
  1304. {
  1305. return $this->get("firewalOptionNdp") == "on";
  1306. }
  1307. public function isFirewalOptionMacfilter()
  1308. {
  1309. return $this->get("firewalOptionMacfilter") == "on";
  1310. }
  1311. public function isFirewalOptionDhcp()
  1312. {
  1313. return $this->get("firewalOptionDhcp") == "on";
  1314. }
  1315. public function isFirewalOptionRadv()
  1316. {
  1317. return $this->get("firewalOptionRadv") == "on";
  1318. }
  1319. public function isFirewalOptionIpfilter()
  1320. {
  1321. return $this->get("firewalOptionIpfilter") == "on";
  1322. }
  1323. public function getBwLimit(){
  1324. return $this->get('bwlimit');
  1325. }
  1326. public function getBios(){
  1327. return $this->get('bios');
  1328. }
  1329. public function isAdditionalDisk(){
  1330. return $this->get('additionalDisk')=='on';
  1331. }
  1332. public function isMountPoint(){
  1333. return $this->get('mountPoint')=='on';
  1334. }
  1335. public function getCloudInitScript(){
  1336. return $this->get('cloudInitScript');
  1337. }
  1338. public function getMachine(){
  1339. return $this->get('machine');
  1340. }
  1341. }