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 */ 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); } }