| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696 |
- <?php
- /* * ********************************************************************
- * ProxmoxVPS product developed. (2019-09-06)
- * *
- *
- * CREATED BY MODULESGARDEN -> http://modulesgarden.com
- * CONTACT -> contact@modulesgarden.com
- *
- *
- * This software is furnished under a license and may be used and copied
- * only in accordance with the terms of such license and with the
- * inclusion of the above copyright notice. This software or any other
- * copies thereof may not be provided or otherwise made available to any
- * other person. No title to and ownership of the software is hereby
- * transferred.
- *
- *
- * ******************************************************************** */
- namespace ModulesGarden\ProxmoxAddon\App\Repositories\Cloud;
- use ModulesGarden\ProxmoxAddon\App\Repositories\AbstractProductConfigurationRepository;
- /**
- * Description of ProductConfigurationRepository
- * @author Pawel Kopec <pawelk@modulesgarden.com>
- * @version 1.0.0
- * @property $serverSockets
- * @property $serverCores
- * @property $serverVcpus
- * @property $serverCpulimit
- * @property $serverCpuunit
- * @property $serverMemory
- * @property $serverDiskSize
- * @property $serverIpv4
- * @property $serverIpv6
- * @property $serverSwap
- * @property $cpuunitsPriority1
- * @property $cpulimitPriority1
- */
- class ProductConfigurationRepository extends AbstractProductConfigurationRepository
- {
- public function isDebug()
- {
- return $this->get("debugMode") == "on";
- }
- public function getVirtualization()
- {
- return $this->get("virtualization", 'qemu');
- }
- public function isQemu()
- {
- return $this->getVirtualization() == "qemu";
- }
- public function isLxc()
- {
- return $this->getVirtualization() == "lxc";
- }
- public function getDefaultNode()
- {
- return $this->get("defaultNode");
- }
- public function isCheckResources()
- {
- return $this->get('checkResources') == "on";
- }
- public function isBackupVmBeforeReinstall()
- {
- return $this->get('backupVmBeforeReinstall') == "on";
- }
- public function isRebootVmAfterChangePackage()
- {
- return $this->get('rebootVmAfterChangePackage') == "on";
- }
- public function isDeleteBackups()
- {
- return $this->get('deleteBackups') == "on";
- }
- public function isServerNameservers()
- {
- return $this->get('serverNameservers') == "on";
- }
- public function getConsoleHost()
- {
- return $this->get("consoleHost");
- }
- public function getUserPrefix()
- {
- return $this->get("userPrefix");
- }
- public function getRealm()
- {
- return $this->get("realm", "pve");
- }
- public function getUserComment()
- {
- return $this->get("userComment");
- }
- public function getUserRole()
- {
- return $this->get("userRole");
- }
- public function getWelcomeEmailTemplateId()
- {
- return $this->get("welcomeEmailTemplateId");
- }
- public function getReinstallEmailTemplateId()
- {
- return $this->get("reinstallEmailTemplateId");
- }
- public function getServiceCreationFailedTemplateId()
- {
- return $this->get("serviceCreationFailedTemplateId");
- }
- public function getUpgradeNotificationTemplateId()
- {
- return $this->get("upgradeNotificationTemplateId");
- }
- public function isToDoList()
- {
- return $this->get("toDoList") == "on";
- }
- public function getCmode()
- {
- return $this->get("cmode") == "on";
- }
- public function getOsType()
- {
- return $this->get("ostype");
- }
- public function getPool()
- {
- return $this->get("pool");
- }
- public function getDescription()
- {
- return $this->get("description");
- }
- public function getTty()
- {
- return $this->get("tty");
- }
- public function isSshKeyPairs()
- {
- return $this->get("sshKeyPairs") == "on";
- }
- public function getArch()
- {
- return $this->get("arch");
- }
- public function isConsole()
- {
- return $this->get("console") == "on";
- }
- public function isOnboot()
- {
- return $this->get("onboot") == "on";
- }
- public function isProtection()
- {
- return $this->get("protection") == "on";
- }
- public function isStartup()
- {
- return $this->get("startup") == "on";
- }
- public function isSshDeletePrivateKey()
- {
- return $this->get("sshDeletePrivateKey") == "on";
- }
- public function getOsTemplate()
- {
- return $this->get("osTemplate");
- }
- public function getCpuunits()
- {
- return $this->get("cpuunits");
- }
- /**
- * @return int
- */
- public function getMemory()
- {
- return $this->get("memory");
- }
- /**
- * @return int
- */
- public function getProductId()
- {
- return $this->productId;
- }
- /**
- * @return int
- */
- public function getStorageSize()
- {
- return $this->get("storageSize");
- }
- /**
- * @return int
- * @deprecated
- */
- public function getAdditionalDiskSize()
- {
- return $this->get("additionalDiskSize");
- }
- /**
- * @return int
- */
- public function getMinimumRate()
- {
- return $this->get("minimumRate");
- }
- /**
- * @return int
- */
- public function getIpv4()
- {
- return $this->get("ipv4");
- }
- /**
- * @return int
- */
- public function getIpv6()
- {
- return $this->get("ipv6");
- }
- /**
- * @return int
- */
- public function getBackupMaxFiles()
- {
- return $this->get("backupMaxFiles");
- }
- /**
- * @return int
- */
- public function getCpulimit()
- {
- return $this->get("cpulimit");
- }
- /**
- * @return int
- */
- public function getCores()
- {
- return $this->get("cores");
- }
- /**
- * @return int
- */
- public function getSwap()
- {
- return $this->get("swap");
- }
- /**
- * @return int
- */
- public function getRate()
- {
- return $this->get("rate");
- }
- /**
- * @return int
- */
- public function getBackupMaxSize()
- {
- return $this->get("backupMaxSize");
- }
- /**
- * @return int
- */
- public function getBandwidth()
- {
- return $this->get("bandwidth");
- }
- /**
- * @return int
- */
- public function getSnapshotMaxFiles()
- {
- return $this->get("snapshotMaxFiles");
- }
- /**
- * @return int
- */
- public function getMountPointStorage()
- {
- return $this->get("mountPointStorage");
- }
- /**
- * @return int
- */
- public function isMountPointRo()
- {
- return $this->get("mountPointRo") == "on";
- }
- /**
- * @return int
- */
- public function isReplicate()
- {
- return $this->get("replicate") == "on";
- }
- /**
- * @return int
- */
- public function getMountPointAcl()
- {
- return $this->get("mountPointAcl");
- }
- /**
- * @return int
- */
- public function isMountPointQuota()
- {
- return $this->get("mountPointQuota") == "on";
- }
- /**
- * @return string
- */
- public function getIpv4NetworkMode()
- {
- return $this->get("ipv4NetworkMode");
- }
- /**
- * @return string
- */
- public function getIpv6NetworkMode()
- {
- return $this->get("ipv6NetworkMode");
- }
- /**
- * @return string
- */
- public function getPrivateBridge()
- {
- return $this->get("privateBridge");
- }
- /**
- * @return string
- */
- public function getBridge()
- {
- return $this->get("bridge");
- }
- /**
- * @return boolean
- */
- public function isNetworkFirewall()
- {
- return $this->get("networkFirewall") == "on";
- }
- /**
- * @return int
- */
- public function getTagFrom()
- {
- return $this->get("tagFrom");
- }
- /**
- * @return int
- */
- public function getTagTo()
- {
- return $this->get("tagTo");
- }
- /**
- * @return string
- */
- public function getSwapUnit()
- {
- return $this->get("swapUnit", "mb");
- }
- /**
- * @return string
- */
- public function getStorageUnit()
- {
- return $this->get("storageUnit", "gb");
- }
- /**
- * @return string
- */
- public function getMemoryUnit()
- {
- return $this->get("memoryUnit", "mb");
- }
- /**
- * @return string
- */
- public function getAdditionalDiskUnit()
- {
- return $this->get("additionalDiskUnit", "gb");
- }
- /**
- * @return array
- */
- public function getFirewallInterfaces()
- {
- return $this->get("firewallInterfaces");
- }
- /**
- * @return int
- */
- public function getFirewallMaxRules()
- {
- return $this->get("firewallMaxRules");
- }
- /**
- * @return bool
- */
- public function isLoadBalancer()
- {
- return $this->get("loadBalancer") == "on";
- }
- /**
- * @return bool
- */
- public function isLoadBalancerShutdownOnUpgrade()
- {
- return $this->get("loadBalancerShutdownOnUpgrade") == "on";
- }
- /**
- * @return string
- */
- public function getLoadBalancerOnUpgrade()
- {
- return $this->get("loadBalancerOnUpgrade");
- }
- /**
- * @return bool
- */
- public function isLoadBalancerStopOnUpgrade()
- {
- return $this->get("loadBalancerStopOnUpgrade") == "on";
- }
- /**
- * @return string
- */
- public function getBackupStorage()
- {
- return $this->get("backupStorage");
- }
- /**
- * @return bool
- */
- public function isBackupRouting()
- {
- return $this->get("backupRouting") == "on";
- }
- /**
- * @return int
- */
- public function getBackupStoreDays()
- {
- return $this->get("backupStoreDays");
- }
- /**
- * @return string
- */
- public function getClusterState()
- {
- return $this->get("clusterState");
- }
- /**
- * @return int
- */
- public function getClusterMaxRestart()
- {
- return $this->get("clusterMaxRestart");
- }
- /**
- * @return string
- */
- public function getClusterGroup()
- {
- return $this->get("clusterGroup");
- }
- /**
- * @return int
- */
- public function getClusterMaxRelocate()
- {
- return $this->get("clusterMaxRelocate");
- }
- /**
- * @return bool
- */
- public function isPermissionStart()
- {
- return $this->get("permissionStart") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionStop()
- {
- return $this->get("permissionStop") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionNovnc()
- {
- return $this->get("permissionNovnc") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionXtermjs()
- {
- return $this->get("permissionXtermjs") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionOsTemplate()
- {
- return $this->get("permissionOsTemplate") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionIsoImage()
- {
- return $this->get("permissionIsoImage") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionGraph()
- {
- return $this->get("permissionGraph") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionBackupJob()
- {
- return $this->get("permissionBackupJob") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionNetwork()
- {
- return $this->get("permissionNetwork") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionFirewall()
- {
- return $this->get("permissionFirewall") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionDisk()
- {
- return $this->get("permissionDisk") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionReboot()
- {
- return $this->get("permissionReboot") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionShutdown()
- {
- return $this->get("permissionShutdown") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionSpice()
- {
- return $this->get("permissionSpice") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionReinstall()
- {
- return $this->get("permissionReinstall") == "on";
- }
- /**
- * @return array
- */
- public function getPermissionOsTemplates()
- {
- return $this->get("permissionOsTemplates");
- }
- public function isPermissionOsTemplates()
- {
- return !empty($this->get("permissionOsTemplates"));
- }
- /**
- * @return bool
- */
- public function isPermissionBackup()
- {
- return $this->get("permissionBackup") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionTaskHistory()
- {
- return $this->get("permissionTaskHistory") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionSnapshot()
- {
- return $this->get("permissionSnapshot") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionFirewallOption()
- {
- return $this->get("permissionFirewallOption") == "on";
- }
- public function getNetworkModel()
- {
- return $this->get("networkModel");
- }
- public function getNetworkPrivateModel()
- {
- return $this->get("networkPrivateModel");
- }
- public function isCloudInit()
- {
- return $this->get("cloudInit") == "on";
- }
- /**
- * @return int
- */
- public function getAdditionalDiskMbpsRd()
- {
- return $this->get("additionalDiskMbps_rd");
- }
- /**
- * @return int
- */
- public function getAdditionalDiskIopsRd()
- {
- return $this->get("additionalDiskIops_rd");
- }
- /**
- * @return int
- */
- public function getAdditionalDiskIopsWr()
- {
- return $this->get("additionalDiskIops_wr");
- }
- /**
- * @return int
- */
- public function getAdditionalDiskMbpsWr()
- {
- return $this->get("additionalDiskMbps_wr");
- }
- /**
- * @return int
- */
- public function getAdditionalDiskIopsRdMax()
- {
- return $this->get("additionalDiskIops_rd_max");
- }
- /**
- * @return int
- */
- public function getAdditionalDiskIopsWrMax()
- {
- return $this->get("additionalDiskIops_wr_max");
- }
- /**
- * @return string
- */
- public function getAdditionalDiskStorage()
- {
- return $this->get("additionalDiskStorage");
- }
- /**
- * @return string
- */
- public function getAdditionalDiskFormat()
- {
- return $this->get("additionalDiskFormat");
- }
- /**
- * @return string
- */
- public function getAdditionalDiskCache()
- {
- return $this->get("additionalDiskCache");
- }
- /**
- * @return bool
- */
- public function isAdditionalDiskIoThread()
- {
- return $this->get("additionalDiskIoThread") == "on";
- }
- /**
- * @return string
- */
- public function getAdditionalDiskType()
- {
- return $this->get("additionalDiskType");
- }
- /**
- * @return bool
- */
- public function isAdditionalDiskReplicate()
- {
- return $this->get("additionalDiskReplicate") == "on";
- }
- /**
- * @return bool
- */
- public function isAdditionalDiskDiscard()
- {
- return $this->get("additionalDiskDiscard") == "on";
- }
- /**
- * @return bool
- */
- public function isPermissionAdditionalDiskBackup()
- {
- return $this->get("permissionAdditionalDiskBackup") == "on";
- }
- public function isPermissionMountPointBackup()
- {
- return $this->get("permissionMountPointBackup") == "on";
- }
- public function isMountPointReplicate()
- {
- return $this->get("mountPointReplicate") == "on";
- }
- public function isOsTemplatesInAllNodes()
- {
- return $this->get("osTemplatesInAllNodes") == "on";
- }
- public function getPermissionIsoImages()
- {
- return $this->get("permissionIsoImages");
- }
- public function isPermissionIsoImages()
- {
- return !empty($this->get("permissionIsoImages"));
- }
- public function getPermissionSecondaryIsoImages()
- {
- return $this->get("permissionSecondaryIsoImages");
- }
- public function isPermissionSecondaryIsoImages()
- {
- return !empty($this->get("permissionSecondaryIsoImages"));
- }
- public function getStorage()
- {
- return $this->get("storage");
- }
- /**
- * @return bool
- */
- public function isAgent()
- {
- return $this->get('agent') == "on";
- }
- /**
- * @return string
- */
- public function getCdrom()
- {
- return $this->get('cdrom');
- }
- /**
- * @return bool
- */
- public function isNuma()
- {
- return $this->get('numa') == "on";
- }
- /**
- * @return bool
- */
- public function isSpec()
- {
- return $this->get('spec') == "on";
- }
- /**
- * @return bool
- */
- public function isFreeze()
- {
- return $this->get('freeze') == "on";
- }
- /**
- * @return string
- */
- public function getKeyboard()
- {
- return $this->get('keyboard');
- }
- /**
- * @return string
- */
- public function getVga()
- {
- return $this->get('vga');
- }
- public function getVgaMemory()
- {
- return $this->get('vgaMemory');
- }
- /**
- * @return string
- */
- public function getClientNameForContainer()
- {
- return $this->get('clientNameForContainer');
- }
- /**
- * @return bool
- */
- public function isAcpi()
- {
- return $this->get('acpi') == "on";
- }
- /**
- * @return bool
- */
- public function isAutostart()
- {
- return $this->get('autostart') == "on";
- }
- /**
- * @return bool
- */
- public function isPcid()
- {
- return $this->get('pcid') == "on";
- }
- /**
- * @return bool
- */
- public function getHotplug()
- {
- return implode(",",$this->get('hotplug')) ;
- }
- /**
- * @return bool
- */
- public function isKvm()
- {
- return $this->get('kvm') == "on";
- }
- /**
- * @return bool
- */
- public function isReboot()
- {
- return $this->get('reboot') == "on";
- }
- /**
- * @return bool
- */
- public function isTablet()
- {
- return $this->get('tablet') == "on";
- }
- /**
- * @return string
- */
- public function getCloneMode()
- {
- return $this->get('cloneMode');
- }
- /**
- * @return string
- */
- public function getBalloon()
- {
- return $this->get('balloon');
- }
- /**
- * @return string
- */
- public function getArgs()
- {
- return $this->get('args');
- }
- /**
- * @return string
- */
- public function getMigrateSpeed()
- {
- return $this->get('migrate_speed');
- }
- /**
- * @return string
- */
- public function getMigrateDowntime()
- {
- return $this->get('migrate_downtime');
- }
- /**
- * @return string
- */
- public function getStartdate()
- {
- return $this->get('startdate');
- }
- /**
- * @return string
- */
- public function getShares()
- {
- return $this->get('shares');
- }
- /**
- * @return bool
- */
- public function isLocaltime()
- {
- return $this->get('localtime') == "on";
- }
- /**
- * @return string
- */
- public function getWatchdog()
- {
- return $this->get('watchdog');
- }
- /**
- * @return string
- */
- public function getStartup()
- {
- return $this->get('startup');
- }
- /**
- * @return bool
- */
- public function isTdf()
- {
- return $this->get('tdf') == "on";
- }
- /**
- * @return string
- */
- public function getSockets()
- {
- return $this->get('sockets');
- }
- /**
- * @return string
- */
- public function getVcpus()
- {
- return $this->get('vcpus');
- }
- /**
- * @return string
- */
- public function getIsoImage()
- {
- return $this->get('isoImage');
- }
- public function getCdromType()
- {
- return $this->get('cdromType');
- }
- /**
- * @return string
- */
- public function getDiskStorage()
- {
- return $this->get('diskStorage');
- }
- /**
- * @return string
- */
- public function getDiskFormat()
- {
- return $this->get('diskFormat');
- }
- /**
- * @return string
- */
- public function getScsihw()
- {
- return $this->get('scsihw');
- }
- /**
- * @return string
- */
- public function getDiskType()
- {
- return $this->get('diskType');
- }
- /**
- * @return string
- */
- public function getDiskCache()
- {
- return $this->get('diskCache');
- }
- /**
- * @return bool
- */
- public function isDiscard()
- {
- return $this->get('discard') == "on";
- }
- /**
- * @return bool
- */
- public function isIoThread()
- {
- return $this->get('ioThread') == "on";
- }
- /**
- * @return string
- */
- public function getMbpsRd()
- {
- return $this->get('mbps_rd');
- }
- /**
- * @return string
- */
- public function getIopsRd()
- {
- return $this->get('iops_rd');
- }
- /**
- * @return string
- */
- public function getIopsWr()
- {
- return $this->get('iops_wr');
- }
- /**
- * @return string
- */
- public function getMbpsWr()
- {
- return $this->get('mbps_wr');
- }
- /**
- * @return string
- */
- public function getIopsRdMax()
- {
- return $this->get('iops_rd_max');
- }
- /**
- * @return string
- */
- public function getIopsWrMax()
- {
- return $this->get('iops_wr_max');
- }
- /**
- * @return bool
- */
- public function isEtworkOneDevice()
- {
- return $this->get('etworkOneDevice') == "on";
- }
- /**
- * @return string
- */
- public function getQueues()
- {
- return $this->get('queues');
- }
- /**
- * @return string
- */
- public function getBootDevice1()
- {
- return $this->get('bootDevice1');
- }
- /**
- * @return string
- */
- public function getBootDevice2()
- {
- return $this->get('bootDevice2');
- }
- /**
- * @return string
- */
- public function getBootDevice3()
- {
- return $this->get('bootDevice3');
- }
- /**
- * @return string
- */
- public function getBootdisk()
- {
- return $this->get('bootdisk');
- }
- /**
- * @return bool
- */
- public function isCloudInitServicePassword()
- {
- return $this->get('cloudInitServicePassword') == "on";
- }
- /**
- * @return bool
- */
- public function isCloudInitServiceUsername()
- {
- return $this->get('cloudInitServiceUsername') == "on";
- }
- /**
- * @return bool
- */
- public function isCloudInitServiceNameservers()
- {
- return $this->get('cloudInitServiceNameservers') == "on";
- }
- /**
- * @return string
- */
- public function getCiuser()
- {
- return $this->get('ciuser');
- }
- public function getSearchdomain()
- {
- return $this->get('searchdomain');
- }
- public function isRandomHostname()
- {
- return $this->get('randomHostname') == "on";
- }
- public function isUnprivileged()
- {
- return $this->get('unprivileged') == "on";
- }
- public function isIpsetIpFilter()
- {
- return $this->get("ipsetIpFilter") == "on";
- }
- public function getBootOrder()
- {
- $boot = [];
- if ($this->getBootDevice1())
- {
- $boot[] = $this->getBootDevice1();
- }
- if ($this->getBootDevice2())
- {
- $boot[] = $this->getBootDevice2();
- }
- if ($this->getBootDevice3())
- {
- $boot[] = $this->getBootDevice3();
- }
- return implode("", $boot);
- }
- public function isOneNetworkDevice()
- {
- return $this->get("oneNetworkDevice") == "on";
- }
- public function getCpu()
- {
- return $this->get("cpu");
- }
- public function getSuspensionAction()
- {
- return $this->get("suspensionAction");
- }
- public function isSuspendOnBandwidthOverage()
- {
- return $this->get("suspendOnBandwidthOverage") == "on";
- }
- public function isStart()
- {
- return $this->get("start") == "on";
- }
- /**
- * @return array
- */
- public function getTags()
- {
- return $this->get("tags");
- }
- public function getCicustom()
- {
- return $this->get('cicustom');
- }
- /**
- * @return bool
- */
- public function isPermissionSshkeys()
- {
- return $this->get("permissionSshkeys") == "on";
- }
- public function isPermissionSnapshotJob()
- {
- return $this->get("permissionSnapshotJob") == "on";
- }
- public function getPermissionSnapshotJobPeriod()
- {
- return $this->get("permissionSnapshotJobPeriod");
- }
- public function getSnapshotJobs()
- {
- return $this->get("snapshotJobs");
- }
- public function isAgentTemplateUser()
- {
- return $this->get('agentTemplateUser') == "on";
- }
- public function isAgentPassword()
- {
- return $this->get('agentPassword') == "on";
- }
- public function isAgentConfigureNetwork()
- {
- return $this->get('agentConfigureNetwork') == "on";
- }
- /**
- * @return bool
- */
- public function isCloneOnTheSameStorage()
- {
- return $this->get('cloneOnTheSameStorage') == "on";
- }
- public function isFeatureKeyctl()
- {
- return $this->get('featureKeyctl') == "on";
- }
- public function isFeatureNesting()
- {
- return $this->get('featureNesting') == "on";
- }
- public function isFeatureNfs()
- {
- return $this->get('featureNfs') == "on";
- }
- public function isFeatureCifs()
- {
- return $this->get('featureCifs') == "on";
- }
- public function isFeatureFuse()
- {
- return $this->get('featureFuse') == "on";
- }
- public function isFeatureMknod()
- {
- return $this->get('featureMknod') == "on";
- }
- public function hasCpuFlags(){
- $configFlags =['md-clear', "pcid", "spec-ctrl", "ssbd", "ibpb", "virt-ssbd",
- "amd-ssbd", "amd-no-ssb", "pdpe1gb", "hv-tlbflush","hv-evmcs", "aes" ];
- foreach ($configFlags as $configFlag) {
- if($this->get($configFlag)=="on"){
- return true;
- }
- }
- return false;
- }
- public function getCpuFlagsAsSource(){
- $configFlags =['md-clear', "pcid", "spec-ctrl", "ssbd", "ibpb", "virt-ssbd",
- "amd-ssbd", "amd-no-ssb", "pdpe1gb", "hv-tlbflush","hv-evmcs", "aes" ];
- $cpuFlags=[];
- foreach ($configFlags as $configFlag) {
- if($this->get($configFlag)=="on"){
- $cpuFlags[] = "+". $configFlag;
- }
- }
- return implode(";", $cpuFlags);
- }
- public function isSsd()
- {
- return $this->get('ssd') == "on";
- }
- public function isAdditionalDiskSsd()
- {
- return $this->get('additionalDiskSsd') == "on";
- }
- /**
- * @return array
- */
- public function getPermissionFirewalOptions()
- {
- return (array) $this->get("permissionFirewalOptions");
- }
- public function isFirewalOptionEnable()
- {
- return $this->get("firewalOptionEnable") == "on";
- }
- public function isFirewalOptionNdp()
- {
- return $this->get("firewalOptionNdp") == "on";
- }
- public function isFirewalOptionMacfilter()
- {
- return $this->get("firewalOptionMacfilter") == "on";
- }
- public function isFirewalOptionDhcp()
- {
- return $this->get("firewalOptionDhcp") == "on";
- }
- public function isFirewalOptionRadv()
- {
- return $this->get("firewalOptionRadv") == "on";
- }
- public function isFirewalOptionIpfilter()
- {
- return $this->get("firewalOptionIpfilter") == "on";
- }
- public function getBwLimit(){
- return $this->get('bwlimit');
- }
- public function getBios(){
- return $this->get('bios');
- }
- public function isPermissionVirtualNetwork()
- {
- return $this->get("permissionVirtualNetwork") == "on";
- }
- public function getLocations()
- {
- return $this->get("locations");
- }
- public function getPermissionOstype()
- {
- return $this->get("permissionOstype");
- }
- public function isPermissionUsername()
- {
- return $this->get("permissionUsername") == "on";
- }
- public function isPermissionPassword()
- {
- return $this->get("permissionPassword") == "on";
- }
- public function isPermissionNameservers()
- {
- return $this->get("permissionNameservers") == "on";
- }
- public function isPermissionSearchdomain()
- {
- return $this->get("permissionSearchdomain") == "on";
- }
- public function isPermissionIpv4()
- {
- return $this->get("permissionIpv4") == "on";
- }
- public function isPermissionIpv6()
- {
- return $this->get("permissionIpv6") == "on";
- }
- public function isPermissionSockets()
- {
- return $this->get("permissionSockets") == "on";
- }
- public function isPermissionCores()
- {
- return $this->get("permissionCores") == "on";
- }
- public function isPermissionVcpus()
- {
- return $this->get("permissionVcpus") == "on";
- }
- public function isPermissionCpuLimit()
- {
- return $this->get("permissionCpuLimit") == "on";
- }
- public function isPermissionCpuunits()
- {
- return $this->get("permissionCpuunits") == "on";
- }
- public function isPermissionSwap()
- {
- return $this->get("permissionSwap") == "on";
- }
- public function __get($name)
- {
- if(preg_match("/server/", $name)){
- $data = new \stdClass();
- $data->min = 0;
- $data->max = 0;
- $value = $this->get($name);
- if(is_null($value)){
- return $data;
- }
- list($data->min, $data->max) = explode("-", $this->get($name));
- return $data;
- }
- return $this->get($name);
- }
- public function getVirtualNetworks(){
- return $this->get('virtualNetworks');
- }
- public function getButtonSyle()
- {
- return $this->get("buttonSyle");
- }
- public function hasCpuPriority(){
- for($i=1; $i<=5; $i++) {
- if(empty($this->get('cpuunitsPriority'.$i))){
- return false;
- }
- if(empty($this->get('cpulimitPriority'. $i))){
- return false;
- }
- }
- return true;
- }
- public function isPermissionCustomTemplates(){
- return $this->get('permissionCustomTemplates')=='on';
- }
- public function isDetailsCombinedView()
- {
- return $this->get("detailsView")=='combined';
- }
- public function isCalculateSocketsAndCores()
- {
- return $this->get("calculateSocketsAndCores")=='on';
- }
- public function getCloudInitScript(){
- return $this->get('cloudInitScript');
- }
- public function getMachine(){
- return $this->get('machine');
- }
- }
|