| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?php
- /* * ********************************************************************
- * ProxmoxAddon product developed. (Nov 8, 2018)
- * *
- *
- * 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 MGProvision\Proxmox\v2\models;
- /**
- * Description of Agent
- *
- * @author Pawel Kopec <pawelk@modulesgardne.com>
- */
- class Agent extends AbstractObject
- {
- protected $path;
- public function getPath()
- {
- return $this->path;
- }
- public function setPath($path)
- {
- $this->path = $path;
- return $this;
- }
- public function fsfreezeFreeze()
- {
- return $this->api()->post($this->getPath() . '/fsfreeze-freeze');
- }
- public function fsfreezeStatus()
- {
- return $this->api()->post($this->getPath() . '/fsfreeze-status');
- }
- public function fsfreezeThaw()
- {
- return $this->api()->post($this->getPath() . '/fsfreeze-thaw');
- }
- public function fstrim()
- {
- return $this->api()->post($this->getPath() . '/fstrim');
- }
- public function getFsinfo()
- {
- return $this->api()->get($this->getPath() . '/get-fsinfo');
- }
- public function getHostname()
- {
- return $this->api()->get($this->getPath() . '/get-host-name');
- }
- public function getMemoryBlockInfo()
- {
- return $this->api()->get($this->getPath() . '/get-memory-block-info');
- }
- public function getMemoryBlocks()
- {
- return $this->api()->get($this->getPath() . '/get-memory-blocks');
- }
- public function getOsinfo()
- {
- return $this->api()->get($this->getPath() . '/get-osinfo');
- }
- public function getIime()
- {
- return $this->api()->get($this->getPath() . '/get-time');
- }
- public function getIimezone()
- {
- return $this->api()->get($this->getPath() . '/get-timezone');
- }
- public function getUsers()
- {
- return $this->api()->get($this->getPath() . '/get-users');
- }
- public function getVcpus()
- {
- return $this->api()->get($this->getPath() . '/get-vcpus');
- }
- public function info()
- {
- return $this->api()->get($this->getPath() . '/info');
- }
- public function networkGetInterfaces()
- {
- return $this->api()->get($this->getPath() . '/network-get-interfaces');
- }
- public function ping()
- {
- return $this->api()->post($this->getPath() . '/ping');
- }
- public function shutdown()
- {
- return $this->api()->post($this->getPath() . '/shutdown');
- }
- public function suspendDisk()
- {
- return $this->api()->post($this->getPath() . '/suspend-disk');
- }
- public function suspendHybrid()
- {
- return $this->api()->post($this->getPath() . '/suspend-hybrid');
- }
- public function suspendRam()
- {
- return $this->api()->post($this->getPath() . '/suspend-ram');
- }
- /**
- * @param $command| The command as a list of program + arguments
- * @return array|bool
- */
- public function exec($command){
- return $this->api()->post($this->getPath() . '/exec', ['command' => $command]);
- }
- public function setUserPassword($username, $password, $crypted=null){
- $parameters = ['username' => $username, "password" => $password ];
- if(is_bool($crypted)){
- $parameters['crypted'] = $crypted;
- }
- return $this->api()->post($this->getPath() . '/set-user-password', $parameters);
- }
- }
|