From 6cf9fa77620502f9c2630ca427c5f008b67f6900 Mon Sep 17 00:00:00 2001 From: Daniele Corsini Date: Thu, 5 Oct 2017 08:27:00 +0200 Subject: [PATCH] Reimplemented result with dedicated class --- README.md | 77 +- src/Client.php | 3405 ++++++++++++++++++++++++++---------------------- 2 files changed, 1865 insertions(+), 1617 deletions(-) diff --git a/README.md b/README.md index f5f5b67..ae2684d 100644 --- a/README.md +++ b/README.md @@ -1,39 +1,67 @@ # eve2pve-api-php + ProxmoVE Client API PHP -General ------------- +[ProxmoxVE Api](https://pve.proxmox.com/pve-docs/api-viewer/) + +[Packagist](https://packagist.org/packages/enterpriseve/eve2pve-api-php) + +```text + ______ __ _ _ ________ + / ____/___ / /____ _________ _____(_)_______ | | / / ____/ + / __/ / __ \/ __/ _ \/ ___/ __ \/ ___/ / ___/ _ \ | | / / __/ + / /___/ / / / /_/ __/ / / /_/ / / / (__ ) __/ | |/ / /___ +/_____/_/ /_/\__/\___/_/ / .___/_/ /_/____/\___/ |___/_____/ + /_/ + + (Made in Italy) +``` + +## General + +The client is generated from a JSON Api on ProxmoxVE. This PHP 5.4+ library allows you to interact with your Proxmox server via API. The client is generated from a JSON Api on ProxmoxVE. -The result is a complete response from server. -[ProxmoxVE Api](https://pve.proxmox.com/pve-docs/api-viewer/) +## Result + +The result is class **Result** and contain methods: + +* **getResponse()** returned from ProxmoxVE (data,errors,...) Object/Array +* **responseInError** (bool) : Contains errors from ProxmoxVE. +* **getStatusCode()** (int) : Status code of the HTTP response. +* **getReasonPhrase()** (string): The reason phrase which typically is sent by servers together with the status code. +* **isSuccessStatusCode()** (bool) : Gets a value that indicates if the HTTP response was successful. +* **getError()** (string) : Get error. + +## Main features -Main features ------------- * Easy to learn * Method named * Full method generated from documentation * Comment any method and parameters * Parameters indexed eg [n] is structured in array index and value * Tree structure - * $client->getNodes()->get("pve1")->getQemu()->get(100)->getSnapshot()->snapshotList()->data + * $client->getNodes()->get("pve1")->getQemu()->get(100)->getSnapshot()->snapshotList()->getResponse()->data * Return data proxmox -* Method result status - * getReasonPhrase +* Return result status * getStatusCode + * getReasonPhrase + * isSuccessStatusCode +* Wait task finish task + * waitForTaskToFinish * Method directry access * get * post * put * delete -* login return bool if access -* return object/array data +* Login return bool if access +* Return Result class more information +* return object/array data * default object disable from client.setResultIsObject(false) -Installation ------------- +## Installation Recommended installation is using [Composer], if you do not have [Composer] what are you waiting? @@ -53,8 +81,7 @@ Or add this to your `composer.json` file: } ``` -Usage ------ +## Usage ```php login('root','password','pam')){ //get version from get method - var_dump($client->get('/version')); + var_dump($client->get('/version')->getResponse()); // $client->put // $client->post // $client->delete $retPippo=$client->get("/pippo"); - echo "\n" . $client->getStatusCode(); - echo "\n" . $client->getReasonPhrase(); + echo "\n" . $retPippo->getStatusCode(); + echo "\n" . $retPippo->getReasonPhrase(); //loop nodes - foreach ($client->getNodes()->Index()->data as $node) { + foreach ($client->getNodes()->Index()->getResponse()->data as $node) { echo "\n" . $node->id; } //loop vm - foreach ($client->getNodes()->get("pve1")->getQemu()->Vmlist()->data as $vm) { + foreach ($client->getNodes()->get("pve1")->getQemu()->Vmlist()->getResponse()->data as $vm) { echo "\n" . $vm->vmid ." - " .$vm->name; } //loop snapshots - foreach ($client->getNodes()->get("pve1")->getQemu()->get(100)->getSnapshot()->snapshotList()->data as $snap) { + foreach ($client->getNodes()->get("pve1")->getQemu()->get(100)->getSnapshot()->snapshotList()->getResponse()->data as $snap) { echo "\n" . $snap->name; } //return object - var_dump($client->getVersion()->version()); + var_dump($client->getVersion()->version()->getResponse()); //disable return object $client->setResultIsObject(false); //return array - $retArr = $client->getVersion()->version(); + $retArr = $client->getVersion()->version()->getResponse(); var_dump($retArr); echo "\n" . $retArr['data']['release']; @@ -112,7 +139,7 @@ Sample output version request: ```php //object result -var_dump($client->getVersion()->Version()); +var_dump($client->getVersion()->Version()->getResponse()); object(stdClass)#9 (1) { ["data"]=> @@ -156,4 +183,4 @@ The parameter indexed end with '[n]' in documentation (method createVM in Qemu p 1 => "....", 3 => "....", ] -``` \ No newline at end of file +``` diff --git a/src/Client.php b/src/Client.php index f1f51bd..ef18f07 100644 --- a/src/Client.php +++ b/src/Client.php @@ -5,6 +5,14 @@ abstract class Base { protected $client; + /** + * @return Client + */ + protected function getClient() + { + return $this->client; + } + protected function addIndexedParmeter(&$parms, $name, $values) { if ($values == null) { @@ -16,6 +24,97 @@ protected function addIndexedParmeter(&$parms, $name, $values) } } + /** + * Result request API + * @package EnterpriseVE\ProxmoxVE\Api + */ + class Result + { + private $reasonPhrase; + private $statusCode; + private $response; + private $resultIsObject; + + function __construct($response, $statusCode, $reasonPhrase, $resultIsObject) + { + $this->statusCode = $statusCode; + $this->reasonPhrase = $reasonPhrase; + $this->response = $response; + $this->resultIsObject = $resultIsObject; + } + + /** + * ProxmoxVE response. + * @return mixed + */ + function getResponse() + { + return $this->response; + } + + /** + * Contains the values of status codes defined for HTTP. + * @return int + */ + function getStatusCode() + { + return $this->statusCode; + } + + /** + * Gets the reason phrase which typically is sent by servers together with the status code. + * @return string + */ + function getReasonPhrase() + { + return $this->reasonPhrase; + } + + /** + * Gets a value that indicates if the HTTP response was successful. + * @return bool + */ + public function isSuccessStatusCode() + { + return $this->statusCode == 200; + } + + /** + * Get if response ProxmoxVE contain errors + * @return bool + */ + public function responseInError() + { + if ($this->resultIsObject) { + return $this->response->errors != null; + } else { + return array_key_exists('errors', $this->response); + } + } + + /** + * Get error + * @return string + */ + public function GetError() + { + $ret = ''; + if ($this->responseInError()) { + $ret .= ''; + if ($this->resultIsObject) { + foreach ($this->response->errors as $key => $value) { + $ret .= $key . " : " . $value; + } + } else { + foreach ($this->response->errors['errors'] as $key => $value) { + $ret .= $key . " : " . $value; + } + } + } + return ret; + } + } + /** * Class Client * @package EnterpriseVE\ProxmoxVE\Api @@ -28,8 +127,6 @@ class Client extends Base private $ticketPVEAuthCookie; private $hostName; private $port; - private $reasonPhrase; - private $statusCode; private $resultIsObject = true; function __construct($hostName, $port = 8006) @@ -39,16 +136,6 @@ function __construct($hostName, $port = 8006) $this->client = $this; } - function getReasonPhrase() - { - return $this->reasonPhrase; - } - - function getStatusCode() - { - return $this->statusCode; - } - function getResultIsObject() { return $this->resultIsObject; @@ -71,8 +158,8 @@ public function getPort() /** * Creation ticket from login. - * @param $userName user name or @ - * @param $password + * @param string $userName user name or @ + * @param string $password * @param string $realm pam/pve or custom * @return bool logged */ @@ -83,18 +170,16 @@ function login($userName, $password, $realm = "pam") $userName = $uData[0]; $realm = $uData[1]; } - $oldResultIsObject = $this->getResultIsObject(); $this->setResultIsObject(true); - $ticket = $this->getAccess() + $result = $this->getAccess() ->getTicket() ->createTicket($password, $userName, null, null, null, $realm); - $this->setResultIsObject($oldResultIsObject); - if ($ticket != null && $ticket->data != null) { - $this->ticketCSRFPreventionToken = $ticket->data->CSRFPreventionToken; - $this->ticketPVEAuthCookie = $ticket->data->ticket; + if ($result->isSuccessStatusCode()) { + $this->ticketCSRFPreventionToken = $result->getResponse()->data->CSRFPreventionToken; + $this->ticketPVEAuthCookie = $result->getResponse()->data->ticket; return true; } return false; @@ -123,9 +208,10 @@ public function delete($resource, $parms = []) private function executeAction($resource, $method, $parms = []) { $response = $this->requestResource($resource, $method, $parms); - $this->reasonPhrase = $response->getReasonPhrase(); - $this->statusCode = $response->getStatusCode(); - return $response->json(['object' => $this->resultIsObject]); + return new Result($response->json(['object' => $this->resultIsObject]), + $response->getStatusCode(), + $response->getReasonPhrase(), + $this->resultIsObject); } private function requestResource($resource, $method, $parms = []) @@ -177,6 +263,33 @@ private function requestResource($resource, $method, $parms = []) } } + /** + * Wait for task to finish + * @param string $node Node identifier + * @param string $task Task identifier + * @param int $wait Millisecond wait next check + * @param int $timeOut Millisecond timeout + */ + function waitForTaskToFinish($node, $task, $wait = 500, $timeOut = 10000) + { + $isRunning = true; + if ($wait <= 0) { + $wait = 500; + } + if ($timeOut < $wait) { + $timeOut = $wait + 5000; + } + $timeStart = time(); + $waitTime = time(); + while ($isRunning && ($timeStart - time()) < $timeOut) { + if ((time() - $waitTime) >= $wait) { + $waitTime = time(); + $isRunning = $this->getNodes()->get($node)->getTasks()-> + get($task)->getStatus()->readTaskStatus()->getResponse()->data == "running"; + } + } + } + private $cluster; public function getCluster() @@ -306,11 +419,11 @@ public function getNextid() /** * Cluster index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster"); + return $this->getClient()->get("/cluster"); } } @@ -328,25 +441,26 @@ public function get($id) /** * List replication jobs. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/replication"); + return $this->getClient()->get("/cluster/replication"); } /** * Create a new replication job - * @param $id Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '&lt;GUEST&gt;-&lt;JOBNUM&gt;'. - * @param $target Target node. - * @param $type Section type. + * @param string $id Replication Job ID. The ID is composed of a Guest ID and a job number, separated by a hyphen, i.e. '&lt;GUEST&gt;-&lt;JOBNUM&gt;'. + * @param string $target Target node. + * @param string $type Section type. * Enum: local - * @param $comment Description. - * @param $disable Flag to disable/deactivate the entry. - * @param $rate Rate limit in mbps (megabytes per second) as floating point number. - * @param $remove_job Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file. + * @param string $comment Description. + * @param bool $disable Flag to disable/deactivate the entry. + * @param int $rate Rate limit in mbps (megabytes per second) as floating point number. + * @param string $remove_job Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file. * Enum: local,full - * @param $schedule Storage replication schedule. The format is a subset of `systemd` calender events. + * @param string $schedule Storage replication schedule. The format is a subset of `systemd` calender events. + * @return Result */ public function create($id, $target, $type, $comment = null, $disable = null, $rate = null, $remove_job = null, $schedule = null) { @@ -358,7 +472,7 @@ public function create($id, $target, $type, $comment = null, $disable = null, $r 'rate' => $rate, 'remove_job' => $remove_job, 'schedule' => $schedule]; - $this->client->post("/cluster/replication", $parms); + return $this->getClient()->post("/cluster/replication", $parms); } } @@ -374,35 +488,37 @@ function __construct($client, $id) /** * Mark replication job for removal. - * @param $force Will remove the jobconfig entry, but will not cleanup. - * @param $keep Keep replicated data at target (do not remove). + * @param bool $force Will remove the jobconfig entry, but will not cleanup. + * @param bool $keep Keep replicated data at target (do not remove). + * @return Result */ public function delete($force = null, $keep = null) { $parms = ['force' => $force, 'keep' => $keep]; - $this->client->delete("/cluster/replication/{$this->id}", $parms); + return $this->getClient()->delete("/cluster/replication/{$this->id}", $parms); } /** * Read replication job configuration. - * @return mixed + * @return Result */ public function read() { - return $this->client->get("/cluster/replication/{$this->id}"); + return $this->getClient()->get("/cluster/replication/{$this->id}"); } /** * Update replication job configuration. - * @param $comment Description. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $disable Flag to disable/deactivate the entry. - * @param $rate Rate limit in mbps (megabytes per second) as floating point number. - * @param $remove_job Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file. + * @param string $comment Description. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $disable Flag to disable/deactivate the entry. + * @param int $rate Rate limit in mbps (megabytes per second) as floating point number. + * @param string $remove_job Mark the replication job for removal. The job will remove all local replication snapshots. When set to 'full', it also tries to remove replicated volumes on the target. The job then removes itself from the configuration file. * Enum: local,full - * @param $schedule Storage replication schedule. The format is a subset of `systemd` calender events. + * @param string $schedule Storage replication schedule. The format is a subset of `systemd` calender events. + * @return Result */ public function update($comment = null, $delete = null, $digest = null, $disable = null, $rate = null, $remove_job = null, $schedule = null) { @@ -413,7 +529,7 @@ public function update($comment = null, $delete = null, $digest = null, $disable 'rate' => $rate, 'remove_job' => $remove_job, 'schedule' => $schedule]; - $this->client->put("/cluster/replication/{$this->id}", $parms); + return $this->getClient()->put("/cluster/replication/{$this->id}", $parms); } } @@ -440,11 +556,11 @@ public function getTotem() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/config"); + return $this->getClient()->get("/cluster/config"); } } @@ -457,11 +573,11 @@ function __construct($client) /** * Corosync node list. - * @return mixed + * @return Result */ public function nodes() { - return $this->client->get("/cluster/config/nodes"); + return $this->getClient()->get("/cluster/config/nodes"); } } @@ -474,11 +590,11 @@ function __construct($client) /** * Get corosync totem protocol settings. - * @return mixed + * @return Result */ public function totem() { - return $this->client->get("/cluster/config/totem"); + return $this->getClient()->get("/cluster/config/totem"); } } @@ -540,11 +656,11 @@ public function getRefs() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/firewall"); + return $this->getClient()->get("/cluster/firewall"); } } @@ -562,19 +678,20 @@ public function get($group) /** * List security groups. - * @return mixed + * @return Result */ public function listSecurityGroups() { - return $this->client->get("/cluster/firewall/groups"); + return $this->getClient()->get("/cluster/firewall/groups"); } /** * Create new security group. - * @param $group Security Group name. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename/update an existing security group. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing group. + * @param string $group Security Group name. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename/update an existing security group. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing group. + * @return Result */ public function createSecurityGroup($group, $comment = null, $digest = null, $rename = null) { @@ -582,7 +699,7 @@ public function createSecurityGroup($group, $comment = null, $digest = null, $re 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->post("/cluster/firewall/groups", $parms); + return $this->getClient()->post("/cluster/firewall/groups", $parms); } } @@ -603,37 +720,39 @@ public function get($pos) /** * Delete security group. + * @return Result */ public function deleteSecurityGroup() { - $this->client->delete("/cluster/firewall/groups/{$this->group}"); + return $this->getClient()->delete("/cluster/firewall/groups/{$this->group}"); } /** * List rules. - * @return mixed + * @return Result */ public function getRules() { - return $this->client->get("/cluster/firewall/groups/{$this->group}"); + return $this->getClient()->get("/cluster/firewall/groups/{$this->group}"); } /** * Create new rule. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $type Rule type. * Enum: in,out,group - * @param $comment Descriptive comment. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $pos Update rule at position &lt;pos&gt;. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $comment Descriptive comment. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $pos Update rule at position &lt;pos&gt;. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @return Result */ public function createRule($action, $type, $comment = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $pos = null, $proto = null, $source = null, $sport = null) { @@ -650,7 +769,7 @@ public function createRule($action, $type, $comment = null, $dest = null, $diges 'proto' => $proto, 'source' => $source, 'sport' => $sport]; - $this->client->post("/cluster/firewall/groups/{$this->group}", $parms); + return $this->getClient()->post("/cluster/firewall/groups/{$this->group}", $parms); } } @@ -668,40 +787,42 @@ function __construct($client, $group, $pos) /** * Delete rule. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function deleteRule($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/cluster/firewall/groups/{$this->group}/{$this->pos}", $parms); + return $this->getClient()->delete("/cluster/firewall/groups/{$this->group}/{$this->pos}", $parms); } /** * Get single rule data. - * @return mixed + * @return Result */ public function getRule() { - return $this->client->get("/cluster/firewall/groups/{$this->group}/{$this->pos}"); + return $this->getClient()->get("/cluster/firewall/groups/{$this->group}/{$this->pos}"); } /** * Modify rule data. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $comment Descriptive comment. - * @param $delete A list of settings you want to delete. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $comment Descriptive comment. + * @param string $delete A list of settings you want to delete. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $type Rule type. * Enum: in,out,group + * @return Result */ public function updateRule($action = null, $comment = null, $delete = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $moveto = null, $proto = null, $source = null, $sport = null, $type = null) { @@ -719,7 +840,7 @@ public function updateRule($action = null, $comment = null, $delete = null, $des 'source' => $source, 'sport' => $sport, 'type' => $type]; - $this->client->put("/cluster/firewall/groups/{$this->group}/{$this->pos}", $parms); + return $this->getClient()->put("/cluster/firewall/groups/{$this->group}/{$this->pos}", $parms); } } @@ -737,29 +858,30 @@ public function get($pos) /** * List rules. - * @return mixed + * @return Result */ public function getRules() { - return $this->client->get("/cluster/firewall/rules"); + return $this->getClient()->get("/cluster/firewall/rules"); } /** * Create new rule. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $type Rule type. * Enum: in,out,group - * @param $comment Descriptive comment. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $pos Update rule at position &lt;pos&gt;. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $comment Descriptive comment. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $pos Update rule at position &lt;pos&gt;. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @return Result */ public function createRule($action, $type, $comment = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $pos = null, $proto = null, $source = null, $sport = null) { @@ -776,7 +898,7 @@ public function createRule($action, $type, $comment = null, $dest = null, $diges 'proto' => $proto, 'source' => $source, 'sport' => $sport]; - $this->client->post("/cluster/firewall/rules", $parms); + return $this->getClient()->post("/cluster/firewall/rules", $parms); } } @@ -792,40 +914,42 @@ function __construct($client, $pos) /** * Delete rule. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function deleteRule($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/cluster/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->delete("/cluster/firewall/rules/{$this->pos}", $parms); } /** * Get single rule data. - * @return mixed + * @return Result */ public function getRule() { - return $this->client->get("/cluster/firewall/rules/{$this->pos}"); + return $this->getClient()->get("/cluster/firewall/rules/{$this->pos}"); } /** * Modify rule data. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $comment Descriptive comment. - * @param $delete A list of settings you want to delete. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $comment Descriptive comment. + * @param string $delete A list of settings you want to delete. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $type Rule type. * Enum: in,out,group + * @return Result */ public function updateRule($action = null, $comment = null, $delete = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $moveto = null, $proto = null, $source = null, $sport = null, $type = null) { @@ -843,7 +967,7 @@ public function updateRule($action = null, $comment = null, $delete = null, $des 'source' => $source, 'sport' => $sport, 'type' => $type]; - $this->client->put("/cluster/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->put("/cluster/firewall/rules/{$this->pos}", $parms); } } @@ -861,19 +985,20 @@ public function get($name) /** * List IPSets - * @return mixed + * @return Result */ public function ipsetIndex() { - return $this->client->get("/cluster/firewall/ipset"); + return $this->getClient()->get("/cluster/firewall/ipset"); } /** * Create new IPSet - * @param $name IP set name. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @param string $name IP set name. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @return Result */ public function createIpset($name, $comment = null, $digest = null, $rename = null) { @@ -881,7 +1006,7 @@ public function createIpset($name, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->post("/cluster/firewall/ipset", $parms); + return $this->getClient()->post("/cluster/firewall/ipset", $parms); } } @@ -902,33 +1027,35 @@ public function get($cidr) /** * Delete IPSet + * @return Result */ public function deleteIpset() { - $this->client->delete("/cluster/firewall/ipset/{$this->name}"); + return $this->getClient()->delete("/cluster/firewall/ipset/{$this->name}"); } /** * List IPSet content - * @return mixed + * @return Result */ public function getIpset() { - return $this->client->get("/cluster/firewall/ipset/{$this->name}"); + return $this->getClient()->get("/cluster/firewall/ipset/{$this->name}"); } /** * Add IP or Network to IPSet. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $nomatch + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param bool $nomatch + * @return Result */ public function createIp($cidr, $comment = null, $nomatch = null) { $parms = ['cidr' => $cidr, 'comment' => $comment, 'nomatch' => $nomatch]; - $this->client->post("/cluster/firewall/ipset/{$this->name}", $parms); + return $this->getClient()->post("/cluster/firewall/ipset/{$this->name}", $parms); } } @@ -946,35 +1073,37 @@ function __construct($client, $name, $cidr) /** * Remove IP or Network from IPSet. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeIp($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/cluster/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->delete("/cluster/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } /** * Read IP or Network settings from IPSet. - * @return mixed + * @return Result */ public function readIp() { - return $this->client->get("/cluster/firewall/ipset/{$this->name}/{$this->cidr}"); + return $this->getClient()->get("/cluster/firewall/ipset/{$this->name}/{$this->cidr}"); } /** * Update IP or Network settings - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $nomatch + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $nomatch + * @return Result */ public function updateIp($comment = null, $digest = null, $nomatch = null) { $parms = ['comment' => $comment, 'digest' => $digest, 'nomatch' => $nomatch]; - $this->client->put("/cluster/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->put("/cluster/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } } @@ -992,25 +1121,26 @@ public function get($name) /** * List aliases - * @return mixed + * @return Result */ public function getAliases() { - return $this->client->get("/cluster/firewall/aliases"); + return $this->getClient()->get("/cluster/firewall/aliases"); } /** * Create IP or Network Alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $name Alias name. - * @param $comment + * @param string $cidr Network/IP specification in CIDR format. + * @param string $name Alias name. + * @param string $comment + * @return Result */ public function createAlias($cidr, $name, $comment = null) { $parms = ['cidr' => $cidr, 'name' => $name, 'comment' => $comment]; - $this->client->post("/cluster/firewall/aliases", $parms); + return $this->getClient()->post("/cluster/firewall/aliases", $parms); } } @@ -1026,29 +1156,31 @@ function __construct($client, $name) /** * Remove IP or Network alias. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeAlias($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/cluster/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->delete("/cluster/firewall/aliases/{$this->name}", $parms); } /** * Read alias. - * @return mixed + * @return Result */ public function readAlias() { - return $this->client->get("/cluster/firewall/aliases/{$this->name}"); + return $this->getClient()->get("/cluster/firewall/aliases/{$this->name}"); } /** * Update IP or Network alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing alias. + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing alias. + * @return Result */ public function updateAlias($cidr, $comment = null, $digest = null, $rename = null) { @@ -1056,7 +1188,7 @@ public function updateAlias($cidr, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->put("/cluster/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->put("/cluster/firewall/aliases/{$this->name}", $parms); } } @@ -1069,22 +1201,23 @@ function __construct($client) /** * Get Firewall options. - * @return mixed + * @return Result */ public function getOptions() { - return $this->client->get("/cluster/firewall/options"); + return $this->getClient()->get("/cluster/firewall/options"); } /** * Set Firewall options. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $enable Enable or disable the firewall cluster wide. - * @param $policy_in Input policy. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param int $enable Enable or disable the firewall cluster wide. + * @param string $policy_in Input policy. * Enum: ACCEPT,REJECT,DROP - * @param $policy_out Output policy. + * @param string $policy_out Output policy. * Enum: ACCEPT,REJECT,DROP + * @return Result */ public function setOptions($delete = null, $digest = null, $enable = null, $policy_in = null, $policy_out = null) { @@ -1093,7 +1226,7 @@ public function setOptions($delete = null, $digest = null, $enable = null, $poli 'enable' => $enable, 'policy_in' => $policy_in, 'policy_out' => $policy_out]; - $this->client->put("/cluster/firewall/options", $parms); + return $this->getClient()->put("/cluster/firewall/options", $parms); } } @@ -1106,11 +1239,11 @@ function __construct($client) /** * List available macros - * @return mixed + * @return Result */ public function getMacros() { - return $this->client->get("/cluster/firewall/macros"); + return $this->getClient()->get("/cluster/firewall/macros"); } } @@ -1123,14 +1256,14 @@ function __construct($client) /** * Lists possible IPSet/Alias reference which are allowed in source/dest properties. - * @param $type Only list references of specified type. + * @param string $type Only list references of specified type. * Enum: alias,ipset - * @return mixed + * @return Result */ public function refs($type = null) { $parms = ['type' => $type]; - return $this->client->get("/cluster/firewall/refs", $parms); + return $this->getClient()->get("/cluster/firewall/refs", $parms); } } @@ -1148,45 +1281,46 @@ public function get($id) /** * List vzdump backup schedule. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/backup"); + return $this->getClient()->get("/cluster/backup"); } /** * Create new vzdump backup job. - * @param $starttime Job Start time. - * @param $all Backup all known guest systems on this host. - * @param $bwlimit Limit I/O bandwidth (KBytes per second). - * @param $compress Compress dump file. + * @param string $starttime Job Start time. + * @param bool $all Backup all known guest systems on this host. + * @param int $bwlimit Limit I/O bandwidth (KBytes per second). + * @param string $compress Compress dump file. * Enum: 0,1,gzip,lzo - * @param $dow Day of week selection. - * @param $dumpdir Store resulting files to specified directory. - * @param $enabled Enable or disable the job. - * @param $exclude Exclude specified guest systems (assumes --all) - * @param $exclude_path Exclude certain files/directories (shell globs). - * @param $ionice Set CFQ ionice priority. - * @param $lockwait Maximal time to wait for the global lock (minutes). - * @param $mailnotification Specify when to send an email + * @param string $dow Day of week selection. + * @param string $dumpdir Store resulting files to specified directory. + * @param bool $enabled Enable or disable the job. + * @param string $exclude Exclude specified guest systems (assumes --all) + * @param string $exclude_path Exclude certain files/directories (shell globs). + * @param int $ionice Set CFQ ionice priority. + * @param int $lockwait Maximal time to wait for the global lock (minutes). + * @param string $mailnotification Specify when to send an email * Enum: always,failure - * @param $mailto Comma-separated list of email addresses that should receive email notifications. - * @param $maxfiles Maximal number of backup files per guest system. - * @param $mode Backup mode. + * @param string $mailto Comma-separated list of email addresses that should receive email notifications. + * @param int $maxfiles Maximal number of backup files per guest system. + * @param string $mode Backup mode. * Enum: snapshot,suspend,stop - * @param $node Only run if executed on this node. - * @param $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. - * @param $quiet Be quiet. - * @param $remove Remove old backup files if there are more than 'maxfiles' backup files. - * @param $script Use specified hook script. - * @param $size Unused, will be removed in a future release. - * @param $stdexcludes Exclude temporary files and logs. - * @param $stop Stop runnig backup jobs on this host. - * @param $stopwait Maximal time to wait until a guest system is stopped (minutes). - * @param $storage Store resulting file to this storage. - * @param $tmpdir Store temporary files to specified directory. - * @param $vmid The ID of the guest system you want to backup. + * @param string $node Only run if executed on this node. + * @param int $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. + * @param bool $quiet Be quiet. + * @param bool $remove Remove old backup files if there are more than 'maxfiles' backup files. + * @param string $script Use specified hook script. + * @param int $size Unused, will be removed in a future release. + * @param bool $stdexcludes Exclude temporary files and logs. + * @param bool $stop Stop runnig backup jobs on this host. + * @param int $stopwait Maximal time to wait until a guest system is stopped (minutes). + * @param string $storage Store resulting file to this storage. + * @param string $tmpdir Store temporary files to specified directory. + * @param string $vmid The ID of the guest system you want to backup. + * @return Result */ public function createJob($starttime, $all = null, $bwlimit = null, $compress = null, $dow = null, $dumpdir = null, $enabled = null, $exclude = null, $exclude_path = null, $ionice = null, $lockwait = null, $mailnotification = null, $mailto = null, $maxfiles = null, $mode = null, $node = null, $pigz = null, $quiet = null, $remove = null, $script = null, $size = null, $stdexcludes = null, $stop = null, $stopwait = null, $storage = null, $tmpdir = null, $vmid = null) { @@ -1217,7 +1351,7 @@ public function createJob($starttime, $all = null, $bwlimit = null, $compress = 'storage' => $storage, 'tmpdir' => $tmpdir, 'vmid' => $vmid]; - $this->client->post("/cluster/backup", $parms); + return $this->getClient()->post("/cluster/backup", $parms); } } @@ -1233,54 +1367,56 @@ function __construct($client, $id) /** * Delete vzdump backup job definition. + * @return Result */ public function deleteJob() { - $this->client->delete("/cluster/backup/{$this->id}"); + return $this->getClient()->delete("/cluster/backup/{$this->id}"); } /** * Read vzdump backup job definition. - * @return mixed + * @return Result */ public function readJob() { - return $this->client->get("/cluster/backup/{$this->id}"); + return $this->getClient()->get("/cluster/backup/{$this->id}"); } /** * Update vzdump backup job definition. - * @param $starttime Job Start time. - * @param $all Backup all known guest systems on this host. - * @param $bwlimit Limit I/O bandwidth (KBytes per second). - * @param $compress Compress dump file. + * @param string $starttime Job Start time. + * @param bool $all Backup all known guest systems on this host. + * @param int $bwlimit Limit I/O bandwidth (KBytes per second). + * @param string $compress Compress dump file. * Enum: 0,1,gzip,lzo - * @param $delete A list of settings you want to delete. - * @param $dow Day of week selection. - * @param $dumpdir Store resulting files to specified directory. - * @param $enabled Enable or disable the job. - * @param $exclude Exclude specified guest systems (assumes --all) - * @param $exclude_path Exclude certain files/directories (shell globs). - * @param $ionice Set CFQ ionice priority. - * @param $lockwait Maximal time to wait for the global lock (minutes). - * @param $mailnotification Specify when to send an email + * @param string $delete A list of settings you want to delete. + * @param string $dow Day of week selection. + * @param string $dumpdir Store resulting files to specified directory. + * @param bool $enabled Enable or disable the job. + * @param string $exclude Exclude specified guest systems (assumes --all) + * @param string $exclude_path Exclude certain files/directories (shell globs). + * @param int $ionice Set CFQ ionice priority. + * @param int $lockwait Maximal time to wait for the global lock (minutes). + * @param string $mailnotification Specify when to send an email * Enum: always,failure - * @param $mailto Comma-separated list of email addresses that should receive email notifications. - * @param $maxfiles Maximal number of backup files per guest system. - * @param $mode Backup mode. + * @param string $mailto Comma-separated list of email addresses that should receive email notifications. + * @param int $maxfiles Maximal number of backup files per guest system. + * @param string $mode Backup mode. * Enum: snapshot,suspend,stop - * @param $node Only run if executed on this node. - * @param $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. - * @param $quiet Be quiet. - * @param $remove Remove old backup files if there are more than 'maxfiles' backup files. - * @param $script Use specified hook script. - * @param $size Unused, will be removed in a future release. - * @param $stdexcludes Exclude temporary files and logs. - * @param $stop Stop runnig backup jobs on this host. - * @param $stopwait Maximal time to wait until a guest system is stopped (minutes). - * @param $storage Store resulting file to this storage. - * @param $tmpdir Store temporary files to specified directory. - * @param $vmid The ID of the guest system you want to backup. + * @param string $node Only run if executed on this node. + * @param int $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. + * @param bool $quiet Be quiet. + * @param bool $remove Remove old backup files if there are more than 'maxfiles' backup files. + * @param string $script Use specified hook script. + * @param int $size Unused, will be removed in a future release. + * @param bool $stdexcludes Exclude temporary files and logs. + * @param bool $stop Stop runnig backup jobs on this host. + * @param int $stopwait Maximal time to wait until a guest system is stopped (minutes). + * @param string $storage Store resulting file to this storage. + * @param string $tmpdir Store temporary files to specified directory. + * @param string $vmid The ID of the guest system you want to backup. + * @return Result */ public function updateJob($starttime, $all = null, $bwlimit = null, $compress = null, $delete = null, $dow = null, $dumpdir = null, $enabled = null, $exclude = null, $exclude_path = null, $ionice = null, $lockwait = null, $mailnotification = null, $mailto = null, $maxfiles = null, $mode = null, $node = null, $pigz = null, $quiet = null, $remove = null, $script = null, $size = null, $stdexcludes = null, $stop = null, $stopwait = null, $storage = null, $tmpdir = null, $vmid = null) { @@ -1312,7 +1448,7 @@ public function updateJob($starttime, $all = null, $bwlimit = null, $compress = 'storage' => $storage, 'tmpdir' => $tmpdir, 'vmid' => $vmid]; - $this->client->put("/cluster/backup/{$this->id}", $parms); + return $this->getClient()->put("/cluster/backup/{$this->id}", $parms); } } @@ -1346,11 +1482,11 @@ public function getStatus() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/ha"); + return $this->getClient()->get("/cluster/ha"); } } @@ -1368,27 +1504,28 @@ public function get($sid) /** * List HA resources. - * @param $type Only list resources of specific type + * @param string $type Only list resources of specific type * Enum: ct,vm - * @return mixed + * @return Result */ public function index($type = null) { $parms = ['type' => $type]; - return $this->client->get("/cluster/ha/resources", $parms); + return $this->getClient()->get("/cluster/ha/resources", $parms); } /** * Create a new HA resource. - * @param $sid HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100). - * @param $comment Description. - * @param $group The HA group identifier. - * @param $max_relocate Maximal number of service relocate tries when a service failes to start. - * @param $max_restart Maximal number of tries to restart the service on a node after its start failed. - * @param $state Requested resource state. + * @param string $sid HA resource ID. This consists of a resource type followed by a resource specific name, separated with colon (example: vm:100 / ct:100). For virtual machines and containers, you can simply use the VM or CT id as a shortcut (example: 100). + * @param string $comment Description. + * @param string $group The HA group identifier. + * @param int $max_relocate Maximal number of service relocate tries when a service failes to start. + * @param int $max_restart Maximal number of tries to restart the service on a node after its start failed. + * @param string $state Requested resource state. * Enum: started,stopped,enabled,disabled - * @param $type Resource type. + * @param string $type Resource type. * Enum: ct,vm + * @return Result */ public function create($sid, $comment = null, $group = null, $max_relocate = null, $max_restart = null, $state = null, $type = null) { @@ -1399,7 +1536,7 @@ public function create($sid, $comment = null, $group = null, $max_relocate = nul 'max_restart' => $max_restart, 'state' => $state, 'type' => $type]; - $this->client->post("/cluster/ha/resources", $parms); + return $this->getClient()->post("/cluster/ha/resources", $parms); } } @@ -1429,31 +1566,33 @@ public function getRelocate() /** * Delete resource configuration. + * @return Result */ public function delete() { - $this->client->delete("/cluster/ha/resources/{$this->sid}"); + return $this->getClient()->delete("/cluster/ha/resources/{$this->sid}"); } /** * Read resource configuration. - * @return mixed + * @return Result */ public function read() { - return $this->client->get("/cluster/ha/resources/{$this->sid}"); + return $this->getClient()->get("/cluster/ha/resources/{$this->sid}"); } /** * Update resource configuration. - * @param $comment Description. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $group The HA group identifier. - * @param $max_relocate Maximal number of service relocate tries when a service failes to start. - * @param $max_restart Maximal number of tries to restart the service on a node after its start failed. - * @param $state Requested resource state. + * @param string $comment Description. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $group The HA group identifier. + * @param int $max_relocate Maximal number of service relocate tries when a service failes to start. + * @param int $max_restart Maximal number of tries to restart the service on a node after its start failed. + * @param string $state Requested resource state. * Enum: started,stopped,enabled,disabled + * @return Result */ public function update($comment = null, $delete = null, $digest = null, $group = null, $max_relocate = null, $max_restart = null, $state = null) { @@ -1464,7 +1603,7 @@ public function update($comment = null, $delete = null, $digest = null, $group = 'max_relocate' => $max_relocate, 'max_restart' => $max_restart, 'state' => $state]; - $this->client->put("/cluster/ha/resources/{$this->sid}", $parms); + return $this->getClient()->put("/cluster/ha/resources/{$this->sid}", $parms); } } @@ -1480,12 +1619,13 @@ function __construct($client, $sid) /** * Request resource migration (online) to another node. - * @param $node The cluster node name. + * @param string $node The cluster node name. + * @return Result */ public function migrate($node) { $parms = ['node' => $node]; - $this->client->post("/cluster/ha/resources/{$this->sid}/migrate", $parms); + return $this->getClient()->post("/cluster/ha/resources/{$this->sid}/migrate", $parms); } } @@ -1501,12 +1641,13 @@ function __construct($client, $sid) /** * Request resource relocatzion to another node. This stops the service on the old node, and restarts it on the target node. - * @param $node The cluster node name. + * @param string $node The cluster node name. + * @return Result */ public function relocate($node) { $parms = ['node' => $node]; - $this->client->post("/cluster/ha/resources/{$this->sid}/relocate", $parms); + return $this->getClient()->post("/cluster/ha/resources/{$this->sid}/relocate", $parms); } } @@ -1524,22 +1665,23 @@ public function get($group) /** * Get HA groups. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/ha/groups"); + return $this->getClient()->get("/cluster/ha/groups"); } /** * Create a new HA group. - * @param $group The HA group identifier. - * @param $nodes List of cluster node names with optional priority. - * @param $comment Description. - * @param $nofailback The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior. - * @param $restricted Resources bound to restricted groups may only run on nodes defined by the group. - * @param $type Group type. + * @param string $group The HA group identifier. + * @param string $nodes List of cluster node names with optional priority. + * @param string $comment Description. + * @param bool $nofailback The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior. + * @param bool $restricted Resources bound to restricted groups may only run on nodes defined by the group. + * @param string $type Group type. * Enum: group + * @return Result */ public function create($group, $nodes, $comment = null, $nofailback = null, $restricted = null, $type = null) { @@ -1549,7 +1691,7 @@ public function create($group, $nodes, $comment = null, $nofailback = null, $res 'nofailback' => $nofailback, 'restricted' => $restricted, 'type' => $type]; - $this->client->post("/cluster/ha/groups", $parms); + return $this->getClient()->post("/cluster/ha/groups", $parms); } } @@ -1565,29 +1707,31 @@ function __construct($client, $group) /** * Delete ha group configuration. + * @return Result */ public function delete() { - $this->client->delete("/cluster/ha/groups/{$this->group}"); + return $this->getClient()->delete("/cluster/ha/groups/{$this->group}"); } /** * Read ha group configuration. - * @return mixed + * @return Result */ public function read() { - return $this->client->get("/cluster/ha/groups/{$this->group}"); + return $this->getClient()->get("/cluster/ha/groups/{$this->group}"); } /** * Update ha group configuration. - * @param $comment Description. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $nodes List of cluster node names with optional priority. - * @param $nofailback The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior. - * @param $restricted Resources bound to restricted groups may only run on nodes defined by the group. + * @param string $comment Description. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $nodes List of cluster node names with optional priority. + * @param bool $nofailback The CRM tries to run services on the node with the highest priority. If a node with higher priority comes online, the CRM migrates the service to that node. Enabling nofailback prevents that behavior. + * @param bool $restricted Resources bound to restricted groups may only run on nodes defined by the group. + * @return Result */ public function update($comment = null, $delete = null, $digest = null, $nodes = null, $nofailback = null, $restricted = null) { @@ -1597,7 +1741,7 @@ public function update($comment = null, $delete = null, $digest = null, $nodes = 'nodes' => $nodes, 'nofailback' => $nofailback, 'restricted' => $restricted]; - $this->client->put("/cluster/ha/groups/{$this->group}", $parms); + return $this->getClient()->put("/cluster/ha/groups/{$this->group}", $parms); } } @@ -1624,11 +1768,11 @@ public function getManagerStatus() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/cluster/ha/status"); + return $this->getClient()->get("/cluster/ha/status"); } } @@ -1641,11 +1785,11 @@ function __construct($client) /** * Get HA manger status. - * @return mixed + * @return Result */ public function status() { - return $this->client->get("/cluster/ha/status/current"); + return $this->getClient()->get("/cluster/ha/status/current"); } } @@ -1658,11 +1802,11 @@ function __construct($client) /** * Get full HA manger status, including LRM status. - * @return mixed + * @return Result */ public function managerStatus() { - return $this->client->get("/cluster/ha/status/manager_status"); + return $this->getClient()->get("/cluster/ha/status/manager_status"); } } @@ -1675,13 +1819,13 @@ function __construct($client) /** * Read cluster log - * @param $max Maximum number of entries. - * @return mixed + * @param int $max Maximum number of entries. + * @return Result */ public function log($max = null) { $parms = ['max' => $max]; - return $this->client->get("/cluster/log", $parms); + return $this->getClient()->get("/cluster/log", $parms); } } @@ -1694,14 +1838,14 @@ function __construct($client) /** * Resources index (cluster wide). - * @param $type + * @param string $type * Enum: vm,storage,node - * @return mixed + * @return Result */ public function resources($type = null) { $parms = ['type' => $type]; - return $this->client->get("/cluster/resources", $parms); + return $this->getClient()->get("/cluster/resources", $parms); } } @@ -1714,11 +1858,11 @@ function __construct($client) /** * List recent tasks (cluster wide). - * @return mixed + * @return Result */ public function tasks() { - return $this->client->get("/cluster/tasks"); + return $this->getClient()->get("/cluster/tasks"); } } @@ -1731,30 +1875,31 @@ function __construct($client) /** * Get datacenter options. - * @return mixed + * @return Result */ public function getOptions() { - return $this->client->get("/cluster/options"); + return $this->getClient()->get("/cluster/options"); } /** * Set datacenter options. - * @param $console Select the default Console viewer. You can either use the builtin java applet (VNC), an external virt-viewer comtatible application (SPICE), or an HTML5 based viewer (noVNC). + * @param string $console Select the default Console viewer. You can either use the builtin java applet (VNC), an external virt-viewer comtatible application (SPICE), or an HTML5 based viewer (noVNC). * Enum: applet,vv,html5 - * @param $delete A list of settings you want to delete. - * @param $email_from Specify email address to send notification from (default is root@$hostname) - * @param $fencing Set the fencing mode of the HA cluster. Hardware mode needs a valid configuration of fence devices in /etc/pve/ha/fence.cfg. With both all two modes are used. WARNING: 'hardware' and 'both' are EXPERIMENTAL & WIP + * @param string $delete A list of settings you want to delete. + * @param string $email_from Specify email address to send notification from (default is root@$hostname) + * @param string $fencing Set the fencing mode of the HA cluster. Hardware mode needs a valid configuration of fence devices in /etc/pve/ha/fence.cfg. With both all two modes are used. WARNING: 'hardware' and 'both' are EXPERIMENTAL & WIP * Enum: watchdog,hardware,both - * @param $http_proxy Specify external http proxy which is used for downloads (example: 'http://username:password@host:port/') - * @param $keyboard Default keybord layout for vnc server. + * @param string $http_proxy Specify external http proxy which is used for downloads (example: 'http://username:password@host:port/') + * @param string $keyboard Default keybord layout for vnc server. * Enum: de,de-ch,da,en-gb,en-us,es,fi,fr,fr-be,fr-ca,fr-ch,hu,is,it,ja,lt,mk,nl,no,pl,pt,pt-br,sv,sl,tr - * @param $language Default GUI language. + * @param string $language Default GUI language. * Enum: en,de - * @param $mac_prefix Prefix for autogenerated MAC addresses. - * @param $max_workers Defines how many workers (per node) are maximal started on actions like 'stopall VMs' or task from the ha-manager. - * @param $migration For cluster wide migration settings. - * @param $migration_unsecure Migration is secure using SSH tunnel by default. For secure private networks you can disable it to speed up migration. Deprecated, use the 'migration' property instead! + * @param string $mac_prefix Prefix for autogenerated MAC addresses. + * @param int $max_workers Defines how many workers (per node) are maximal started on actions like 'stopall VMs' or task from the ha-manager. + * @param string $migration For cluster wide migration settings. + * @param bool $migration_unsecure Migration is secure using SSH tunnel by default. For secure private networks you can disable it to speed up migration. Deprecated, use the 'migration' property instead! + * @return Result */ public function setOptions($console = null, $delete = null, $email_from = null, $fencing = null, $http_proxy = null, $keyboard = null, $language = null, $mac_prefix = null, $max_workers = null, $migration = null, $migration_unsecure = null) { @@ -1769,7 +1914,7 @@ public function setOptions($console = null, $delete = null, $email_from = null, 'max_workers' => $max_workers, 'migration' => $migration, 'migration_unsecure' => $migration_unsecure]; - $this->client->put("/cluster/options", $parms); + return $this->getClient()->put("/cluster/options", $parms); } } @@ -1782,11 +1927,11 @@ function __construct($client) /** * Get cluster status informations. - * @return mixed + * @return Result */ public function getStatus() { - return $this->client->get("/cluster/status"); + return $this->getClient()->get("/cluster/status"); } } @@ -1799,13 +1944,13 @@ function __construct($client) /** * Get next free VMID. If you pass an VMID it will raise an error if the ID is already used. - * @param $vmid The (unique) ID of the VM. - * @return mixed + * @param int $vmid The (unique) ID of the VM. + * @return Result */ public function nextid($vmid = null) { $parms = ['vmid' => $vmid]; - return $this->client->get("/cluster/nextid", $parms); + return $this->getClient()->get("/cluster/nextid", $parms); } } @@ -1823,11 +1968,11 @@ public function get($node) /** * Cluster node index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes"); + return $this->getClient()->get("/nodes"); } } @@ -2060,11 +2205,11 @@ public function getMigrateall() /** * Node index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}"); + return $this->getClient()->get("/nodes/{$this->node}"); } } @@ -2085,86 +2230,86 @@ public function get($vmid) /** * Virtual machine index (per node). - * @param $full Determine the full status of active VMs. - * @return mixed + * @param bool $full Determine the full status of active VMs. + * @return Result */ public function vmlist($full = null) { $parms = ['full' => $full]; - return $this->client->get("/nodes/{$this->node}/qemu", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu", $parms); } /** * Create or restore a virtual machine. - * @param $vmid The (unique) ID of the VM. - * @param $acpi Enable/disable ACPI. - * @param $agent Enable/disable Qemu GuestAgent. - * @param $archive The backup file. - * @param $args Arbitrary arguments passed to kvm. - * @param $autostart Automatic restart after crash (currently ignored). - * @param $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. - * @param $bios Select BIOS implementation. + * @param int $vmid The (unique) ID of the VM. + * @param bool $acpi Enable/disable ACPI. + * @param bool $agent Enable/disable Qemu GuestAgent. + * @param string $archive The backup file. + * @param string $args Arbitrary arguments passed to kvm. + * @param bool $autostart Automatic restart after crash (currently ignored). + * @param int $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. + * @param string $bios Select BIOS implementation. * Enum: seabios,ovmf - * @param $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). - * @param $bootdisk Enable booting from specified disk. - * @param $cdrom This is an alias for option -ide2 - * @param $cores The number of cores per socket. - * @param $cpu Emulated CPU type. - * @param $cpulimit Limit of CPU usage. - * @param $cpuunits CPU weight for a VM. - * @param $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. - * @param $force Allow to overwrite existing VM. - * @param $freeze Freeze CPU at startup (use 'c' monitor command to start execution). - * @param $hostpciN Map host PCI devices into guest. - * @param $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. - * @param $hugepages Enable/disable hugepages memory. + * @param string $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). + * @param string $bootdisk Enable booting from specified disk. + * @param string $cdrom This is an alias for option -ide2 + * @param int $cores The number of cores per socket. + * @param string $cpu Emulated CPU type. + * @param int $cpulimit Limit of CPU usage. + * @param int $cpuunits CPU weight for a VM. + * @param string $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. + * @param bool $force Allow to overwrite existing VM. + * @param bool $freeze Freeze CPU at startup (use 'c' monitor command to start execution). + * @param array $hostpciN Map host PCI devices into guest. + * @param string $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. + * @param string $hugepages Enable/disable hugepages memory. * Enum: any,2,1024 - * @param $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). - * @param $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. + * @param array $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). + * @param string $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. * Enum: de,de-ch,da,en-gb,en-us,es,fi,fr,fr-be,fr-ca,fr-ch,hu,is,it,ja,lt,mk,nl,no,pl,pt,pt-br,sv,sl,tr - * @param $kvm Enable/disable KVM hardware virtualization. - * @param $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. - * @param $lock Lock/unlock the VM. + * @param bool $kvm Enable/disable KVM hardware virtualization. + * @param bool $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. + * @param string $lock Lock/unlock the VM. * Enum: migrate,backup,snapshot,rollback - * @param $machine Specific the Qemu machine type. - * @param $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. - * @param $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. - * @param $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. - * @param $name Set a name for the VM. Only used on the configuration web interface. - * @param $netN Specify network devices. - * @param $numa Enable/disable NUMA. - * @param $numaN NUMA topology. - * @param $onboot Specifies whether a VM will be started during system bootup. - * @param $ostype Specify guest operating system. + * @param string $machine Specific the Qemu machine type. + * @param int $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. + * @param int $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. + * @param int $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. + * @param string $name Set a name for the VM. Only used on the configuration web interface. + * @param array $netN Specify network devices. + * @param bool $numa Enable/disable NUMA. + * @param array $numaN NUMA topology. + * @param bool $onboot Specifies whether a VM will be started during system bootup. + * @param string $ostype Specify guest operating system. * Enum: other,wxp,w2k,w2k3,w2k8,wvista,win7,win8,win10,l24,l26,solaris - * @param $parallelN Map host parallel devices (n is 0 to 2). - * @param $pool Add the VM to the specified pool. - * @param $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. - * @param $reboot Allow reboot. If set to '0' the VM exit on reboot. - * @param $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). - * @param $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). - * @param $scsihw SCSI controller model + * @param array $parallelN Map host parallel devices (n is 0 to 2). + * @param string $pool Add the VM to the specified pool. + * @param bool $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. + * @param bool $reboot Allow reboot. If set to '0' the VM exit on reboot. + * @param array $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). + * @param array $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). + * @param string $scsihw SCSI controller model * Enum: lsi,lsi53c810,virtio-scsi-pci,virtio-scsi-single,megasas,pvscsi - * @param $serialN Create a serial device inside the VM (n is 0 to 3) - * @param $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning - * @param $smbios1 Specify SMBIOS type 1 fields. - * @param $smp The number of CPUs. Please use option -sockets instead. - * @param $sockets The number of CPU sockets. - * @param $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. - * @param $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. - * @param $storage Default storage. - * @param $tablet Enable/disable the USB tablet device. - * @param $tdf Enable/disable time drift fix. - * @param $template Enable/disable Template. - * @param $unique Assign a unique random ethernet address. - * @param $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. - * @param $usbN Configure an USB device (n is 0 to 4). - * @param $vcpus Number of hotplugged vcpus. - * @param $vga Select the VGA type. + * @param array $serialN Create a serial device inside the VM (n is 0 to 3) + * @param int $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning + * @param string $smbios1 Specify SMBIOS type 1 fields. + * @param int $smp The number of CPUs. Please use option -sockets instead. + * @param int $sockets The number of CPU sockets. + * @param string $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. + * @param string $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. + * @param string $storage Default storage. + * @param bool $tablet Enable/disable the USB tablet device. + * @param bool $tdf Enable/disable time drift fix. + * @param bool $template Enable/disable Template. + * @param bool $unique Assign a unique random ethernet address. + * @param array $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @param array $usbN Configure an USB device (n is 0 to 4). + * @param int $vcpus Number of hotplugged vcpus. + * @param string $vga Select the VGA type. * Enum: std,cirrus,vmware,qxl,serial0,serial1,serial2,serial3,qxl2,qxl3,qxl4 - * @param $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). - * @param $watchdog Create a virtual hardware watchdog device. - * @return mixed + * @param array $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). + * @param string $watchdog Create a virtual hardware watchdog device. + * @return Result */ public function createVm($vmid, $acpi = null, $agent = null, $archive = null, $args = null, $autostart = null, $balloon = null, $bios = null, $boot = null, $bootdisk = null, $cdrom = null, $cores = null, $cpu = null, $cpulimit = null, $cpuunits = null, $description = null, $force = null, $freeze = null, $hostpciN = null, $hotplug = null, $hugepages = null, $ideN = null, $keyboard = null, $kvm = null, $localtime = null, $lock = null, $machine = null, $memory = null, $migrate_downtime = null, $migrate_speed = null, $name = null, $netN = null, $numa = null, $numaN = null, $onboot = null, $ostype = null, $parallelN = null, $pool = null, $protection = null, $reboot = null, $sataN = null, $scsiN = null, $scsihw = null, $serialN = null, $shares = null, $smbios1 = null, $smp = null, $sockets = null, $startdate = null, $startup = null, $storage = null, $tablet = null, $tdf = null, $template = null, $unique = null, $unusedN = null, $usbN = null, $vcpus = null, $vga = null, $virtioN = null, $watchdog = null) { @@ -2229,7 +2374,7 @@ public function createVm($vmid, $acpi = null, $agent = null, $archive = null, $a $this->addIndexedParmeter($parms, 'unused', $unusedN); $this->addIndexedParmeter($parms, 'usb', $usbN); $this->addIndexedParmeter($parms, 'virtio', $virtioN); - return $this->client->post("/nodes/{$this->node}/qemu", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu", $parms); } } @@ -2387,22 +2532,22 @@ public function getTemplate() /** * Destroy the vm (also delete all used/owned volumes). - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function destroyVm($skiplock = null) { $parms = ['skiplock' => $skiplock]; - return $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}", $parms); } /** * Directory index - * @return mixed + * @return Result */ public function vmdiridx() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}"); } } @@ -2462,11 +2607,11 @@ public function getRefs() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall"); } } @@ -2489,29 +2634,30 @@ public function get($pos) /** * List rules. - * @return mixed + * @return Result */ public function getRules() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules"); } /** * Create new rule. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $type Rule type. * Enum: in,out,group - * @param $comment Descriptive comment. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $pos Update rule at position &lt;pos&gt;. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $comment Descriptive comment. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $pos Update rule at position &lt;pos&gt;. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @return Result */ public function createRule($action, $type, $comment = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $pos = null, $proto = null, $source = null, $sport = null) { @@ -2528,7 +2674,7 @@ public function createRule($action, $type, $comment = null, $dest = null, $diges 'proto' => $proto, 'source' => $source, 'sport' => $sport]; - $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules", $parms); } } @@ -2548,40 +2694,42 @@ function __construct($client, $node, $vmid, $pos) /** * Delete rule. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function deleteRule($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}", $parms); } /** * Get single rule data. - * @return mixed + * @return Result */ public function getRule() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}"); } /** * Modify rule data. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $comment Descriptive comment. - * @param $delete A list of settings you want to delete. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $comment Descriptive comment. + * @param string $delete A list of settings you want to delete. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $type Rule type. * Enum: in,out,group + * @return Result */ public function updateRule($action = null, $comment = null, $delete = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $moveto = null, $proto = null, $source = null, $sport = null, $type = null) { @@ -2599,7 +2747,7 @@ public function updateRule($action = null, $comment = null, $delete = null, $des 'source' => $source, 'sport' => $sport, 'type' => $type]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/rules/{$this->pos}", $parms); } } @@ -2622,25 +2770,26 @@ public function get($name) /** * List aliases - * @return mixed + * @return Result */ public function getAliases() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases"); } /** * Create IP or Network Alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $name Alias name. - * @param $comment + * @param string $cidr Network/IP specification in CIDR format. + * @param string $name Alias name. + * @param string $comment + * @return Result */ public function createAlias($cidr, $name, $comment = null) { $parms = ['cidr' => $cidr, 'name' => $name, 'comment' => $comment]; - $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases", $parms); } } @@ -2660,29 +2809,31 @@ function __construct($client, $node, $vmid, $name) /** * Remove IP or Network alias. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeAlias($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}", $parms); } /** * Read alias. - * @return mixed + * @return Result */ public function readAlias() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}"); } /** * Update IP or Network alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing alias. + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing alias. + * @return Result */ public function updateAlias($cidr, $comment = null, $digest = null, $rename = null) { @@ -2690,7 +2841,7 @@ public function updateAlias($cidr, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/aliases/{$this->name}", $parms); } } @@ -2713,19 +2864,20 @@ public function get($name) /** * List IPSets - * @return mixed + * @return Result */ public function ipsetIndex() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset"); } /** * Create new IPSet - * @param $name IP set name. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @param string $name IP set name. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @return Result */ public function createIpset($name, $comment = null, $digest = null, $rename = null) { @@ -2733,7 +2885,7 @@ public function createIpset($name, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset", $parms); } } @@ -2758,33 +2910,35 @@ public function get($cidr) /** * Delete IPSet + * @return Result */ public function deleteIpset() { - $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}"); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}"); } /** * List IPSet content - * @return mixed + * @return Result */ public function getIpset() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}"); } /** * Add IP or Network to IPSet. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $nomatch + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param bool $nomatch + * @return Result */ public function createIp($cidr, $comment = null, $nomatch = null) { $parms = ['cidr' => $cidr, 'comment' => $comment, 'nomatch' => $nomatch]; - $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}", $parms); } } @@ -2806,35 +2960,37 @@ function __construct($client, $node, $vmid, $name, $cidr) /** * Remove IP or Network from IPSet. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeIp($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } /** * Read IP or Network settings from IPSet. - * @return mixed + * @return Result */ public function readIp() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}"); } /** * Update IP or Network settings - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $nomatch + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $nomatch + * @return Result */ public function updateIp($comment = null, $digest = null, $nomatch = null) { $parms = ['comment' => $comment, 'digest' => $digest, 'nomatch' => $nomatch]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } } @@ -2852,31 +3008,32 @@ function __construct($client, $node, $vmid) /** * Get VM firewall options. - * @return mixed + * @return Result */ public function getOptions() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/options"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/options"); } /** * Set Firewall options. - * @param $delete A list of settings you want to delete. - * @param $dhcp Enable DHCP. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $enable Enable/disable firewall rules. - * @param $ipfilter Enable default IP filters. This is equivalent to adding an empty ipfilter-net&lt;id&gt; ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added. - * @param $log_level_in Log level for incoming traffic. + * @param string $delete A list of settings you want to delete. + * @param bool $dhcp Enable DHCP. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $enable Enable/disable firewall rules. + * @param bool $ipfilter Enable default IP filters. This is equivalent to adding an empty ipfilter-net&lt;id&gt; ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added. + * @param string $log_level_in Log level for incoming traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $log_level_out Log level for outgoing traffic. + * @param string $log_level_out Log level for outgoing traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $macfilter Enable/disable MAC address filter. - * @param $ndp Enable NDP. - * @param $policy_in Input policy. + * @param bool $macfilter Enable/disable MAC address filter. + * @param bool $ndp Enable NDP. + * @param string $policy_in Input policy. * Enum: ACCEPT,REJECT,DROP - * @param $policy_out Output policy. + * @param string $policy_out Output policy. * Enum: ACCEPT,REJECT,DROP - * @param $radv Allow sending Router Advertisement. + * @param bool $radv Allow sending Router Advertisement. + * @return Result */ public function setOptions($delete = null, $dhcp = null, $digest = null, $enable = null, $ipfilter = null, $log_level_in = null, $log_level_out = null, $macfilter = null, $ndp = null, $policy_in = null, $policy_out = null, $radv = null) { @@ -2892,7 +3049,7 @@ public function setOptions($delete = null, $dhcp = null, $digest = null, $enable 'policy_in' => $policy_in, 'policy_out' => $policy_out, 'radv' => $radv]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/options", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/options", $parms); } } @@ -2910,15 +3067,15 @@ function __construct($client, $node, $vmid) /** * Read firewall log - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function log($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/log", $parms); } } @@ -2936,14 +3093,14 @@ function __construct($client, $node, $vmid) /** * Lists possible IPSet/Alias reference which are allowed in source/dest properties. - * @param $type Only list references of specified type. + * @param string $type Only list references of specified type. * Enum: alias,ipset - * @return mixed + * @return Result */ public function refs($type = null) { $parms = ['type' => $type]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/refs", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/firewall/refs", $parms); } } @@ -2961,19 +3118,19 @@ function __construct($client, $node, $vmid) /** * Read VM RRD statistics (returns PNG) - * @param $ds The list of datasources you want to display. - * @param $timeframe Specify the time frame you are interested in. + * @param string $ds The list of datasources you want to display. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrd($ds, $timeframe, $cf = null) { $parms = ['ds' => $ds, 'timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/rrd", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/rrd", $parms); } } @@ -2991,17 +3148,17 @@ function __construct($client, $node, $vmid) /** * Read VM RRD statistics - * @param $timeframe Specify the time frame you are interested in. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrddata($timeframe, $cf = null) { $parms = ['timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/rrddata", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/rrddata", $parms); } } @@ -3019,86 +3176,86 @@ function __construct($client, $node, $vmid) /** * Get current virtual machine configuration. This does not include pending configuration changes (see 'pending' API). - * @param $current Get current values (instead of pending values). - * @return mixed + * @param bool $current Get current values (instead of pending values). + * @return Result */ public function vmConfig($current = null) { $parms = ['current' => $current]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); } /** * Set virtual machine options (asynchrounous API). - * @param $acpi Enable/disable ACPI. - * @param $agent Enable/disable Qemu GuestAgent. - * @param $args Arbitrary arguments passed to kvm. - * @param $autostart Automatic restart after crash (currently ignored). - * @param $background_delay Time to wait for the task to finish. We return 'null' if the task finish within that time. - * @param $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. - * @param $bios Select BIOS implementation. + * @param bool $acpi Enable/disable ACPI. + * @param bool $agent Enable/disable Qemu GuestAgent. + * @param string $args Arbitrary arguments passed to kvm. + * @param bool $autostart Automatic restart after crash (currently ignored). + * @param int $background_delay Time to wait for the task to finish. We return 'null' if the task finish within that time. + * @param int $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. + * @param string $bios Select BIOS implementation. * Enum: seabios,ovmf - * @param $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). - * @param $bootdisk Enable booting from specified disk. - * @param $cdrom This is an alias for option -ide2 - * @param $cores The number of cores per socket. - * @param $cpu Emulated CPU type. - * @param $cpulimit Limit of CPU usage. - * @param $cpuunits CPU weight for a VM. - * @param $delete A list of settings you want to delete. - * @param $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. - * @param $freeze Freeze CPU at startup (use 'c' monitor command to start execution). - * @param $hostpciN Map host PCI devices into guest. - * @param $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. - * @param $hugepages Enable/disable hugepages memory. + * @param string $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). + * @param string $bootdisk Enable booting from specified disk. + * @param string $cdrom This is an alias for option -ide2 + * @param int $cores The number of cores per socket. + * @param string $cpu Emulated CPU type. + * @param int $cpulimit Limit of CPU usage. + * @param int $cpuunits CPU weight for a VM. + * @param string $delete A list of settings you want to delete. + * @param string $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. + * @param bool $freeze Freeze CPU at startup (use 'c' monitor command to start execution). + * @param array $hostpciN Map host PCI devices into guest. + * @param string $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. + * @param string $hugepages Enable/disable hugepages memory. * Enum: any,2,1024 - * @param $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). - * @param $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. + * @param array $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). + * @param string $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. * Enum: de,de-ch,da,en-gb,en-us,es,fi,fr,fr-be,fr-ca,fr-ch,hu,is,it,ja,lt,mk,nl,no,pl,pt,pt-br,sv,sl,tr - * @param $kvm Enable/disable KVM hardware virtualization. - * @param $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. - * @param $lock Lock/unlock the VM. + * @param bool $kvm Enable/disable KVM hardware virtualization. + * @param bool $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. + * @param string $lock Lock/unlock the VM. * Enum: migrate,backup,snapshot,rollback - * @param $machine Specific the Qemu machine type. - * @param $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. - * @param $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. - * @param $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. - * @param $name Set a name for the VM. Only used on the configuration web interface. - * @param $netN Specify network devices. - * @param $numa Enable/disable NUMA. - * @param $numaN NUMA topology. - * @param $onboot Specifies whether a VM will be started during system bootup. - * @param $ostype Specify guest operating system. + * @param string $machine Specific the Qemu machine type. + * @param int $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. + * @param int $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. + * @param int $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. + * @param string $name Set a name for the VM. Only used on the configuration web interface. + * @param array $netN Specify network devices. + * @param bool $numa Enable/disable NUMA. + * @param array $numaN NUMA topology. + * @param bool $onboot Specifies whether a VM will be started during system bootup. + * @param string $ostype Specify guest operating system. * Enum: other,wxp,w2k,w2k3,w2k8,wvista,win7,win8,win10,l24,l26,solaris - * @param $parallelN Map host parallel devices (n is 0 to 2). - * @param $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. - * @param $reboot Allow reboot. If set to '0' the VM exit on reboot. - * @param $revert Revert a pending change. - * @param $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). - * @param $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). - * @param $scsihw SCSI controller model + * @param array $parallelN Map host parallel devices (n is 0 to 2). + * @param bool $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. + * @param bool $reboot Allow reboot. If set to '0' the VM exit on reboot. + * @param string $revert Revert a pending change. + * @param array $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). + * @param array $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). + * @param string $scsihw SCSI controller model * Enum: lsi,lsi53c810,virtio-scsi-pci,virtio-scsi-single,megasas,pvscsi - * @param $serialN Create a serial device inside the VM (n is 0 to 3) - * @param $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @param $smbios1 Specify SMBIOS type 1 fields. - * @param $smp The number of CPUs. Please use option -sockets instead. - * @param $sockets The number of CPU sockets. - * @param $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. - * @param $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. - * @param $tablet Enable/disable the USB tablet device. - * @param $tdf Enable/disable time drift fix. - * @param $template Enable/disable Template. - * @param $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. - * @param $usbN Configure an USB device (n is 0 to 4). - * @param $vcpus Number of hotplugged vcpus. - * @param $vga Select the VGA type. + * @param array $serialN Create a serial device inside the VM (n is 0 to 3) + * @param int $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @param string $smbios1 Specify SMBIOS type 1 fields. + * @param int $smp The number of CPUs. Please use option -sockets instead. + * @param int $sockets The number of CPU sockets. + * @param string $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. + * @param string $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. + * @param bool $tablet Enable/disable the USB tablet device. + * @param bool $tdf Enable/disable time drift fix. + * @param bool $template Enable/disable Template. + * @param array $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @param array $usbN Configure an USB device (n is 0 to 4). + * @param int $vcpus Number of hotplugged vcpus. + * @param string $vga Select the VGA type. * Enum: std,cirrus,vmware,qxl,serial0,serial1,serial2,serial3,qxl2,qxl3,qxl4 - * @param $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). - * @param $watchdog Create a virtual hardware watchdog device. - * @return mixed + * @param array $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). + * @param string $watchdog Create a virtual hardware watchdog device. + * @return Result */ public function updateVmAsync($acpi = null, $agent = null, $args = null, $autostart = null, $background_delay = null, $balloon = null, $bios = null, $boot = null, $bootdisk = null, $cdrom = null, $cores = null, $cpu = null, $cpulimit = null, $cpuunits = null, $delete = null, $description = null, $digest = null, $force = null, $freeze = null, $hostpciN = null, $hotplug = null, $hugepages = null, $ideN = null, $keyboard = null, $kvm = null, $localtime = null, $lock = null, $machine = null, $memory = null, $migrate_downtime = null, $migrate_speed = null, $name = null, $netN = null, $numa = null, $numaN = null, $onboot = null, $ostype = null, $parallelN = null, $protection = null, $reboot = null, $revert = null, $sataN = null, $scsiN = null, $scsihw = null, $serialN = null, $shares = null, $skiplock = null, $smbios1 = null, $smp = null, $sockets = null, $startdate = null, $startup = null, $tablet = null, $tdf = null, $template = null, $unusedN = null, $usbN = null, $vcpus = null, $vga = null, $virtioN = null, $watchdog = null) { @@ -3163,78 +3320,79 @@ public function updateVmAsync($acpi = null, $agent = null, $args = null, $autost $this->addIndexedParmeter($parms, 'unused', $unusedN); $this->addIndexedParmeter($parms, 'usb', $usbN); $this->addIndexedParmeter($parms, 'virtio', $virtioN); - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); } /** * Set virtual machine options (synchrounous API) - You should consider using the POST method instead for any actions involving hotplug or storage allocation. - * @param $acpi Enable/disable ACPI. - * @param $agent Enable/disable Qemu GuestAgent. - * @param $args Arbitrary arguments passed to kvm. - * @param $autostart Automatic restart after crash (currently ignored). - * @param $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. - * @param $bios Select BIOS implementation. + * @param bool $acpi Enable/disable ACPI. + * @param bool $agent Enable/disable Qemu GuestAgent. + * @param string $args Arbitrary arguments passed to kvm. + * @param bool $autostart Automatic restart after crash (currently ignored). + * @param int $balloon Amount of target RAM for the VM in MB. Using zero disables the ballon driver. + * @param string $bios Select BIOS implementation. * Enum: seabios,ovmf - * @param $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). - * @param $bootdisk Enable booting from specified disk. - * @param $cdrom This is an alias for option -ide2 - * @param $cores The number of cores per socket. - * @param $cpu Emulated CPU type. - * @param $cpulimit Limit of CPU usage. - * @param $cpuunits CPU weight for a VM. - * @param $delete A list of settings you want to delete. - * @param $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. - * @param $freeze Freeze CPU at startup (use 'c' monitor command to start execution). - * @param $hostpciN Map host PCI devices into guest. - * @param $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. - * @param $hugepages Enable/disable hugepages memory. + * @param string $boot Boot on floppy (a), hard disk (c), CD-ROM (d), or network (n). + * @param string $bootdisk Enable booting from specified disk. + * @param string $cdrom This is an alias for option -ide2 + * @param int $cores The number of cores per socket. + * @param string $cpu Emulated CPU type. + * @param int $cpulimit Limit of CPU usage. + * @param int $cpuunits CPU weight for a VM. + * @param string $delete A list of settings you want to delete. + * @param string $description Description for the VM. Only used on the configuration web interface. This is saved as comment inside the configuration file. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. + * @param bool $freeze Freeze CPU at startup (use 'c' monitor command to start execution). + * @param array $hostpciN Map host PCI devices into guest. + * @param string $hotplug Selectively enable hotplug features. This is a comma separated list of hotplug features: 'network', 'disk', 'cpu', 'memory' and 'usb'. Use '0' to disable hotplug completely. Value '1' is an alias for the default 'network,disk,usb'. + * @param string $hugepages Enable/disable hugepages memory. * Enum: any,2,1024 - * @param $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). - * @param $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. + * @param array $ideN Use volume as IDE hard disk or CD-ROM (n is 0 to 3). + * @param string $keyboard Keybord layout for vnc server. Default is read from the '/etc/pve/datacenter.conf' configuration file. * Enum: de,de-ch,da,en-gb,en-us,es,fi,fr,fr-be,fr-ca,fr-ch,hu,is,it,ja,lt,mk,nl,no,pl,pt,pt-br,sv,sl,tr - * @param $kvm Enable/disable KVM hardware virtualization. - * @param $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. - * @param $lock Lock/unlock the VM. + * @param bool $kvm Enable/disable KVM hardware virtualization. + * @param bool $localtime Set the real time clock to local time. This is enabled by default if ostype indicates a Microsoft OS. + * @param string $lock Lock/unlock the VM. * Enum: migrate,backup,snapshot,rollback - * @param $machine Specific the Qemu machine type. - * @param $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. - * @param $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. - * @param $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. - * @param $name Set a name for the VM. Only used on the configuration web interface. - * @param $netN Specify network devices. - * @param $numa Enable/disable NUMA. - * @param $numaN NUMA topology. - * @param $onboot Specifies whether a VM will be started during system bootup. - * @param $ostype Specify guest operating system. + * @param string $machine Specific the Qemu machine type. + * @param int $memory Amount of RAM for the VM in MB. This is the maximum available memory when you use the balloon device. + * @param int $migrate_downtime Set maximum tolerated downtime (in seconds) for migrations. + * @param int $migrate_speed Set maximum speed (in MB/s) for migrations. Value 0 is no limit. + * @param string $name Set a name for the VM. Only used on the configuration web interface. + * @param array $netN Specify network devices. + * @param bool $numa Enable/disable NUMA. + * @param array $numaN NUMA topology. + * @param bool $onboot Specifies whether a VM will be started during system bootup. + * @param string $ostype Specify guest operating system. * Enum: other,wxp,w2k,w2k3,w2k8,wvista,win7,win8,win10,l24,l26,solaris - * @param $parallelN Map host parallel devices (n is 0 to 2). - * @param $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. - * @param $reboot Allow reboot. If set to '0' the VM exit on reboot. - * @param $revert Revert a pending change. - * @param $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). - * @param $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). - * @param $scsihw SCSI controller model + * @param array $parallelN Map host parallel devices (n is 0 to 2). + * @param bool $protection Sets the protection flag of the VM. This will disable the remove VM and remove disk operations. + * @param bool $reboot Allow reboot. If set to '0' the VM exit on reboot. + * @param string $revert Revert a pending change. + * @param array $sataN Use volume as SATA hard disk or CD-ROM (n is 0 to 5). + * @param array $scsiN Use volume as SCSI hard disk or CD-ROM (n is 0 to 13). + * @param string $scsihw SCSI controller model * Enum: lsi,lsi53c810,virtio-scsi-pci,virtio-scsi-single,megasas,pvscsi - * @param $serialN Create a serial device inside the VM (n is 0 to 3) - * @param $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @param $smbios1 Specify SMBIOS type 1 fields. - * @param $smp The number of CPUs. Please use option -sockets instead. - * @param $sockets The number of CPU sockets. - * @param $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. - * @param $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. - * @param $tablet Enable/disable the USB tablet device. - * @param $tdf Enable/disable time drift fix. - * @param $template Enable/disable Template. - * @param $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. - * @param $usbN Configure an USB device (n is 0 to 4). - * @param $vcpus Number of hotplugged vcpus. - * @param $vga Select the VGA type. + * @param array $serialN Create a serial device inside the VM (n is 0 to 3) + * @param int $shares Amount of memory shares for auto-ballooning. The larger the number is, the more memory this VM gets. Number is relative to weights of all other running VMs. Using zero disables auto-ballooning + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @param string $smbios1 Specify SMBIOS type 1 fields. + * @param int $smp The number of CPUs. Please use option -sockets instead. + * @param int $sockets The number of CPU sockets. + * @param string $startdate Set the initial date of the real time clock. Valid format for date are: 'now' or '2006-06-17T16:01:21' or '2006-06-17'. + * @param string $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. + * @param bool $tablet Enable/disable the USB tablet device. + * @param bool $tdf Enable/disable time drift fix. + * @param bool $template Enable/disable Template. + * @param array $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @param array $usbN Configure an USB device (n is 0 to 4). + * @param int $vcpus Number of hotplugged vcpus. + * @param string $vga Select the VGA type. * Enum: std,cirrus,vmware,qxl,serial0,serial1,serial2,serial3,qxl2,qxl3,qxl4 - * @param $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). - * @param $watchdog Create a virtual hardware watchdog device. + * @param array $virtioN Use volume as VIRTIO hard disk (n is 0 to 15). + * @param string $watchdog Create a virtual hardware watchdog device. + * @return Result */ public function updateVm($acpi = null, $agent = null, $args = null, $autostart = null, $balloon = null, $bios = null, $boot = null, $bootdisk = null, $cdrom = null, $cores = null, $cpu = null, $cpulimit = null, $cpuunits = null, $delete = null, $description = null, $digest = null, $force = null, $freeze = null, $hostpciN = null, $hotplug = null, $hugepages = null, $ideN = null, $keyboard = null, $kvm = null, $localtime = null, $lock = null, $machine = null, $memory = null, $migrate_downtime = null, $migrate_speed = null, $name = null, $netN = null, $numa = null, $numaN = null, $onboot = null, $ostype = null, $parallelN = null, $protection = null, $reboot = null, $revert = null, $sataN = null, $scsiN = null, $scsihw = null, $serialN = null, $shares = null, $skiplock = null, $smbios1 = null, $smp = null, $sockets = null, $startdate = null, $startup = null, $tablet = null, $tdf = null, $template = null, $unusedN = null, $usbN = null, $vcpus = null, $vga = null, $virtioN = null, $watchdog = null) { @@ -3298,7 +3456,7 @@ public function updateVm($acpi = null, $agent = null, $args = null, $autostart = $this->addIndexedParmeter($parms, 'unused', $unusedN); $this->addIndexedParmeter($parms, 'usb', $usbN); $this->addIndexedParmeter($parms, 'virtio', $virtioN); - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/config", $parms); } } @@ -3316,11 +3474,11 @@ function __construct($client, $node, $vmid) /** * Get virtual machine configuration, including pending changes. - * @return mixed + * @return Result */ public function vmPending() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/pending"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/pending"); } } @@ -3338,14 +3496,15 @@ function __construct($client, $node, $vmid) /** * Unlink/delete disk images. - * @param $idlist A list of disk IDs you want to delete. - * @param $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. + * @param string $idlist A list of disk IDs you want to delete. + * @param bool $force Force physical removal. Without this, we simple remove the disk from the config file and create an additional configuration entry called 'unused[n]', which contains the volume ID. Unlink of unused[n] always cause physical removal. + * @return Result */ public function unlink($idlist, $force = null) { $parms = ['idlist' => $idlist, 'force' => $force]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/unlink", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/unlink", $parms); } } @@ -3363,13 +3522,13 @@ function __construct($client, $node, $vmid) /** * Creates a TCP VNC proxy connections. - * @param $websocket starts websockify instead of vncproxy - * @return mixed + * @param bool $websocket starts websockify instead of vncproxy + * @return Result */ public function vncproxy($websocket = null) { $parms = ['websocket' => $websocket]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/vncproxy", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/vncproxy", $parms); } } @@ -3387,15 +3546,15 @@ function __construct($client, $node, $vmid) /** * Opens a weksocket for VNC traffic. - * @param $port Port number returned by previous vncproxy call. - * @param $vncticket Ticket from previous call to vncproxy. - * @return mixed + * @param int $port Port number returned by previous vncproxy call. + * @param string $vncticket Ticket from previous call to vncproxy. + * @return Result */ public function vncwebsocket($port, $vncticket) { $parms = ['port' => $port, 'vncticket' => $vncticket]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/vncwebsocket", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/vncwebsocket", $parms); } } @@ -3413,13 +3572,13 @@ function __construct($client, $node, $vmid) /** * Returns a SPICE configuration to connect to the VM. - * @param $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). - * @return mixed + * @param string $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). + * @return Result */ public function spiceproxy($proxy = null) { $parms = ['proxy' => $proxy]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/spiceproxy", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/spiceproxy", $parms); } } @@ -3486,11 +3645,11 @@ public function getResume() /** * Directory index - * @return mixed + * @return Result */ public function vmcmdidx() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/status"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/status"); } } @@ -3508,11 +3667,11 @@ function __construct($client, $node, $vmid) /** * Get virtual machine status. - * @return mixed + * @return Result */ public function vmStatus() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/status/current"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/status/current"); } } @@ -3530,15 +3689,15 @@ function __construct($client, $node, $vmid) /** * Start virtual machine. - * @param $machine Specific the Qemu machine type. - * @param $migratedfrom The cluster node name. - * @param $migration_network CIDR of the (sub) network that is used for migration. - * @param $migration_type Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. + * @param string $machine Specific the Qemu machine type. + * @param string $migratedfrom The cluster node name. + * @param string $migration_network CIDR of the (sub) network that is used for migration. + * @param string $migration_type Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. * Enum: secure,insecure - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @param $stateuri Some command save/restore state from this location. - * @param $targetstorage Target storage for the migration. (Can be '1' to use the same storage id as on the source node.) - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @param string $stateuri Some command save/restore state from this location. + * @param string $targetstorage Target storage for the migration. (Can be '1' to use the same storage id as on the source node.) + * @return Result */ public function vmStart($machine = null, $migratedfrom = null, $migration_network = null, $migration_type = null, $skiplock = null, $stateuri = null, $targetstorage = null) { @@ -3549,7 +3708,7 @@ public function vmStart($machine = null, $migratedfrom = null, $migration_networ 'skiplock' => $skiplock, 'stateuri' => $stateuri, 'targetstorage' => $targetstorage]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/start", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/start", $parms); } } @@ -3567,11 +3726,11 @@ function __construct($client, $node, $vmid) /** * Stop virtual machine. The qemu process will exit immediately. Thisis akin to pulling the power plug of a running computer and may damage the VM data - * @param $keepActive Do not deactivate storage volumes. - * @param $migratedfrom The cluster node name. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @param $timeout Wait maximal timeout seconds. - * @return mixed + * @param bool $keepActive Do not deactivate storage volumes. + * @param string $migratedfrom The cluster node name. + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @param int $timeout Wait maximal timeout seconds. + * @return Result */ public function vmStop($keepActive = null, $migratedfrom = null, $skiplock = null, $timeout = null) { @@ -3579,7 +3738,7 @@ public function vmStop($keepActive = null, $migratedfrom = null, $skiplock = nul 'migratedfrom' => $migratedfrom, 'skiplock' => $skiplock, 'timeout' => $timeout]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/stop", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/stop", $parms); } } @@ -3597,13 +3756,13 @@ function __construct($client, $node, $vmid) /** * Reset virtual machine. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmReset($skiplock = null) { $parms = ['skiplock' => $skiplock]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/reset", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/reset", $parms); } } @@ -3621,11 +3780,11 @@ function __construct($client, $node, $vmid) /** * Shutdown virtual machine. This is similar to pressing the power button on a physical machine.This will send an ACPI event for the guest OS, which should then proceed to a clean shutdown. - * @param $forceStop Make sure the VM stops. - * @param $keepActive Do not deactivate storage volumes. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @param $timeout Wait maximal timeout seconds. - * @return mixed + * @param bool $forceStop Make sure the VM stops. + * @param bool $keepActive Do not deactivate storage volumes. + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @param int $timeout Wait maximal timeout seconds. + * @return Result */ public function vmShutdown($forceStop = null, $keepActive = null, $skiplock = null, $timeout = null) { @@ -3633,7 +3792,7 @@ public function vmShutdown($forceStop = null, $keepActive = null, $skiplock = nu 'keepActive' => $keepActive, 'skiplock' => $skiplock, 'timeout' => $timeout]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/shutdown", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/shutdown", $parms); } } @@ -3651,13 +3810,13 @@ function __construct($client, $node, $vmid) /** * Suspend virtual machine. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmSuspend($skiplock = null) { $parms = ['skiplock' => $skiplock]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/suspend", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/suspend", $parms); } } @@ -3675,15 +3834,15 @@ function __construct($client, $node, $vmid) /** * Resume virtual machine. - * @param $nocheck - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $nocheck + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmResume($nocheck = null, $skiplock = null) { $parms = ['nocheck' => $nocheck, 'skiplock' => $skiplock]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/resume", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/status/resume", $parms); } } @@ -3701,14 +3860,15 @@ function __construct($client, $node, $vmid) /** * Send key event to virtual machine. - * @param $key The key (qemu monitor encoding). - * @param $skiplock Ignore locks - only root is allowed to use this option. + * @param string $key The key (qemu monitor encoding). + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmSendkey($key, $skiplock = null) { $parms = ['key' => $key, 'skiplock' => $skiplock]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/sendkey", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/sendkey", $parms); } } @@ -3726,16 +3886,16 @@ function __construct($client, $node, $vmid) /** * Check if feature for virtual machine is available. - * @param $feature Feature to check. + * @param string $feature Feature to check. * Enum: snapshot,clone,copy - * @param $snapname The name of the snapshot. - * @return mixed + * @param string $snapname The name of the snapshot. + * @return Result */ public function vmFeature($feature, $snapname = null) { $parms = ['feature' => $feature, 'snapname' => $snapname]; - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/feature", $parms); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/feature", $parms); } } @@ -3753,17 +3913,17 @@ function __construct($client, $node, $vmid) /** * Create a copy of virtual machine/template. - * @param $newid VMID for the clone. - * @param $description Description for the new VM. - * @param $format Target format for file storage. + * @param int $newid VMID for the clone. + * @param string $description Description for the new VM. + * @param string $format Target format for file storage. * Enum: raw,qcow2,vmdk - * @param $full Create a full copy of all disk. This is always done when you clone a normal VM. For VM templates, we try to create a linked clone by default. - * @param $name Set a name for the new VM. - * @param $pool Add the new VM to the specified pool. - * @param $snapname The name of the snapshot. - * @param $storage Target storage for full clone. - * @param $target Target node. Only allowed if the original VM is on shared storage. - * @return mixed + * @param bool $full Create a full copy of all disk. This is always done when you clone a normal VM. For VM templates, we try to create a linked clone by default. + * @param string $name Set a name for the new VM. + * @param string $pool Add the new VM to the specified pool. + * @param string $snapname The name of the snapshot. + * @param string $storage Target storage for full clone. + * @param string $target Target node. Only allowed if the original VM is on shared storage. + * @return Result */ public function cloneVm($newid, $description = null, $format = null, $full = null, $name = null, $pool = null, $snapname = null, $storage = null, $target = null) { @@ -3776,7 +3936,7 @@ public function cloneVm($newid, $description = null, $format = null, $full = nul 'snapname' => $snapname, 'storage' => $storage, 'target' => $target]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/clone", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/clone", $parms); } } @@ -3794,14 +3954,14 @@ function __construct($client, $node, $vmid) /** * Move volume to different storage. - * @param $disk The disk you want to move. + * @param string $disk The disk you want to move. * Enum: ide0,ide1,ide2,ide3,scsi0,scsi1,scsi2,scsi3,scsi4,scsi5,scsi6,scsi7,scsi8,scsi9,scsi10,scsi11,scsi12,scsi13,virtio0,virtio1,virtio2,virtio3,virtio4,virtio5,virtio6,virtio7,virtio8,virtio9,virtio10,virtio11,virtio12,virtio13,virtio14,virtio15,sata0,sata1,sata2,sata3,sata4,sata5,efidisk0 - * @param $storage Target storage. - * @param $delete Delete the original disk after successful copy. By default the original disk is kept as unused disk. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $format Target Format. + * @param string $storage Target storage. + * @param bool $delete Delete the original disk after successful copy. By default the original disk is kept as unused disk. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $format Target Format. * Enum: raw,qcow2,vmdk - * @return mixed + * @return Result */ public function moveVmDisk($disk, $storage, $delete = null, $digest = null, $format = null) { @@ -3810,7 +3970,7 @@ public function moveVmDisk($disk, $storage, $delete = null, $digest = null, $for 'delete' => $delete, 'digest' => $digest, 'format' => $format]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/move_disk", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/move_disk", $parms); } } @@ -3828,15 +3988,15 @@ function __construct($client, $node, $vmid) /** * Migrate virtual machine. Creates a new migration task. - * @param $target Target node. - * @param $force Allow to migrate VMs which use local devices. Only root may use this option. - * @param $migration_network CIDR of the (sub) network that is used for migration. - * @param $migration_type Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. + * @param string $target Target node. + * @param bool $force Allow to migrate VMs which use local devices. Only root may use this option. + * @param string $migration_network CIDR of the (sub) network that is used for migration. + * @param string $migration_type Migration traffic is encrypted using an SSH tunnel by default. On secure, completely private networks this can be disabled to increase performance. * Enum: secure,insecure - * @param $online Use online/live migration. - * @param $targetstorage Default target storage. - * @param $with_local_disks Enable live storage migration for local disk - * @return mixed + * @param bool $online Use online/live migration. + * @param string $targetstorage Default target storage. + * @param bool $with_local_disks Enable live storage migration for local disk + * @return Result */ public function migrateVm($target, $force = null, $migration_network = null, $migration_type = null, $online = null, $targetstorage = null, $with_local_disks = null) { @@ -3847,7 +4007,7 @@ public function migrateVm($target, $force = null, $migration_network = null, $mi 'online' => $online, 'targetstorage' => $targetstorage, 'with-local-disks' => $with_local_disks]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/migrate", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/migrate", $parms); } } @@ -3865,13 +4025,13 @@ function __construct($client, $node, $vmid) /** * Execute Qemu monitor commands. - * @param $command The monitor command. - * @return mixed + * @param string $command The monitor command. + * @return Result */ public function monitor($command) { $parms = ['command' => $command]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/monitor", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/monitor", $parms); } } @@ -3889,14 +4049,14 @@ function __construct($client, $node, $vmid) /** * Execute Qemu Guest Agent commands. - * @param $command The QGA command. + * @param string $command The QGA command. * Enum: ping,get-time,info,fsfreeze-status,fsfreeze-freeze,fsfreeze-thaw,fstrim,network-get-interfaces,get-vcpus,get-fsinfo,get-memory-blocks,get-memory-block-info,suspend-hybrid,suspend-ram,suspend-disk,shutdown - * @return mixed + * @return Result */ public function agent($command) { $parms = ['command' => $command]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/agent", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/agent", $parms); } } @@ -3914,11 +4074,12 @@ function __construct($client, $node, $vmid) /** * Extend volume size. - * @param $disk The disk you want to resize. + * @param string $disk The disk you want to resize. * Enum: ide0,ide1,ide2,ide3,scsi0,scsi1,scsi2,scsi3,scsi4,scsi5,scsi6,scsi7,scsi8,scsi9,scsi10,scsi11,scsi12,scsi13,virtio0,virtio1,virtio2,virtio3,virtio4,virtio5,virtio6,virtio7,virtio8,virtio9,virtio10,virtio11,virtio12,virtio13,virtio14,virtio15,sata0,sata1,sata2,sata3,sata4,sata5,efidisk0 - * @param $size The new size. With the `+` sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $skiplock Ignore locks - only root is allowed to use this option. + * @param string $size The new size. With the `+` sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function resizeVm($disk, $size, $digest = null, $skiplock = null) { @@ -3926,7 +4087,7 @@ public function resizeVm($disk, $size, $digest = null, $skiplock = null) 'size' => $size, 'digest' => $digest, 'skiplock' => $skiplock]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/resize", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/resize", $parms); } } @@ -3949,26 +4110,26 @@ public function get($snapname) /** * List all snapshots. - * @return mixed + * @return Result */ public function snapshotList() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot"); } /** * Snapshot a VM. - * @param $snapname The name of the snapshot. - * @param $description A textual description or comment. - * @param $vmstate Save the vmstate - * @return mixed + * @param string $snapname The name of the snapshot. + * @param string $description A textual description or comment. + * @param bool $vmstate Save the vmstate + * @return Result */ public function snapshot($snapname, $description = null, $vmstate = null) { $parms = ['snapname' => $snapname, 'description' => $description, 'vmstate' => $vmstate]; - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot", $parms); } } @@ -4002,22 +4163,22 @@ public function getRollback() /** * Delete a VM snapshot. - * @param $force For removal from config file, even if removing disk snapshots fails. - * @return mixed + * @param bool $force For removal from config file, even if removing disk snapshots fails. + * @return Result */ public function delsnapshot($force = null) { $parms = ['force' => $force]; - return $this->client->delete("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}", $parms); } /** * - * @return mixed + * @return Result */ public function snapshotCmdIdx() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}"); } } @@ -4037,21 +4198,22 @@ function __construct($client, $node, $vmid, $snapname) /** * Get snapshot configuration - * @return mixed + * @return Result */ public function getSnapshotConfig() { - return $this->client->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/config"); + return $this->getClient()->get("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/config"); } /** * Update snapshot metadata. - * @param $description A textual description or comment. + * @param string $description A textual description or comment. + * @return Result */ public function updateSnapshotConfig($description = null) { $parms = ['description' => $description]; - $this->client->put("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/config", $parms); + return $this->getClient()->put("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/config", $parms); } } @@ -4071,11 +4233,11 @@ function __construct($client, $node, $vmid, $snapname) /** * Rollback VM state to specified snapshot. - * @return mixed + * @return Result */ public function rollback() { - return $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/rollback"); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/snapshot/{$this->snapname}/rollback"); } } @@ -4093,13 +4255,14 @@ function __construct($client, $node, $vmid) /** * Create a Template. - * @param $disk If you want to convert only 1 disk to base image. + * @param string $disk If you want to convert only 1 disk to base image. * Enum: ide0,ide1,ide2,ide3,scsi0,scsi1,scsi2,scsi3,scsi4,scsi5,scsi6,scsi7,scsi8,scsi9,scsi10,scsi11,scsi12,scsi13,virtio0,virtio1,virtio2,virtio3,virtio4,virtio5,virtio6,virtio7,virtio8,virtio9,virtio10,virtio11,virtio12,virtio13,virtio14,virtio15,sata0,sata1,sata2,sata3,sata4,sata5,efidisk0 + * @return Result */ public function template($disk = null) { $parms = ['disk' => $disk]; - $this->client->post("/nodes/{$this->node}/qemu/{$this->vmid}/template", $parms); + return $this->getClient()->post("/nodes/{$this->node}/qemu/{$this->vmid}/template", $parms); } } @@ -4120,53 +4283,53 @@ public function get($vmid) /** * LXC container index (per node). - * @return mixed + * @return Result */ public function vmlist() { - return $this->client->get("/nodes/{$this->node}/lxc"); + return $this->getClient()->get("/nodes/{$this->node}/lxc"); } /** * Create or restore a container. - * @param $ostemplate The OS template or backup file. - * @param $vmid The (unique) ID of the VM. - * @param $arch OS architecture type. + * @param string $ostemplate The OS template or backup file. + * @param int $vmid The (unique) ID of the VM. + * @param string $arch OS architecture type. * Enum: amd64,i386 - * @param $cmode Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login). + * @param string $cmode Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login). * Enum: shell,console,tty - * @param $console Attach a console device (/dev/console) to the container. - * @param $cores The number of cores assigned to the container. A container can use all available cores by default. - * @param $cpulimit Limit of CPU usage. NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit. - * @param $cpuunits CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to the weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. - * @param $description Container description. Only used on the configuration web interface. - * @param $force Allow to overwrite existing container. - * @param $hostname Set a host name for the container. - * @param $ignore_unpack_errors Ignore errors when extracting the template. - * @param $lock Lock/unlock the VM. + * @param bool $console Attach a console device (/dev/console) to the container. + * @param int $cores The number of cores assigned to the container. A container can use all available cores by default. + * @param int $cpulimit Limit of CPU usage. NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit. + * @param int $cpuunits CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to the weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. + * @param string $description Container description. Only used on the configuration web interface. + * @param bool $force Allow to overwrite existing container. + * @param string $hostname Set a host name for the container. + * @param bool $ignore_unpack_errors Ignore errors when extracting the template. + * @param string $lock Lock/unlock the VM. * Enum: migrate,backup,snapshot,rollback - * @param $memory Amount of RAM for the VM in MB. - * @param $mpN Use volume as container mount point. - * @param $nameserver Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. - * @param $netN Specifies network interfaces for the container. - * @param $onboot Specifies whether a VM will be started during system bootup. - * @param $ostype OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/&lt;ostype&gt;.common.conf. Value 'unmanaged' can be used to skip and OS specific setup. + * @param int $memory Amount of RAM for the VM in MB. + * @param array $mpN Use volume as container mount point. + * @param string $nameserver Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. + * @param array $netN Specifies network interfaces for the container. + * @param bool $onboot Specifies whether a VM will be started during system bootup. + * @param string $ostype OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/&lt;ostype&gt;.common.conf. Value 'unmanaged' can be used to skip and OS specific setup. * Enum: debian,ubuntu,centos,fedora,opensuse,archlinux,alpine,gentoo,unmanaged - * @param $password Sets root password inside container. - * @param $pool Add the VM to the specified pool. - * @param $protection Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation. - * @param $restore Mark this as restore task. - * @param $rootfs Use volume as container root. - * @param $searchdomain Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. - * @param $ssh_public_keys Setup public SSH keys (one key per line, OpenSSH format). - * @param $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. - * @param $storage Default Storage. - * @param $swap Amount of SWAP for the VM in MB. - * @param $template Enable/disable Template. - * @param $tty Specify the number of tty available to the container - * @param $unprivileged Makes the container run as unprivileged user. (Should not be modified manually.) - * @param $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. - * @return mixed + * @param string $password Sets root password inside container. + * @param string $pool Add the VM to the specified pool. + * @param bool $protection Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation. + * @param bool $restore Mark this as restore task. + * @param string $rootfs Use volume as container root. + * @param string $searchdomain Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. + * @param string $ssh_public_keys Setup public SSH keys (one key per line, OpenSSH format). + * @param string $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. + * @param string $storage Default Storage. + * @param int $swap Amount of SWAP for the VM in MB. + * @param bool $template Enable/disable Template. + * @param int $tty Specify the number of tty available to the container + * @param bool $unprivileged Makes the container run as unprivileged user. (Should not be modified manually.) + * @param array $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @return Result */ public function createVm($ostemplate, $vmid, $arch = null, $cmode = null, $console = null, $cores = null, $cpulimit = null, $cpuunits = null, $description = null, $force = null, $hostname = null, $ignore_unpack_errors = null, $lock = null, $memory = null, $mpN = null, $nameserver = null, $netN = null, $onboot = null, $ostype = null, $password = null, $pool = null, $protection = null, $restore = null, $rootfs = null, $searchdomain = null, $ssh_public_keys = null, $startup = null, $storage = null, $swap = null, $template = null, $tty = null, $unprivileged = null, $unusedN = null) { @@ -4203,7 +4366,7 @@ public function createVm($ostemplate, $vmid, $arch = null, $cmode = null, $conso $this->addIndexedParmeter($parms, 'mp', $mpN); $this->addIndexedParmeter($parms, 'net', $netN); $this->addIndexedParmeter($parms, 'unused', $unusedN); - return $this->client->post("/nodes/{$this->node}/lxc", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc", $parms); } } @@ -4319,20 +4482,20 @@ public function getResize() /** * Destroy the container (also delete all uses files). - * @return mixed + * @return Result */ public function destroyVm() { - return $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}"); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}"); } /** * Directory index - * @return mixed + * @return Result */ public function vmdiridx() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}"); } } @@ -4350,45 +4513,46 @@ function __construct($client, $node, $vmid) /** * Get container configuration. - * @return mixed + * @return Result */ public function vmConfig() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/config"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/config"); } /** * Set container options. - * @param $arch OS architecture type. + * @param string $arch OS architecture type. * Enum: amd64,i386 - * @param $cmode Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login). + * @param string $cmode Console mode. By default, the console command tries to open a connection to one of the available tty devices. By setting cmode to 'console' it tries to attach to /dev/console instead. If you set cmode to 'shell', it simply invokes a shell inside the container (no login). * Enum: shell,console,tty - * @param $console Attach a console device (/dev/console) to the container. - * @param $cores The number of cores assigned to the container. A container can use all available cores by default. - * @param $cpulimit Limit of CPU usage. NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit. - * @param $cpuunits CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to the weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. - * @param $delete A list of settings you want to delete. - * @param $description Container description. Only used on the configuration web interface. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $hostname Set a host name for the container. - * @param $lock Lock/unlock the VM. + * @param bool $console Attach a console device (/dev/console) to the container. + * @param int $cores The number of cores assigned to the container. A container can use all available cores by default. + * @param int $cpulimit Limit of CPU usage. NOTE: If the computer has 2 CPUs, it has a total of '2' CPU time. Value '0' indicates no CPU limit. + * @param int $cpuunits CPU weight for a VM. Argument is used in the kernel fair scheduler. The larger the number is, the more CPU time this VM gets. Number is relative to the weights of all the other running VMs. NOTE: You can disable fair-scheduler configuration by setting this to 0. + * @param string $delete A list of settings you want to delete. + * @param string $description Container description. Only used on the configuration web interface. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $hostname Set a host name for the container. + * @param string $lock Lock/unlock the VM. * Enum: migrate,backup,snapshot,rollback - * @param $memory Amount of RAM for the VM in MB. - * @param $mpN Use volume as container mount point. - * @param $nameserver Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. - * @param $netN Specifies network interfaces for the container. - * @param $onboot Specifies whether a VM will be started during system bootup. - * @param $ostype OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/&lt;ostype&gt;.common.conf. Value 'unmanaged' can be used to skip and OS specific setup. + * @param int $memory Amount of RAM for the VM in MB. + * @param array $mpN Use volume as container mount point. + * @param string $nameserver Sets DNS server IP address for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. + * @param array $netN Specifies network interfaces for the container. + * @param bool $onboot Specifies whether a VM will be started during system bootup. + * @param string $ostype OS type. This is used to setup configuration inside the container, and corresponds to lxc setup scripts in /usr/share/lxc/config/&lt;ostype&gt;.common.conf. Value 'unmanaged' can be used to skip and OS specific setup. * Enum: debian,ubuntu,centos,fedora,opensuse,archlinux,alpine,gentoo,unmanaged - * @param $protection Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation. - * @param $rootfs Use volume as container root. - * @param $searchdomain Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. - * @param $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. - * @param $swap Amount of SWAP for the VM in MB. - * @param $template Enable/disable Template. - * @param $tty Specify the number of tty available to the container - * @param $unprivileged Makes the container run as unprivileged user. (Should not be modified manually.) - * @param $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @param bool $protection Sets the protection flag of the container. This will prevent the CT or CT's disk remove/update operation. + * @param string $rootfs Use volume as container root. + * @param string $searchdomain Sets DNS search domains for a container. Create will automatically use the setting from the host if you neither set searchdomain nor nameserver. + * @param string $startup Startup and shutdown behavior. Order is a non-negative number defining the general startup order. Shutdown in done with reverse ordering. Additionally you can set the 'up' or 'down' delay in seconds, which specifies a delay to wait before the next VM is started or stopped. + * @param int $swap Amount of SWAP for the VM in MB. + * @param bool $template Enable/disable Template. + * @param int $tty Specify the number of tty available to the container + * @param bool $unprivileged Makes the container run as unprivileged user. (Should not be modified manually.) + * @param array $unusedN Reference to unused volumes. This is used internally, and should not be modified manually. + * @return Result */ public function updateVm($arch = null, $cmode = null, $console = null, $cores = null, $cpulimit = null, $cpuunits = null, $delete = null, $description = null, $digest = null, $hostname = null, $lock = null, $memory = null, $mpN = null, $nameserver = null, $netN = null, $onboot = null, $ostype = null, $protection = null, $rootfs = null, $searchdomain = null, $startup = null, $swap = null, $template = null, $tty = null, $unprivileged = null, $unusedN = null) { @@ -4418,7 +4582,7 @@ public function updateVm($arch = null, $cmode = null, $console = null, $cores = $this->addIndexedParmeter($parms, 'mp', $mpN); $this->addIndexedParmeter($parms, 'net', $netN); $this->addIndexedParmeter($parms, 'unused', $unusedN); - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/config", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/config", $parms); } } @@ -4478,11 +4642,11 @@ public function getResume() /** * Directory index - * @return mixed + * @return Result */ public function vmcmdidx() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/status"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/status"); } } @@ -4500,11 +4664,11 @@ function __construct($client, $node, $vmid) /** * Get virtual machine status. - * @return mixed + * @return Result */ public function vmStatus() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/status/current"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/status/current"); } } @@ -4522,13 +4686,13 @@ function __construct($client, $node, $vmid) /** * Start the container. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmStart($skiplock = null) { $parms = ['skiplock' => $skiplock]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/start", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/start", $parms); } } @@ -4546,13 +4710,13 @@ function __construct($client, $node, $vmid) /** * Stop the container. This will abruptly stop all processes running in the container. - * @param $skiplock Ignore locks - only root is allowed to use this option. - * @return mixed + * @param bool $skiplock Ignore locks - only root is allowed to use this option. + * @return Result */ public function vmStop($skiplock = null) { $parms = ['skiplock' => $skiplock]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/stop", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/stop", $parms); } } @@ -4570,15 +4734,15 @@ function __construct($client, $node, $vmid) /** * Shutdown the container. This will trigger a clean shutdown of the container, see lxc-stop(1) for details. - * @param $forceStop Make sure the Container stops. - * @param $timeout Wait maximal timeout seconds. - * @return mixed + * @param bool $forceStop Make sure the Container stops. + * @param int $timeout Wait maximal timeout seconds. + * @return Result */ public function vmShutdown($forceStop = null, $timeout = null) { $parms = ['forceStop' => $forceStop, 'timeout' => $timeout]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/shutdown", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/shutdown", $parms); } } @@ -4596,11 +4760,11 @@ function __construct($client, $node, $vmid) /** * Suspend the container. - * @return mixed + * @return Result */ public function vmSuspend() { - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/suspend"); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/suspend"); } } @@ -4618,11 +4782,11 @@ function __construct($client, $node, $vmid) /** * Resume the container. - * @return mixed + * @return Result */ public function vmResume() { - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/resume"); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/status/resume"); } } @@ -4645,24 +4809,24 @@ public function get($snapname) /** * List all snapshots. - * @return mixed + * @return Result */ public function list_() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot"); } /** * Snapshot a container. - * @param $snapname The name of the snapshot. - * @param $description A textual description or comment. - * @return mixed + * @param string $snapname The name of the snapshot. + * @param string $description A textual description or comment. + * @return Result */ public function snapshot($snapname, $description = null) { $parms = ['snapname' => $snapname, 'description' => $description]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot", $parms); } } @@ -4696,22 +4860,22 @@ public function getConfig() /** * Delete a LXC snapshot. - * @param $force For removal from config file, even if removing disk snapshots fails. - * @return mixed + * @param bool $force For removal from config file, even if removing disk snapshots fails. + * @return Result */ public function delsnapshot($force = null) { $parms = ['force' => $force]; - return $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}", $parms); } /** * - * @return mixed + * @return Result */ public function snapshotCmdIdx() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}"); } } @@ -4731,11 +4895,11 @@ function __construct($client, $node, $vmid, $snapname) /** * Rollback LXC state to specified snapshot. - * @return mixed + * @return Result */ public function rollback() { - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/rollback"); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/rollback"); } } @@ -4755,21 +4919,22 @@ function __construct($client, $node, $vmid, $snapname) /** * Get snapshot configuration - * @return mixed + * @return Result */ public function getSnapshotConfig() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/config"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/config"); } /** * Update snapshot metadata. - * @param $description A textual description or comment. + * @param string $description A textual description or comment. + * @return Result */ public function updateSnapshotConfig($description = null) { $parms = ['description' => $description]; - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/config", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/snapshot/{$this->snapname}/config", $parms); } } @@ -4829,11 +4994,11 @@ public function getRefs() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall"); } } @@ -4856,29 +5021,30 @@ public function get($pos) /** * List rules. - * @return mixed + * @return Result */ public function getRules() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules"); } /** * Create new rule. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $type Rule type. * Enum: in,out,group - * @param $comment Descriptive comment. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $pos Update rule at position &lt;pos&gt;. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $comment Descriptive comment. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $pos Update rule at position &lt;pos&gt;. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @return Result */ public function createRule($action, $type, $comment = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $pos = null, $proto = null, $source = null, $sport = null) { @@ -4895,7 +5061,7 @@ public function createRule($action, $type, $comment = null, $dest = null, $diges 'proto' => $proto, 'source' => $source, 'sport' => $sport]; - $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules", $parms); } } @@ -4915,40 +5081,42 @@ function __construct($client, $node, $vmid, $pos) /** * Delete rule. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function deleteRule($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}", $parms); } /** * Get single rule data. - * @return mixed + * @return Result */ public function getRule() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}"); } /** * Modify rule data. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $comment Descriptive comment. - * @param $delete A list of settings you want to delete. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $comment Descriptive comment. + * @param string $delete A list of settings you want to delete. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $type Rule type. * Enum: in,out,group + * @return Result */ public function updateRule($action = null, $comment = null, $delete = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $moveto = null, $proto = null, $source = null, $sport = null, $type = null) { @@ -4966,7 +5134,7 @@ public function updateRule($action = null, $comment = null, $delete = null, $des 'source' => $source, 'sport' => $sport, 'type' => $type]; - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/rules/{$this->pos}", $parms); } } @@ -4989,25 +5157,26 @@ public function get($name) /** * List aliases - * @return mixed + * @return Result */ public function getAliases() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases"); } /** * Create IP or Network Alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $name Alias name. - * @param $comment + * @param string $cidr Network/IP specification in CIDR format. + * @param string $name Alias name. + * @param string $comment + * @return Result */ public function createAlias($cidr, $name, $comment = null) { $parms = ['cidr' => $cidr, 'name' => $name, 'comment' => $comment]; - $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases", $parms); } } @@ -5027,29 +5196,31 @@ function __construct($client, $node, $vmid, $name) /** * Remove IP or Network alias. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeAlias($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}", $parms); } /** * Read alias. - * @return mixed + * @return Result */ public function readAlias() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}"); } /** * Update IP or Network alias. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing alias. + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing alias. + * @return Result */ public function updateAlias($cidr, $comment = null, $digest = null, $rename = null) { @@ -5057,7 +5228,7 @@ public function updateAlias($cidr, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/aliases/{$this->name}", $parms); } } @@ -5080,19 +5251,20 @@ public function get($name) /** * List IPSets - * @return mixed + * @return Result */ public function ipsetIndex() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset"); } /** * Create new IPSet - * @param $name IP set name. - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @param string $name IP set name. + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $rename Rename an existing IPSet. You can set 'rename' to the same value as 'name' to update the 'comment' of an existing IPSet. + * @return Result */ public function createIpset($name, $comment = null, $digest = null, $rename = null) { @@ -5100,7 +5272,7 @@ public function createIpset($name, $comment = null, $digest = null, $rename = nu 'comment' => $comment, 'digest' => $digest, 'rename' => $rename]; - $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset", $parms); } } @@ -5125,33 +5297,35 @@ public function get($cidr) /** * Delete IPSet + * @return Result */ public function deleteIpset() { - $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}"); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}"); } /** * List IPSet content - * @return mixed + * @return Result */ public function getIpset() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}"); } /** * Add IP or Network to IPSet. - * @param $cidr Network/IP specification in CIDR format. - * @param $comment - * @param $nomatch + * @param string $cidr Network/IP specification in CIDR format. + * @param string $comment + * @param bool $nomatch + * @return Result */ public function createIp($cidr, $comment = null, $nomatch = null) { $parms = ['cidr' => $cidr, 'comment' => $comment, 'nomatch' => $nomatch]; - $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}", $parms); } } @@ -5173,35 +5347,37 @@ function __construct($client, $node, $vmid, $name, $cidr) /** * Remove IP or Network from IPSet. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function removeIp($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } /** * Read IP or Network settings from IPSet. - * @return mixed + * @return Result */ public function readIp() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}"); } /** * Update IP or Network settings - * @param $comment - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $nomatch + * @param string $comment + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $nomatch + * @return Result */ public function updateIp($comment = null, $digest = null, $nomatch = null) { $parms = ['comment' => $comment, 'digest' => $digest, 'nomatch' => $nomatch]; - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/ipset/{$this->name}/{$this->cidr}", $parms); } } @@ -5219,31 +5395,32 @@ function __construct($client, $node, $vmid) /** * Get VM firewall options. - * @return mixed + * @return Result */ public function getOptions() { - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/options"); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/options"); } /** * Set Firewall options. - * @param $delete A list of settings you want to delete. - * @param $dhcp Enable DHCP. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $enable Enable/disable firewall rules. - * @param $ipfilter Enable default IP filters. This is equivalent to adding an empty ipfilter-net&lt;id&gt; ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added. - * @param $log_level_in Log level for incoming traffic. + * @param string $delete A list of settings you want to delete. + * @param bool $dhcp Enable DHCP. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $enable Enable/disable firewall rules. + * @param bool $ipfilter Enable default IP filters. This is equivalent to adding an empty ipfilter-net&lt;id&gt; ipset for every interface. Such ipsets implicitly contain sane default restrictions such as restricting IPv6 link local addresses to the one derived from the interface's MAC address. For containers the configured IP addresses will be implicitly added. + * @param string $log_level_in Log level for incoming traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $log_level_out Log level for outgoing traffic. + * @param string $log_level_out Log level for outgoing traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $macfilter Enable/disable MAC address filter. - * @param $ndp Enable NDP. - * @param $policy_in Input policy. + * @param bool $macfilter Enable/disable MAC address filter. + * @param bool $ndp Enable NDP. + * @param string $policy_in Input policy. * Enum: ACCEPT,REJECT,DROP - * @param $policy_out Output policy. + * @param string $policy_out Output policy. * Enum: ACCEPT,REJECT,DROP - * @param $radv Allow sending Router Advertisement. + * @param bool $radv Allow sending Router Advertisement. + * @return Result */ public function setOptions($delete = null, $dhcp = null, $digest = null, $enable = null, $ipfilter = null, $log_level_in = null, $log_level_out = null, $macfilter = null, $ndp = null, $policy_in = null, $policy_out = null, $radv = null) { @@ -5259,7 +5436,7 @@ public function setOptions($delete = null, $dhcp = null, $digest = null, $enable 'policy_in' => $policy_in, 'policy_out' => $policy_out, 'radv' => $radv]; - $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/options", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/options", $parms); } } @@ -5277,15 +5454,15 @@ function __construct($client, $node, $vmid) /** * Read firewall log - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function log($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/log", $parms); } } @@ -5303,14 +5480,14 @@ function __construct($client, $node, $vmid) /** * Lists possible IPSet/Alias reference which are allowed in source/dest properties. - * @param $type Only list references of specified type. + * @param string $type Only list references of specified type. * Enum: alias,ipset - * @return mixed + * @return Result */ public function refs($type = null) { $parms = ['type' => $type]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/refs", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/firewall/refs", $parms); } } @@ -5328,19 +5505,19 @@ function __construct($client, $node, $vmid) /** * Read VM RRD statistics (returns PNG) - * @param $ds The list of datasources you want to display. - * @param $timeframe Specify the time frame you are interested in. + * @param string $ds The list of datasources you want to display. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrd($ds, $timeframe, $cf = null) { $parms = ['ds' => $ds, 'timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/rrd", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/rrd", $parms); } } @@ -5358,17 +5535,17 @@ function __construct($client, $node, $vmid) /** * Read VM RRD statistics - * @param $timeframe Specify the time frame you are interested in. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrddata($timeframe, $cf = null) { $parms = ['timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/rrddata", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/rrddata", $parms); } } @@ -5386,17 +5563,17 @@ function __construct($client, $node, $vmid) /** * Creates a TCP VNC proxy connections. - * @param $height sets the height of the console in pixels. - * @param $websocket use websocket instead of standard VNC. - * @param $width sets the width of the console in pixels. - * @return mixed + * @param int $height sets the height of the console in pixels. + * @param bool $websocket use websocket instead of standard VNC. + * @param int $width sets the width of the console in pixels. + * @return Result */ public function vncproxy($height = null, $websocket = null, $width = null) { $parms = ['height' => $height, 'websocket' => $websocket, 'width' => $width]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/vncproxy", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/vncproxy", $parms); } } @@ -5414,15 +5591,15 @@ function __construct($client, $node, $vmid) /** * Opens a weksocket for VNC traffic. - * @param $port Port number returned by previous vncproxy call. - * @param $vncticket Ticket from previous call to vncproxy. - * @return mixed + * @param int $port Port number returned by previous vncproxy call. + * @param string $vncticket Ticket from previous call to vncproxy. + * @return Result */ public function vncwebsocket($port, $vncticket) { $parms = ['port' => $port, 'vncticket' => $vncticket]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/vncwebsocket", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/vncwebsocket", $parms); } } @@ -5440,13 +5617,13 @@ function __construct($client, $node, $vmid) /** * Returns a SPICE configuration to connect to the CT. - * @param $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). - * @return mixed + * @param string $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). + * @return Result */ public function spiceproxy($proxy = null) { $parms = ['proxy' => $proxy]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/spiceproxy", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/spiceproxy", $parms); } } @@ -5464,12 +5641,12 @@ function __construct($client, $node, $vmid) /** * Migrate the container to another node. Creates a new migration task. - * @param $target Target node. - * @param $force Force migration despite local bind / device mounts. NOTE: deprecated, use 'shared' property of mount point instead. - * @param $online Use online/live migration. - * @param $restart Use restart migration - * @param $timeout Timeout in seconds for shutdown for restart migration - * @return mixed + * @param string $target Target node. + * @param bool $force Force migration despite local bind / device mounts. NOTE: deprecated, use 'shared' property of mount point instead. + * @param bool $online Use online/live migration. + * @param bool $restart Use restart migration + * @param int $timeout Timeout in seconds for shutdown for restart migration + * @return Result */ public function migrateVm($target, $force = null, $online = null, $restart = null, $timeout = null) { @@ -5478,7 +5655,7 @@ public function migrateVm($target, $force = null, $online = null, $restart = nul 'online' => $online, 'restart' => $restart, 'timeout' => $timeout]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/migrate", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/migrate", $parms); } } @@ -5496,16 +5673,16 @@ function __construct($client, $node, $vmid) /** * Check if feature for virtual machine is available. - * @param $feature Feature to check. + * @param string $feature Feature to check. * Enum: snapshot - * @param $snapname The name of the snapshot. - * @return mixed + * @param string $snapname The name of the snapshot. + * @return Result */ public function vmFeature($feature, $snapname = null) { $parms = ['feature' => $feature, 'snapname' => $snapname]; - return $this->client->get("/nodes/{$this->node}/lxc/{$this->vmid}/feature", $parms); + return $this->getClient()->get("/nodes/{$this->node}/lxc/{$this->vmid}/feature", $parms); } } @@ -5523,12 +5700,13 @@ function __construct($client, $node, $vmid) /** * Create a Template. - * @param $experimental The template feature is experimental, set this flag if you know what you are doing. + * @param bool $experimental The template feature is experimental, set this flag if you know what you are doing. + * @return Result */ public function template($experimental) { $parms = ['experimental' => $experimental]; - $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/template", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/template", $parms); } } @@ -5546,15 +5724,15 @@ function __construct($client, $node, $vmid) /** * Create a container clone/copy - * @param $experimental The clone feature is experimental, set this flag if you know what you are doing. - * @param $newid VMID for the clone. - * @param $description Description for the new CT. - * @param $full Create a full copy of all disk. This is always done when you clone a normal CT. For CT templates, we try to create a linked clone by default. - * @param $hostname Set a hostname for the new CT. - * @param $pool Add the new CT to the specified pool. - * @param $snapname The name of the snapshot. - * @param $storage Target storage for full clone. - * @return mixed + * @param bool $experimental The clone feature is experimental, set this flag if you know what you are doing. + * @param int $newid VMID for the clone. + * @param string $description Description for the new CT. + * @param bool $full Create a full copy of all disk. This is always done when you clone a normal CT. For CT templates, we try to create a linked clone by default. + * @param string $hostname Set a hostname for the new CT. + * @param string $pool Add the new CT to the specified pool. + * @param string $snapname The name of the snapshot. + * @param string $storage Target storage for full clone. + * @return Result */ public function cloneVm($experimental, $newid, $description = null, $full = null, $hostname = null, $pool = null, $snapname = null, $storage = null) { @@ -5566,7 +5744,7 @@ public function cloneVm($experimental, $newid, $description = null, $full = null 'pool' => $pool, 'snapname' => $snapname, 'storage' => $storage]; - return $this->client->post("/nodes/{$this->node}/lxc/{$this->vmid}/clone", $parms); + return $this->getClient()->post("/nodes/{$this->node}/lxc/{$this->vmid}/clone", $parms); } } @@ -5584,18 +5762,18 @@ function __construct($client, $node, $vmid) /** * Resize a container mount point. - * @param $disk The disk you want to resize. + * @param string $disk The disk you want to resize. * Enum: rootfs,mp0,mp1,mp2,mp3,mp4,mp5,mp6,mp7,mp8,mp9 - * @param $size The new size. With the '+' sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @return mixed + * @param string $size The new size. With the '+' sign the value is added to the actual size of the volume and without it, the value is taken as an absolute one. Shrinking disk size is not supported. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function resizeVm($disk, $size, $digest = null) { $parms = ['disk' => $disk, 'size' => $size, 'digest' => $digest]; - return $this->client->put("/nodes/{$this->node}/lxc/{$this->vmid}/resize", $parms); + return $this->getClient()->put("/nodes/{$this->node}/lxc/{$this->vmid}/resize", $parms); } } @@ -5695,11 +5873,11 @@ public function getLog() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/ceph"); + return $this->getClient()->get("/nodes/{$this->node}/ceph"); } } @@ -5720,21 +5898,21 @@ public function get($osdid) /** * Get Ceph osd list/tree. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/ceph/osd"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/osd"); } /** * Create OSD - * @param $dev Block device name. - * @param $bluestore Use bluestore instead of filestore. - * @param $fstype File system type (filestore only). + * @param string $dev Block device name. + * @param bool $bluestore Use bluestore instead of filestore. + * @param string $fstype File system type (filestore only). * Enum: xfs,ext4,btrfs - * @param $journal_dev Block device name for journal. - * @return mixed + * @param string $journal_dev Block device name for journal. + * @return Result */ public function createosd($dev, $bluestore = null, $fstype = null, $journal_dev = null) { @@ -5742,7 +5920,7 @@ public function createosd($dev, $bluestore = null, $fstype = null, $journal_dev 'bluestore' => $bluestore, 'fstype' => $fstype, 'journal_dev' => $journal_dev]; - return $this->client->post("/nodes/{$this->node}/ceph/osd", $parms); + return $this->getClient()->post("/nodes/{$this->node}/ceph/osd", $parms); } } @@ -5774,13 +5952,13 @@ public function getOut() /** * Destroy OSD - * @param $cleanup If set, we remove partition table entries. - * @return mixed + * @param bool $cleanup If set, we remove partition table entries. + * @return Result */ public function destroyosd($cleanup = null) { $parms = ['cleanup' => $cleanup]; - return $this->client->delete("/nodes/{$this->node}/ceph/osd/{$this->osdid}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/ceph/osd/{$this->osdid}", $parms); } } @@ -5798,10 +5976,11 @@ function __construct($client, $node, $osdid) /** * ceph osd in + * @return Result */ public function in() { - $this->client->post("/nodes/{$this->node}/ceph/osd/{$this->osdid}/in"); + return $this->getClient()->post("/nodes/{$this->node}/ceph/osd/{$this->osdid}/in"); } } @@ -5819,10 +5998,11 @@ function __construct($client, $node, $osdid) /** * ceph osd out + * @return Result */ public function out() { - $this->client->post("/nodes/{$this->node}/ceph/osd/{$this->osdid}/out"); + return $this->getClient()->post("/nodes/{$this->node}/ceph/osd/{$this->osdid}/out"); } } @@ -5838,14 +6018,14 @@ function __construct($client, $node) /** * List local disks. - * @param $type Only list specific types of disks. + * @param string $type Only list specific types of disks. * Enum: unused,journal_disks - * @return mixed + * @return Result */ public function disks($type = null) { $parms = ['type' => $type]; - return $this->client->get("/nodes/{$this->node}/ceph/disks", $parms); + return $this->getClient()->get("/nodes/{$this->node}/ceph/disks", $parms); } } @@ -5861,11 +6041,11 @@ function __construct($client, $node) /** * Get Ceph configuration. - * @return mixed + * @return Result */ public function config() { - return $this->client->get("/nodes/{$this->node}/ceph/config"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/config"); } } @@ -5886,20 +6066,20 @@ public function get($monid) /** * Get Ceph monitor list. - * @return mixed + * @return Result */ public function listmon() { - return $this->client->get("/nodes/{$this->node}/ceph/mon"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/mon"); } /** * Create Ceph Monitor - * @return mixed + * @return Result */ public function createmon() { - return $this->client->post("/nodes/{$this->node}/ceph/mon"); + return $this->getClient()->post("/nodes/{$this->node}/ceph/mon"); } } @@ -5917,11 +6097,11 @@ function __construct($client, $node, $monid) /** * Destroy Ceph monitor. - * @return mixed + * @return Result */ public function destroymon() { - return $this->client->delete("/nodes/{$this->node}/ceph/mon/{$this->monid}"); + return $this->getClient()->delete("/nodes/{$this->node}/ceph/mon/{$this->monid}"); } } @@ -5937,11 +6117,12 @@ function __construct($client, $node) /** * Create initial ceph default configuration and setup symlinks. - * @param $disable_cephx Disable cephx authentification. WARNING: cephx is a security feature protecting against man-in-the-middle attacks. Only consider disabling cephx if your network is private! - * @param $min_size Minimum number of available replicas per object to allow I/O - * @param $network Use specific network for all ceph related traffic - * @param $pg_bits Placement group bits, used to specify the default number of placement groups. NOTE: 'osd pool default pg num' does not work for default pools. - * @param $size Targeted number of replicas per object + * @param bool $disable_cephx Disable cephx authentification. WARNING: cephx is a security feature protecting against man-in-the-middle attacks. Only consider disabling cephx if your network is private! + * @param int $min_size Minimum number of available replicas per object to allow I/O + * @param string $network Use specific network for all ceph related traffic + * @param int $pg_bits Placement group bits, used to specify the default number of placement groups. NOTE: 'osd pool default pg num' does not work for default pools. + * @param int $size Targeted number of replicas per object + * @return Result */ public function init($disable_cephx = null, $min_size = null, $network = null, $pg_bits = null, $size = null) { @@ -5950,7 +6131,7 @@ public function init($disable_cephx = null, $min_size = null, $network = null, $ 'network' => $network, 'pg_bits' => $pg_bits, 'size' => $size]; - $this->client->post("/nodes/{$this->node}/ceph/init", $parms); + return $this->getClient()->post("/nodes/{$this->node}/ceph/init", $parms); } } @@ -5966,13 +6147,13 @@ function __construct($client, $node) /** * Stop ceph services. - * @param $service Ceph service name. - * @return mixed + * @param string $service Ceph service name. + * @return Result */ public function stop($service = null) { $parms = ['service' => $service]; - return $this->client->post("/nodes/{$this->node}/ceph/stop", $parms); + return $this->getClient()->post("/nodes/{$this->node}/ceph/stop", $parms); } } @@ -5988,13 +6169,13 @@ function __construct($client, $node) /** * Start ceph services. - * @param $service Ceph service name. - * @return mixed + * @param string $service Ceph service name. + * @return Result */ public function start($service = null) { $parms = ['service' => $service]; - return $this->client->post("/nodes/{$this->node}/ceph/start", $parms); + return $this->getClient()->post("/nodes/{$this->node}/ceph/start", $parms); } } @@ -6010,11 +6191,11 @@ function __construct($client, $node) /** * Get ceph status. - * @return mixed + * @return Result */ public function status() { - return $this->client->get("/nodes/{$this->node}/ceph/status"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/status"); } } @@ -6035,20 +6216,21 @@ public function get($name) /** * List all pools. - * @return mixed + * @return Result */ public function lspools() { - return $this->client->get("/nodes/{$this->node}/ceph/pools"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/pools"); } /** * Create POOL - * @param $name The name of the pool. It must be unique. - * @param $crush_ruleset The ruleset to use for mapping object placement in the cluster. - * @param $min_size Minimum number of replicas per object - * @param $pg_num Number of placement groups. - * @param $size Number of replicas per object + * @param string $name The name of the pool. It must be unique. + * @param int $crush_ruleset The ruleset to use for mapping object placement in the cluster. + * @param int $min_size Minimum number of replicas per object + * @param int $pg_num Number of placement groups. + * @param int $size Number of replicas per object + * @return Result */ public function createpool($name, $crush_ruleset = null, $min_size = null, $pg_num = null, $size = null) { @@ -6057,7 +6239,7 @@ public function createpool($name, $crush_ruleset = null, $min_size = null, $pg_n 'min_size' => $min_size, 'pg_num' => $pg_num, 'size' => $size]; - $this->client->post("/nodes/{$this->node}/ceph/pools", $parms); + return $this->getClient()->post("/nodes/{$this->node}/ceph/pools", $parms); } } @@ -6075,12 +6257,13 @@ function __construct($client, $node, $name) /** * Destroy pool - * @param $force If true, destroys pool even if in use + * @param bool $force If true, destroys pool even if in use + * @return Result */ public function destroypool($force = null) { $parms = ['force' => $force]; - $this->client->delete("/nodes/{$this->node}/ceph/pools/{$this->name}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/ceph/pools/{$this->name}", $parms); } } @@ -6101,11 +6284,11 @@ public function get($flag) /** * get all set ceph flags - * @return mixed + * @return Result */ public function getFlags() { - return $this->client->get("/nodes/{$this->node}/ceph/flags"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/flags"); } } @@ -6123,18 +6306,20 @@ function __construct($client, $node, $flag) /** * Unset a ceph flag + * @return Result */ public function unsetFlag() { - $this->client->delete("/nodes/{$this->node}/ceph/flags/{$this->flag}"); + return $this->getClient()->delete("/nodes/{$this->node}/ceph/flags/{$this->flag}"); } /** * Set a ceph flag + * @return Result */ public function setFlag() { - $this->client->post("/nodes/{$this->node}/ceph/flags/{$this->flag}"); + return $this->getClient()->post("/nodes/{$this->node}/ceph/flags/{$this->flag}"); } } @@ -6150,11 +6335,11 @@ function __construct($client, $node) /** * Get OSD crush map - * @return mixed + * @return Result */ public function crush() { - return $this->client->get("/nodes/{$this->node}/ceph/crush"); + return $this->getClient()->get("/nodes/{$this->node}/ceph/crush"); } } @@ -6170,15 +6355,15 @@ function __construct($client, $node) /** * Read ceph log - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function log($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/ceph/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/ceph/log", $parms); } } @@ -6201,34 +6386,34 @@ public function getExtractconfig() /** * Create backup. - * @param $all Backup all known guest systems on this host. - * @param $bwlimit Limit I/O bandwidth (KBytes per second). - * @param $compress Compress dump file. + * @param bool $all Backup all known guest systems on this host. + * @param int $bwlimit Limit I/O bandwidth (KBytes per second). + * @param string $compress Compress dump file. * Enum: 0,1,gzip,lzo - * @param $dumpdir Store resulting files to specified directory. - * @param $exclude Exclude specified guest systems (assumes --all) - * @param $exclude_path Exclude certain files/directories (shell globs). - * @param $ionice Set CFQ ionice priority. - * @param $lockwait Maximal time to wait for the global lock (minutes). - * @param $mailnotification Specify when to send an email + * @param string $dumpdir Store resulting files to specified directory. + * @param string $exclude Exclude specified guest systems (assumes --all) + * @param string $exclude_path Exclude certain files/directories (shell globs). + * @param int $ionice Set CFQ ionice priority. + * @param int $lockwait Maximal time to wait for the global lock (minutes). + * @param string $mailnotification Specify when to send an email * Enum: always,failure - * @param $mailto Comma-separated list of email addresses that should receive email notifications. - * @param $maxfiles Maximal number of backup files per guest system. - * @param $mode Backup mode. + * @param string $mailto Comma-separated list of email addresses that should receive email notifications. + * @param int $maxfiles Maximal number of backup files per guest system. + * @param string $mode Backup mode. * Enum: snapshot,suspend,stop - * @param $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. - * @param $quiet Be quiet. - * @param $remove Remove old backup files if there are more than 'maxfiles' backup files. - * @param $script Use specified hook script. - * @param $size Unused, will be removed in a future release. - * @param $stdexcludes Exclude temporary files and logs. - * @param $stdout Write tar to stdout, not to a file. - * @param $stop Stop runnig backup jobs on this host. - * @param $stopwait Maximal time to wait until a guest system is stopped (minutes). - * @param $storage Store resulting file to this storage. - * @param $tmpdir Store temporary files to specified directory. - * @param $vmid The ID of the guest system you want to backup. - * @return mixed + * @param int $pigz Use pigz instead of gzip when N&gt;0. N=1 uses half of cores, N&gt;1 uses N as thread count. + * @param bool $quiet Be quiet. + * @param bool $remove Remove old backup files if there are more than 'maxfiles' backup files. + * @param string $script Use specified hook script. + * @param int $size Unused, will be removed in a future release. + * @param bool $stdexcludes Exclude temporary files and logs. + * @param bool $stdout Write tar to stdout, not to a file. + * @param bool $stop Stop runnig backup jobs on this host. + * @param int $stopwait Maximal time to wait until a guest system is stopped (minutes). + * @param string $storage Store resulting file to this storage. + * @param string $tmpdir Store temporary files to specified directory. + * @param string $vmid The ID of the guest system you want to backup. + * @return Result */ public function vzdump($all = null, $bwlimit = null, $compress = null, $dumpdir = null, $exclude = null, $exclude_path = null, $ionice = null, $lockwait = null, $mailnotification = null, $mailto = null, $maxfiles = null, $mode = null, $pigz = null, $quiet = null, $remove = null, $script = null, $size = null, $stdexcludes = null, $stdout = null, $stop = null, $stopwait = null, $storage = null, $tmpdir = null, $vmid = null) { @@ -6256,7 +6441,7 @@ public function vzdump($all = null, $bwlimit = null, $compress = null, $dumpdir 'storage' => $storage, 'tmpdir' => $tmpdir, 'vmid' => $vmid]; - return $this->client->post("/nodes/{$this->node}/vzdump", $parms); + return $this->getClient()->post("/nodes/{$this->node}/vzdump", $parms); } } @@ -6272,13 +6457,13 @@ function __construct($client, $node) /** * Extract configuration from vzdump backup archive. - * @param $volume Volume identifier - * @return mixed + * @param string $volume Volume identifier + * @return Result */ public function extractconfig($volume) { $parms = ['volume' => $volume]; - return $this->client->get("/nodes/{$this->node}/vzdump/extractconfig", $parms); + return $this->getClient()->get("/nodes/{$this->node}/vzdump/extractconfig", $parms); } } @@ -6299,11 +6484,11 @@ public function get($service) /** * Service list. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/services"); + return $this->getClient()->get("/nodes/{$this->node}/services"); } } @@ -6356,11 +6541,11 @@ public function getReload() /** * Directory index - * @return mixed + * @return Result */ public function srvcmdidx() { - return $this->client->get("/nodes/{$this->node}/services/{$this->service}"); + return $this->getClient()->get("/nodes/{$this->node}/services/{$this->service}"); } } @@ -6378,11 +6563,11 @@ function __construct($client, $node, $service) /** * Read service properties - * @return mixed + * @return Result */ public function serviceState() { - return $this->client->get("/nodes/{$this->node}/services/{$this->service}/state"); + return $this->getClient()->get("/nodes/{$this->node}/services/{$this->service}/state"); } } @@ -6400,11 +6585,11 @@ function __construct($client, $node, $service) /** * Start service. - * @return mixed + * @return Result */ public function serviceStart() { - return $this->client->post("/nodes/{$this->node}/services/{$this->service}/start"); + return $this->getClient()->post("/nodes/{$this->node}/services/{$this->service}/start"); } } @@ -6422,11 +6607,11 @@ function __construct($client, $node, $service) /** * Stop service. - * @return mixed + * @return Result */ public function serviceStop() { - return $this->client->post("/nodes/{$this->node}/services/{$this->service}/stop"); + return $this->getClient()->post("/nodes/{$this->node}/services/{$this->service}/stop"); } } @@ -6444,11 +6629,11 @@ function __construct($client, $node, $service) /** * Restart service. - * @return mixed + * @return Result */ public function serviceRestart() { - return $this->client->post("/nodes/{$this->node}/services/{$this->service}/restart"); + return $this->getClient()->post("/nodes/{$this->node}/services/{$this->service}/restart"); } } @@ -6466,11 +6651,11 @@ function __construct($client, $node, $service) /** * Reload service. - * @return mixed + * @return Result */ public function serviceReload() { - return $this->client->post("/nodes/{$this->node}/services/{$this->service}/reload"); + return $this->getClient()->post("/nodes/{$this->node}/services/{$this->service}/reload"); } } @@ -6486,31 +6671,33 @@ function __construct($client, $node) /** * Read subscription info. - * @return mixed + * @return Result */ public function get() { - return $this->client->get("/nodes/{$this->node}/subscription"); + return $this->getClient()->get("/nodes/{$this->node}/subscription"); } /** * Update subscription info. - * @param $force Always connect to server, even if we have up to date info inside local cache. + * @param bool $force Always connect to server, even if we have up to date info inside local cache. + * @return Result */ public function update($force = null) { $parms = ['force' => $force]; - $this->client->post("/nodes/{$this->node}/subscription", $parms); + return $this->getClient()->post("/nodes/{$this->node}/subscription", $parms); } /** * Set subscription key. - * @param $key Proxmox VE subscription key + * @param string $key Proxmox VE subscription key + * @return Result */ public function set($key) { $parms = ['key' => $key]; - $this->client->put("/nodes/{$this->node}/subscription", $parms); + return $this->getClient()->put("/nodes/{$this->node}/subscription", $parms); } } @@ -6531,50 +6718,52 @@ public function get($iface) /** * Revert network configuration changes. + * @return Result */ public function revertNetworkChanges() { - $this->client->delete("/nodes/{$this->node}/network"); + return $this->getClient()->delete("/nodes/{$this->node}/network"); } /** * List available networks - * @param $type Only list specific interface types. + * @param string $type Only list specific interface types. * Enum: bridge,bond,eth,alias,vlan,OVSBridge,OVSBond,OVSPort,OVSIntPort,any_bridge - * @return mixed + * @return Result */ public function index($type = null) { $parms = ['type' => $type]; - return $this->client->get("/nodes/{$this->node}/network", $parms); + return $this->getClient()->get("/nodes/{$this->node}/network", $parms); } /** * Create network device configuration - * @param $iface Network interface name. - * @param $type Network interface type + * @param string $iface Network interface name. + * @param string $type Network interface type * Enum: bridge,bond,eth,alias,vlan,OVSBridge,OVSBond,OVSPort,OVSIntPort,unknown - * @param $address IP address. - * @param $address6 IP address. - * @param $autostart Automatically start interface on boot. - * @param $bond_mode Bonding mode. + * @param string $address IP address. + * @param string $address6 IP address. + * @param bool $autostart Automatically start interface on boot. + * @param string $bond_mode Bonding mode. * Enum: balance-rr,active-backup,balance-xor,broadcast,802.3ad,balance-tlb,balance-alb,balance-slb,lacp-balance-slb,lacp-balance-tcp - * @param $bond_xmit_hash_policy Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes. + * @param string $bond_xmit_hash_policy Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes. * Enum: layer2,layer2+3,layer3+4 - * @param $bridge_ports Specify the iterfaces you want to add to your bridge. - * @param $bridge_vlan_aware Enable bridge vlan support. - * @param $comments Comments - * @param $comments6 Comments - * @param $gateway Default gateway address. - * @param $gateway6 Default ipv6 gateway address. - * @param $netmask Network mask. - * @param $netmask6 Network mask. - * @param $ovs_bonds Specify the interfaces used by the bonding device. - * @param $ovs_bridge The OVS bridge associated with a OVS port. This is required when you create an OVS port. - * @param $ovs_options OVS interface options. - * @param $ovs_ports Specify the iterfaces you want to add to your bridge. - * @param $ovs_tag Specify a VLan tag (used by OVSPort, OVSIntPort, OVSBond) - * @param $slaves Specify the interfaces used by the bonding device. + * @param string $bridge_ports Specify the iterfaces you want to add to your bridge. + * @param bool $bridge_vlan_aware Enable bridge vlan support. + * @param string $comments Comments + * @param string $comments6 Comments + * @param string $gateway Default gateway address. + * @param string $gateway6 Default ipv6 gateway address. + * @param string $netmask Network mask. + * @param int $netmask6 Network mask. + * @param string $ovs_bonds Specify the interfaces used by the bonding device. + * @param string $ovs_bridge The OVS bridge associated with a OVS port. This is required when you create an OVS port. + * @param string $ovs_options OVS interface options. + * @param string $ovs_ports Specify the iterfaces you want to add to your bridge. + * @param int $ovs_tag Specify a VLan tag (used by OVSPort, OVSIntPort, OVSBond) + * @param string $slaves Specify the interfaces used by the bonding device. + * @return Result */ public function createNetwork($iface, $type, $address = null, $address6 = null, $autostart = null, $bond_mode = null, $bond_xmit_hash_policy = null, $bridge_ports = null, $bridge_vlan_aware = null, $comments = null, $comments6 = null, $gateway = null, $gateway6 = null, $netmask = null, $netmask6 = null, $ovs_bonds = null, $ovs_bridge = null, $ovs_options = null, $ovs_ports = null, $ovs_tag = null, $slaves = null) { @@ -6599,7 +6788,7 @@ public function createNetwork($iface, $type, $address = null, $address6 = null, 'ovs_ports' => $ovs_ports, 'ovs_tag' => $ovs_tag, 'slaves' => $slaves]; - $this->client->post("/nodes/{$this->node}/network", $parms); + return $this->getClient()->post("/nodes/{$this->node}/network", $parms); } } @@ -6617,47 +6806,49 @@ function __construct($client, $node, $iface) /** * Delete network device configuration + * @return Result */ public function deleteNetwork() { - $this->client->delete("/nodes/{$this->node}/network/{$this->iface}"); + return $this->getClient()->delete("/nodes/{$this->node}/network/{$this->iface}"); } /** * Read network device configuration - * @return mixed + * @return Result */ public function networkConfig() { - return $this->client->get("/nodes/{$this->node}/network/{$this->iface}"); + return $this->getClient()->get("/nodes/{$this->node}/network/{$this->iface}"); } /** * Update network device configuration - * @param $type Network interface type + * @param string $type Network interface type * Enum: bridge,bond,eth,alias,vlan,OVSBridge,OVSBond,OVSPort,OVSIntPort,unknown - * @param $address IP address. - * @param $address6 IP address. - * @param $autostart Automatically start interface on boot. - * @param $bond_mode Bonding mode. + * @param string $address IP address. + * @param string $address6 IP address. + * @param bool $autostart Automatically start interface on boot. + * @param string $bond_mode Bonding mode. * Enum: balance-rr,active-backup,balance-xor,broadcast,802.3ad,balance-tlb,balance-alb,balance-slb,lacp-balance-slb,lacp-balance-tcp - * @param $bond_xmit_hash_policy Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes. + * @param string $bond_xmit_hash_policy Selects the transmit hash policy to use for slave selection in balance-xor and 802.3ad modes. * Enum: layer2,layer2+3,layer3+4 - * @param $bridge_ports Specify the iterfaces you want to add to your bridge. - * @param $bridge_vlan_aware Enable bridge vlan support. - * @param $comments Comments - * @param $comments6 Comments - * @param $delete A list of settings you want to delete. - * @param $gateway Default gateway address. - * @param $gateway6 Default ipv6 gateway address. - * @param $netmask Network mask. - * @param $netmask6 Network mask. - * @param $ovs_bonds Specify the interfaces used by the bonding device. - * @param $ovs_bridge The OVS bridge associated with a OVS port. This is required when you create an OVS port. - * @param $ovs_options OVS interface options. - * @param $ovs_ports Specify the iterfaces you want to add to your bridge. - * @param $ovs_tag Specify a VLan tag (used by OVSPort, OVSIntPort, OVSBond) - * @param $slaves Specify the interfaces used by the bonding device. + * @param string $bridge_ports Specify the iterfaces you want to add to your bridge. + * @param bool $bridge_vlan_aware Enable bridge vlan support. + * @param string $comments Comments + * @param string $comments6 Comments + * @param string $delete A list of settings you want to delete. + * @param string $gateway Default gateway address. + * @param string $gateway6 Default ipv6 gateway address. + * @param string $netmask Network mask. + * @param int $netmask6 Network mask. + * @param string $ovs_bonds Specify the interfaces used by the bonding device. + * @param string $ovs_bridge The OVS bridge associated with a OVS port. This is required when you create an OVS port. + * @param string $ovs_options OVS interface options. + * @param string $ovs_ports Specify the iterfaces you want to add to your bridge. + * @param int $ovs_tag Specify a VLan tag (used by OVSPort, OVSIntPort, OVSBond) + * @param string $slaves Specify the interfaces used by the bonding device. + * @return Result */ public function updateNetwork($type, $address = null, $address6 = null, $autostart = null, $bond_mode = null, $bond_xmit_hash_policy = null, $bridge_ports = null, $bridge_vlan_aware = null, $comments = null, $comments6 = null, $delete = null, $gateway = null, $gateway6 = null, $netmask = null, $netmask6 = null, $ovs_bonds = null, $ovs_bridge = null, $ovs_options = null, $ovs_ports = null, $ovs_tag = null, $slaves = null) { @@ -6682,7 +6873,7 @@ public function updateNetwork($type, $address = null, $address6 = null, $autosta 'ovs_ports' => $ovs_ports, 'ovs_tag' => $ovs_tag, 'slaves' => $slaves]; - $this->client->put("/nodes/{$this->node}/network/{$this->iface}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/network/{$this->iface}", $parms); } } @@ -6703,12 +6894,12 @@ public function get($upid) /** * Read task list for one node (finished tasks). - * @param $errors - * @param $limit - * @param $start - * @param $userfilter - * @param $vmid Only list tasks for this VM. - * @return mixed + * @param bool $errors + * @param int $limit + * @param int $start + * @param string $userfilter + * @param int $vmid Only list tasks for this VM. + * @return Result */ public function nodeTasks($errors = null, $limit = null, $start = null, $userfilter = null, $vmid = null) { @@ -6717,7 +6908,7 @@ public function nodeTasks($errors = null, $limit = null, $start = null, $userfil 'start' => $start, 'userfilter' => $userfilter, 'vmid' => $vmid]; - return $this->client->get("/nodes/{$this->node}/tasks", $parms); + return $this->getClient()->get("/nodes/{$this->node}/tasks", $parms); } } @@ -6749,19 +6940,20 @@ public function getStatus() /** * Stop a task. + * @return Result */ public function stopTask() { - $this->client->delete("/nodes/{$this->node}/tasks/{$this->upid}"); + return $this->getClient()->delete("/nodes/{$this->node}/tasks/{$this->upid}"); } /** * - * @return mixed + * @return Result */ public function upidIndex() { - return $this->client->get("/nodes/{$this->node}/tasks/{$this->upid}"); + return $this->getClient()->get("/nodes/{$this->node}/tasks/{$this->upid}"); } } @@ -6779,15 +6971,15 @@ function __construct($client, $node, $upid) /** * Read task log. - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function readTaskLog($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/tasks/{$this->upid}/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/tasks/{$this->upid}/log", $parms); } } @@ -6805,11 +6997,11 @@ function __construct($client, $node, $upid) /** * Read task status. - * @return mixed + * @return Result */ public function readTaskStatus() { - return $this->client->get("/nodes/{$this->node}/tasks/{$this->upid}/status"); + return $this->getClient()->get("/nodes/{$this->node}/tasks/{$this->upid}/status"); } } @@ -6874,11 +7066,11 @@ public function getUsb() /** * Index of available scan methods - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/scan"); + return $this->getClient()->get("/nodes/{$this->node}/scan"); } } @@ -6894,11 +7086,11 @@ function __construct($client, $node) /** * Scan zfs pool list on local node. - * @return mixed + * @return Result */ public function zfsscan() { - return $this->client->get("/nodes/{$this->node}/scan/zfs"); + return $this->getClient()->get("/nodes/{$this->node}/scan/zfs"); } } @@ -6914,13 +7106,13 @@ function __construct($client, $node) /** * Scan remote NFS server. - * @param $server - * @return mixed + * @param string $server + * @return Result */ public function nfsscan($server) { $parms = ['server' => $server]; - return $this->client->get("/nodes/{$this->node}/scan/nfs", $parms); + return $this->getClient()->get("/nodes/{$this->node}/scan/nfs", $parms); } } @@ -6936,13 +7128,13 @@ function __construct($client, $node) /** * Scan remote GlusterFS server. - * @param $server - * @return mixed + * @param string $server + * @return Result */ public function glusterfsscan($server) { $parms = ['server' => $server]; - return $this->client->get("/nodes/{$this->node}/scan/glusterfs", $parms); + return $this->getClient()->get("/nodes/{$this->node}/scan/glusterfs", $parms); } } @@ -6958,13 +7150,13 @@ function __construct($client, $node) /** * Scan remote iSCSI server. - * @param $portal - * @return mixed + * @param string $portal + * @return Result */ public function iscsiscan($portal) { $parms = ['portal' => $portal]; - return $this->client->get("/nodes/{$this->node}/scan/iscsi", $parms); + return $this->getClient()->get("/nodes/{$this->node}/scan/iscsi", $parms); } } @@ -6980,11 +7172,11 @@ function __construct($client, $node) /** * List local LVM volume groups. - * @return mixed + * @return Result */ public function lvmscan() { - return $this->client->get("/nodes/{$this->node}/scan/lvm"); + return $this->getClient()->get("/nodes/{$this->node}/scan/lvm"); } } @@ -7000,13 +7192,13 @@ function __construct($client, $node) /** * List local LVM Thin Pools. - * @param $vg - * @return mixed + * @param string $vg + * @return Result */ public function lvmthinscan($vg) { $parms = ['vg' => $vg]; - return $this->client->get("/nodes/{$this->node}/scan/lvmthin", $parms); + return $this->getClient()->get("/nodes/{$this->node}/scan/lvmthin", $parms); } } @@ -7022,11 +7214,11 @@ function __construct($client, $node) /** * List local USB devices. - * @return mixed + * @return Result */ public function usbscan() { - return $this->client->get("/nodes/{$this->node}/scan/usb"); + return $this->getClient()->get("/nodes/{$this->node}/scan/usb"); } } @@ -7047,11 +7239,11 @@ public function get($storage) /** * Get status for all datastores. - * @param $content Only list stores which support this content type. - * @param $enabled Only list stores which are enabled (not disabled in config). - * @param $storage Only list status for specified storage - * @param $target If target is different to 'node', we only lists shared storages which content is accessible on this 'node' and the specified 'target' node. - * @return mixed + * @param string $content Only list stores which support this content type. + * @param bool $enabled Only list stores which are enabled (not disabled in config). + * @param string $storage Only list status for specified storage + * @param string $target If target is different to 'node', we only lists shared storages which content is accessible on this 'node' and the specified 'target' node. + * @return Result */ public function index($content = null, $enabled = null, $storage = null, $target = null) { @@ -7059,7 +7251,7 @@ public function index($content = null, $enabled = null, $storage = null, $target 'enabled' => $enabled, 'storage' => $storage, 'target' => $target]; - return $this->client->get("/nodes/{$this->node}/storage", $parms); + return $this->getClient()->get("/nodes/{$this->node}/storage", $parms); } } @@ -7112,11 +7304,11 @@ public function getUpload() /** * - * @return mixed + * @return Result */ public function diridx() { - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}"); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}"); } } @@ -7139,25 +7331,25 @@ public function get($volume) /** * List storage content. - * @param $content Only list content of this type. - * @param $vmid Only list images for this VM - * @return mixed + * @param string $content Only list content of this type. + * @param int $vmid Only list images for this VM + * @return Result */ public function index($content = null, $vmid = null) { $parms = ['content' => $content, 'vmid' => $vmid]; - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}/content", $parms); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}/content", $parms); } /** * Allocate disk images. - * @param $filename The name of the file to create. - * @param $size Size in kilobyte (1024 bytes). Optional suffixes 'M' (megabyte, 1024K) and 'G' (gigabyte, 1024M) - * @param $vmid Specify owner VM - * @param $format + * @param string $filename The name of the file to create. + * @param string $size Size in kilobyte (1024 bytes). Optional suffixes 'M' (megabyte, 1024K) and 'G' (gigabyte, 1024M) + * @param int $vmid Specify owner VM + * @param string $format * Enum: raw,qcow2,subvol - * @return mixed + * @return Result */ public function create($filename, $size, $vmid, $format = null) { @@ -7165,7 +7357,7 @@ public function create($filename, $size, $vmid, $format = null) 'size' => $size, 'vmid' => $vmid, 'format' => $format]; - return $this->client->post("/nodes/{$this->node}/storage/{$this->storage}/content", $parms); + return $this->getClient()->post("/nodes/{$this->node}/storage/{$this->storage}/content", $parms); } } @@ -7185,32 +7377,33 @@ function __construct($client, $node, $storage, $volume) /** * Delete volume + * @return Result */ public function delete() { - $this->client->delete("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}"); + return $this->getClient()->delete("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}"); } /** * Get volume attributes - * @return mixed + * @return Result */ public function info() { - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}"); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}"); } /** * Copy a volume. This is experimental code - do not use. - * @param $target Target volume identifier - * @param $target_node Target node. Default is local node. - * @return mixed + * @param string $target Target volume identifier + * @param string $target_node Target node. Default is local node. + * @return Result */ public function copy($target, $target_node = null) { $parms = ['target' => $target, 'target_node' => $target_node]; - return $this->client->post("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}", $parms); + return $this->getClient()->post("/nodes/{$this->node}/storage/{$this->storage}/content/{$this->volume}", $parms); } } @@ -7228,11 +7421,11 @@ function __construct($client, $node, $storage) /** * Read storage status. - * @return mixed + * @return Result */ public function readStatus() { - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}/status"); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}/status"); } } @@ -7250,19 +7443,19 @@ function __construct($client, $node, $storage) /** * Read storage RRD statistics (returns PNG). - * @param $ds The list of datasources you want to display. - * @param $timeframe Specify the time frame you are interested in. + * @param string $ds The list of datasources you want to display. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrd($ds, $timeframe, $cf = null) { $parms = ['ds' => $ds, 'timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}/rrd", $parms); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}/rrd", $parms); } } @@ -7280,17 +7473,17 @@ function __construct($client, $node, $storage) /** * Read storage RRD statistics. - * @param $timeframe Specify the time frame you are interested in. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrddata($timeframe, $cf = null) { $parms = ['timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/storage/{$this->storage}/rrddata", $parms); + return $this->getClient()->get("/nodes/{$this->node}/storage/{$this->storage}/rrddata", $parms); } } @@ -7308,17 +7501,17 @@ function __construct($client, $node, $storage) /** * Upload templates and ISO images. - * @param $content Content type. - * @param $filename The name of the file to create. - * @param $tmpfilename The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trustet port on localhost. - * @return mixed + * @param string $content Content type. + * @param string $filename The name of the file to create. + * @param string $tmpfilename The source file name. This parameter is usually set by the REST handler. You can only overwrite it when connecting to the trustet port on localhost. + * @return Result */ public function upload($content, $filename, $tmpfilename = null) { $parms = ['content' => $content, 'filename' => $filename, 'tmpfilename' => $tmpfilename]; - return $this->client->post("/nodes/{$this->node}/storage/{$this->storage}/upload", $parms); + return $this->getClient()->post("/nodes/{$this->node}/storage/{$this->storage}/upload", $parms); } } @@ -7355,11 +7548,11 @@ public function getInitgpt() /** * Node index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/disks"); + return $this->getClient()->get("/nodes/{$this->node}/disks"); } } @@ -7375,11 +7568,11 @@ function __construct($client, $node) /** * List local disks. - * @return mixed + * @return Result */ public function list_() { - return $this->client->get("/nodes/{$this->node}/disks/list"); + return $this->getClient()->get("/nodes/{$this->node}/disks/list"); } } @@ -7395,15 +7588,15 @@ function __construct($client, $node) /** * Get SMART Health of a disk. - * @param $disk Block device name - * @param $healthonly If true returns only the health status - * @return mixed + * @param string $disk Block device name + * @param bool $healthonly If true returns only the health status + * @return Result */ public function smart($disk, $healthonly = null) { $parms = ['disk' => $disk, 'healthonly' => $healthonly]; - return $this->client->get("/nodes/{$this->node}/disks/smart", $parms); + return $this->getClient()->get("/nodes/{$this->node}/disks/smart", $parms); } } @@ -7419,15 +7612,15 @@ function __construct($client, $node) /** * Initialize Disk with GPT - * @param $disk Block device name - * @param $uuid UUID for the GPT table - * @return mixed + * @param string $disk Block device name + * @param string $uuid UUID for the GPT table + * @return Result */ public function initgpt($disk, $uuid = null) { $parms = ['disk' => $disk, 'uuid' => $uuid]; - return $this->client->post("/nodes/{$this->node}/disks/initgpt", $parms); + return $this->getClient()->post("/nodes/{$this->node}/disks/initgpt", $parms); } } @@ -7464,11 +7657,11 @@ public function getVersions() /** * Directory index for apt (Advanced Package Tool). - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/apt"); + return $this->getClient()->get("/nodes/{$this->node}/apt"); } } @@ -7484,24 +7677,24 @@ function __construct($client, $node) /** * List available updates. - * @return mixed + * @return Result */ public function listUpdates() { - return $this->client->get("/nodes/{$this->node}/apt/update"); + return $this->getClient()->get("/nodes/{$this->node}/apt/update"); } /** * This is used to resynchronize the package index files from their sources (apt-get update). - * @param $notify Send notification mail about new packages (to email address specified for user 'root@pam'). - * @param $quiet Only produces output suitable for logging, omitting progress indicators. - * @return mixed + * @param bool $notify Send notification mail about new packages (to email address specified for user 'root@pam'). + * @param bool $quiet Only produces output suitable for logging, omitting progress indicators. + * @return Result */ public function updateDatabase($notify = null, $quiet = null) { $parms = ['notify' => $notify, 'quiet' => $quiet]; - return $this->client->post("/nodes/{$this->node}/apt/update", $parms); + return $this->getClient()->post("/nodes/{$this->node}/apt/update", $parms); } } @@ -7517,15 +7710,15 @@ function __construct($client, $node) /** * Get package changelogs. - * @param $name Package name. - * @param $version Package version. - * @return mixed + * @param string $name Package name. + * @param string $version Package version. + * @return Result */ public function changelog($name, $version = null) { $parms = ['name' => $name, 'version' => $version]; - return $this->client->get("/nodes/{$this->node}/apt/changelog", $parms); + return $this->getClient()->get("/nodes/{$this->node}/apt/changelog", $parms); } } @@ -7541,11 +7734,11 @@ function __construct($client, $node) /** * Get package information for important Proxmox packages. - * @return mixed + * @return Result */ public function versions() { - return $this->client->get("/nodes/{$this->node}/apt/versions"); + return $this->getClient()->get("/nodes/{$this->node}/apt/versions"); } } @@ -7582,11 +7775,11 @@ public function getLog() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/firewall"); + return $this->getClient()->get("/nodes/{$this->node}/firewall"); } } @@ -7607,29 +7800,30 @@ public function get($pos) /** * List rules. - * @return mixed + * @return Result */ public function getRules() { - return $this->client->get("/nodes/{$this->node}/firewall/rules"); + return $this->getClient()->get("/nodes/{$this->node}/firewall/rules"); } /** * Create new rule. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $type Rule type. * Enum: in,out,group - * @param $comment Descriptive comment. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $pos Update rule at position &lt;pos&gt;. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $comment Descriptive comment. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $pos Update rule at position &lt;pos&gt;. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @return Result */ public function createRule($action, $type, $comment = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $pos = null, $proto = null, $source = null, $sport = null) { @@ -7646,7 +7840,7 @@ public function createRule($action, $type, $comment = null, $dest = null, $diges 'proto' => $proto, 'source' => $source, 'sport' => $sport]; - $this->client->post("/nodes/{$this->node}/firewall/rules", $parms); + return $this->getClient()->post("/nodes/{$this->node}/firewall/rules", $parms); } } @@ -7664,40 +7858,42 @@ function __construct($client, $node, $pos) /** * Delete rule. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @return Result */ public function deleteRule($digest = null) { $parms = ['digest' => $digest]; - $this->client->delete("/nodes/{$this->node}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->delete("/nodes/{$this->node}/firewall/rules/{$this->pos}", $parms); } /** * Get single rule data. - * @return mixed + * @return Result */ public function getRule() { - return $this->client->get("/nodes/{$this->node}/firewall/rules/{$this->pos}"); + return $this->getClient()->get("/nodes/{$this->node}/firewall/rules/{$this->pos}"); } /** * Modify rule data. - * @param $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. - * @param $comment Descriptive comment. - * @param $delete A list of settings you want to delete. - * @param $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $enable Flag to enable/disable a rule. - * @param $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. - * @param $macro Use predefined standard macro. - * @param $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. - * @param $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. - * @param $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. - * @param $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. - * @param $type Rule type. + * @param string $action Rule action ('ACCEPT', 'DROP', 'REJECT') or security group name. + * @param string $comment Descriptive comment. + * @param string $delete A list of settings you want to delete. + * @param string $dest Restrict packet destination address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $dport Restrict TCP/UDP destination port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param int $enable Flag to enable/disable a rule. + * @param string $iface Network interface name. You have to use network configuration key names for VMs and containers ('net\d+'). Host related rules can use arbitrary strings. + * @param string $macro Use predefined standard macro. + * @param int $moveto Move rule to new position &lt;moveto&gt;. Other arguments are ignored. + * @param string $proto IP protocol. You can use protocol names ('tcp'/'udp') or simple numbers, as defined in '/etc/protocols'. + * @param string $source Restrict packet source address. This can refer to a single IP address, an IP set ('+ipsetname') or an IP alias definition. You can also specify an address range like '20.34.101.207-201.3.9.99', or a list of IP addresses and networks (entries are separated by comma). Please do not mix IPv4 and IPv6 addresses inside such lists. + * @param string $sport Restrict TCP/UDP source port. You can use service names or simple numbers (0-65535), as defined in '/etc/services'. Port ranges can be specified with '\d+:\d+', for example '80:85', and you can use comma separated list to match several ports or ranges. + * @param string $type Rule type. * Enum: in,out,group + * @return Result */ public function updateRule($action = null, $comment = null, $delete = null, $dest = null, $digest = null, $dport = null, $enable = null, $iface = null, $macro = null, $moveto = null, $proto = null, $source = null, $sport = null, $type = null) { @@ -7715,7 +7911,7 @@ public function updateRule($action = null, $comment = null, $delete = null, $des 'source' => $source, 'sport' => $sport, 'type' => $type]; - $this->client->put("/nodes/{$this->node}/firewall/rules/{$this->pos}", $parms); + return $this->getClient()->put("/nodes/{$this->node}/firewall/rules/{$this->pos}", $parms); } } @@ -7731,31 +7927,32 @@ function __construct($client, $node) /** * Get host firewall options. - * @return mixed + * @return Result */ public function getOptions() { - return $this->client->get("/nodes/{$this->node}/firewall/options"); + return $this->getClient()->get("/nodes/{$this->node}/firewall/options"); } /** * Set Firewall options. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $enable Enable host firewall rules. - * @param $log_level_in Log level for incoming traffic. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $enable Enable host firewall rules. + * @param string $log_level_in Log level for incoming traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $log_level_out Log level for outgoing traffic. + * @param string $log_level_out Log level for outgoing traffic. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $ndp Enable NDP. - * @param $nf_conntrack_max Maximum number of tracked connections. - * @param $nf_conntrack_tcp_timeout_established Conntrack established timeout. - * @param $nosmurfs Enable SMURFS filter. - * @param $smurf_log_level Log level for SMURFS filter. + * @param bool $ndp Enable NDP. + * @param int $nf_conntrack_max Maximum number of tracked connections. + * @param int $nf_conntrack_tcp_timeout_established Conntrack established timeout. + * @param bool $nosmurfs Enable SMURFS filter. + * @param string $smurf_log_level Log level for SMURFS filter. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $tcp_flags_log_level Log level for illegal tcp flags filter. + * @param string $tcp_flags_log_level Log level for illegal tcp flags filter. * Enum: emerg,alert,crit,err,warning,notice,info,debug,nolog - * @param $tcpflags Filter illegal combinations of TCP flags. + * @param bool $tcpflags Filter illegal combinations of TCP flags. + * @return Result */ public function setOptions($delete = null, $digest = null, $enable = null, $log_level_in = null, $log_level_out = null, $ndp = null, $nf_conntrack_max = null, $nf_conntrack_tcp_timeout_established = null, $nosmurfs = null, $smurf_log_level = null, $tcp_flags_log_level = null, $tcpflags = null) { @@ -7771,7 +7968,7 @@ public function setOptions($delete = null, $digest = null, $enable = null, $log_ 'smurf_log_level' => $smurf_log_level, 'tcp_flags_log_level' => $tcp_flags_log_level, 'tcpflags' => $tcpflags]; - $this->client->put("/nodes/{$this->node}/firewall/options", $parms); + return $this->getClient()->put("/nodes/{$this->node}/firewall/options", $parms); } } @@ -7787,15 +7984,15 @@ function __construct($client, $node) /** * Read firewall log - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function log($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/firewall/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/firewall/log", $parms); } } @@ -7816,13 +8013,13 @@ public function get($id) /** * List status of all replication jobs on this node. - * @param $guest Only list replication jobs for this guest. - * @return mixed + * @param int $guest Only list replication jobs for this guest. + * @return Result */ public function status($guest = null) { $parms = ['guest' => $guest]; - return $this->client->get("/nodes/{$this->node}/replication", $parms); + return $this->getClient()->get("/nodes/{$this->node}/replication", $parms); } } @@ -7861,11 +8058,11 @@ public function getScheduleNow() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/nodes/{$this->node}/replication/{$this->id}"); + return $this->getClient()->get("/nodes/{$this->node}/replication/{$this->id}"); } } @@ -7883,11 +8080,11 @@ function __construct($client, $node, $id) /** * Get replication job status. - * @return mixed + * @return Result */ public function jobStatus() { - return $this->client->get("/nodes/{$this->node}/replication/{$this->id}/status"); + return $this->getClient()->get("/nodes/{$this->node}/replication/{$this->id}/status"); } } @@ -7905,15 +8102,15 @@ function __construct($client, $node, $id) /** * Read replication job log. - * @param $limit - * @param $start - * @return mixed + * @param int $limit + * @param int $start + * @return Result */ public function readJobLog($limit = null, $start = null) { $parms = ['limit' => $limit, 'start' => $start]; - return $this->client->get("/nodes/{$this->node}/replication/{$this->id}/log", $parms); + return $this->getClient()->get("/nodes/{$this->node}/replication/{$this->id}/log", $parms); } } @@ -7931,11 +8128,11 @@ function __construct($client, $node, $id) /** * Schedule replication job to start as soon as possible. - * @return mixed + * @return Result */ public function scheduleNow() { - return $this->client->post("/nodes/{$this->node}/replication/{$this->id}/schedule_now"); + return $this->getClient()->post("/nodes/{$this->node}/replication/{$this->id}/schedule_now"); } } @@ -7951,11 +8148,11 @@ function __construct($client, $node) /** * API version details - * @return mixed + * @return Result */ public function version() { - return $this->client->get("/nodes/{$this->node}/version"); + return $this->getClient()->get("/nodes/{$this->node}/version"); } } @@ -7971,22 +8168,23 @@ function __construct($client, $node) /** * Read node status - * @return mixed + * @return Result */ public function status() { - return $this->client->get("/nodes/{$this->node}/status"); + return $this->getClient()->get("/nodes/{$this->node}/status"); } /** * Reboot or shutdown a node. - * @param $command Specify the command. + * @param string $command Specify the command. * Enum: reboot,shutdown + * @return Result */ public function nodeCmd($command) { $parms = ['command' => $command]; - $this->client->post("/nodes/{$this->node}/status", $parms); + return $this->getClient()->post("/nodes/{$this->node}/status", $parms); } } @@ -8002,11 +8200,11 @@ function __construct($client, $node) /** * Read tap/vm network device interface counters - * @return mixed + * @return Result */ public function netstat() { - return $this->client->get("/nodes/{$this->node}/netstat"); + return $this->getClient()->get("/nodes/{$this->node}/netstat"); } } @@ -8022,13 +8220,13 @@ function __construct($client, $node) /** * Execute multiple commands in order. - * @param $commands JSON encoded array of commands. - * @return mixed + * @param string $commands JSON encoded array of commands. + * @return Result */ public function execute($commands) { $parms = ['commands' => $commands]; - return $this->client->post("/nodes/{$this->node}/execute", $parms); + return $this->getClient()->post("/nodes/{$this->node}/execute", $parms); } } @@ -8044,19 +8242,19 @@ function __construct($client, $node) /** * Read node RRD statistics (returns PNG) - * @param $ds The list of datasources you want to display. - * @param $timeframe Specify the time frame you are interested in. + * @param string $ds The list of datasources you want to display. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrd($ds, $timeframe, $cf = null) { $parms = ['ds' => $ds, 'timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/rrd", $parms); + return $this->getClient()->get("/nodes/{$this->node}/rrd", $parms); } } @@ -8072,17 +8270,17 @@ function __construct($client, $node) /** * Read node RRD statistics - * @param $timeframe Specify the time frame you are interested in. + * @param string $timeframe Specify the time frame you are interested in. * Enum: hour,day,week,month,year - * @param $cf The RRD consolidation function + * @param string $cf The RRD consolidation function * Enum: AVERAGE,MAX - * @return mixed + * @return Result */ public function rrddata($timeframe, $cf = null) { $parms = ['timeframe' => $timeframe, 'cf' => $cf]; - return $this->client->get("/nodes/{$this->node}/rrddata", $parms); + return $this->getClient()->get("/nodes/{$this->node}/rrddata", $parms); } } @@ -8098,11 +8296,11 @@ function __construct($client, $node) /** * Read system log - * @param $limit - * @param $since Display all log since this date-time string. - * @param $start - * @param $until Display all log until this date-time string. - * @return mixed + * @param int $limit + * @param string $since Display all log since this date-time string. + * @param int $start + * @param string $until Display all log until this date-time string. + * @return Result */ public function syslog($limit = null, $since = null, $start = null, $until = null) { @@ -8110,7 +8308,7 @@ public function syslog($limit = null, $since = null, $start = null, $until = nul 'since' => $since, 'start' => $start, 'until' => $until]; - return $this->client->get("/nodes/{$this->node}/syslog", $parms); + return $this->getClient()->get("/nodes/{$this->node}/syslog", $parms); } } @@ -8126,11 +8324,11 @@ function __construct($client, $node) /** * Creates a VNC Shell proxy. - * @param $height sets the height of the console in pixels. - * @param $upgrade Run 'apt-get dist-upgrade' instead of normal shell. - * @param $websocket use websocket instead of standard vnc. - * @param $width sets the width of the console in pixels. - * @return mixed + * @param int $height sets the height of the console in pixels. + * @param bool $upgrade Run 'apt-get dist-upgrade' instead of normal shell. + * @param bool $websocket use websocket instead of standard vnc. + * @param int $width sets the width of the console in pixels. + * @return Result */ public function vncshell($height = null, $upgrade = null, $websocket = null, $width = null) { @@ -8138,7 +8336,7 @@ public function vncshell($height = null, $upgrade = null, $websocket = null, $wi 'upgrade' => $upgrade, 'websocket' => $websocket, 'width' => $width]; - return $this->client->post("/nodes/{$this->node}/vncshell", $parms); + return $this->getClient()->post("/nodes/{$this->node}/vncshell", $parms); } } @@ -8154,15 +8352,15 @@ function __construct($client, $node) /** * Opens a weksocket for VNC traffic. - * @param $port Port number returned by previous vncproxy call. - * @param $vncticket Ticket from previous call to vncproxy. - * @return mixed + * @param int $port Port number returned by previous vncproxy call. + * @param string $vncticket Ticket from previous call to vncproxy. + * @return Result */ public function vncwebsocket($port, $vncticket) { $parms = ['port' => $port, 'vncticket' => $vncticket]; - return $this->client->get("/nodes/{$this->node}/vncwebsocket", $parms); + return $this->getClient()->get("/nodes/{$this->node}/vncwebsocket", $parms); } } @@ -8178,15 +8376,15 @@ function __construct($client, $node) /** * Creates a SPICE shell. - * @param $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). - * @param $upgrade Run 'apt-get dist-upgrade' instead of normal shell. - * @return mixed + * @param string $proxy SPICE proxy server. This can be used by the client to specify the proxy server. All nodes in a cluster runs 'spiceproxy', so it is up to the client to choose one. By default, we return the node where the VM is currently running. As resonable setting is to use same node you use to connect to the API (This is window.location.hostname for the JS GUI). + * @param bool $upgrade Run 'apt-get dist-upgrade' instead of normal shell. + * @return Result */ public function spiceshell($proxy = null, $upgrade = null) { $parms = ['proxy' => $proxy, 'upgrade' => $upgrade]; - return $this->client->post("/nodes/{$this->node}/spiceshell", $parms); + return $this->getClient()->post("/nodes/{$this->node}/spiceshell", $parms); } } @@ -8202,19 +8400,20 @@ function __construct($client, $node) /** * Read DNS settings. - * @return mixed + * @return Result */ public function dns() { - return $this->client->get("/nodes/{$this->node}/dns"); + return $this->getClient()->get("/nodes/{$this->node}/dns"); } /** * Write DNS settings. - * @param $search Search domain for host-name lookup. - * @param $dns1 First name server IP address. - * @param $dns2 Second name server IP address. - * @param $dns3 Third name server IP address. + * @param string $search Search domain for host-name lookup. + * @param string $dns1 First name server IP address. + * @param string $dns2 Second name server IP address. + * @param string $dns3 Third name server IP address. + * @return Result */ public function updateDns($search, $dns1 = null, $dns2 = null, $dns3 = null) { @@ -8222,7 +8421,7 @@ public function updateDns($search, $dns1 = null, $dns2 = null, $dns3 = null) 'dns1' => $dns1, 'dns2' => $dns2, 'dns3' => $dns3]; - $this->client->put("/nodes/{$this->node}/dns", $parms); + return $this->getClient()->put("/nodes/{$this->node}/dns", $parms); } } @@ -8238,21 +8437,22 @@ function __construct($client, $node) /** * Read server time and time zone settings. - * @return mixed + * @return Result */ public function time() { - return $this->client->get("/nodes/{$this->node}/time"); + return $this->getClient()->get("/nodes/{$this->node}/time"); } /** * Set time zone. - * @param $timezone Time zone. The file '/usr/share/zoneinfo/zone.tab' contains the list of valid names. + * @param string $timezone Time zone. The file '/usr/share/zoneinfo/zone.tab' contains the list of valid names. + * @return Result */ public function setTimezone($timezone) { $parms = ['timezone' => $timezone]; - $this->client->put("/nodes/{$this->node}/time", $parms); + return $this->getClient()->put("/nodes/{$this->node}/time", $parms); } } @@ -8268,24 +8468,24 @@ function __construct($client, $node) /** * Get list of appliances. - * @return mixed + * @return Result */ public function aplinfo() { - return $this->client->get("/nodes/{$this->node}/aplinfo"); + return $this->getClient()->get("/nodes/{$this->node}/aplinfo"); } /** * Download appliance templates. - * @param $storage The storage where the template will be stored - * @param $template The template wich will downloaded - * @return mixed + * @param string $storage The storage where the template will be stored + * @param string $template The template wich will downloaded + * @return Result */ public function aplDownload($storage, $template) { $parms = ['storage' => $storage, 'template' => $template]; - return $this->client->post("/nodes/{$this->node}/aplinfo", $parms); + return $this->getClient()->post("/nodes/{$this->node}/aplinfo", $parms); } } @@ -8301,11 +8501,11 @@ function __construct($client, $node) /** * Gather various systems information about a node - * @return mixed + * @return Result */ public function report() { - return $this->client->get("/nodes/{$this->node}/report"); + return $this->getClient()->get("/nodes/{$this->node}/report"); } } @@ -8321,15 +8521,15 @@ function __construct($client, $node) /** * Start all VMs and containers (when onboot=1). - * @param $force force if onboot=0. - * @param $vms Only consider Guests with these IDs. - * @return mixed + * @param bool $force force if onboot=0. + * @param string $vms Only consider Guests with these IDs. + * @return Result */ public function startall($force = null, $vms = null) { $parms = ['force' => $force, 'vms' => $vms]; - return $this->client->post("/nodes/{$this->node}/startall", $parms); + return $this->getClient()->post("/nodes/{$this->node}/startall", $parms); } } @@ -8345,13 +8545,13 @@ function __construct($client, $node) /** * Stop all VMs and Containers. - * @param $vms Only consider Guests with these IDs. - * @return mixed + * @param string $vms Only consider Guests with these IDs. + * @return Result */ public function stopall($vms = null) { $parms = ['vms' => $vms]; - return $this->client->post("/nodes/{$this->node}/stopall", $parms); + return $this->getClient()->post("/nodes/{$this->node}/stopall", $parms); } } @@ -8367,17 +8567,17 @@ function __construct($client, $node) /** * Migrate all VMs and Containers. - * @param $target Target node. - * @param $maxworkers Maximal number of parallel migration job. If not set use 'max_workers' from datacenter.cfg, one of both must be set! - * @param $vms Only consider Guests with these IDs. - * @return mixed + * @param string $target Target node. + * @param int $maxworkers Maximal number of parallel migration job. If not set use 'max_workers' from datacenter.cfg, one of both must be set! + * @param string $vms Only consider Guests with these IDs. + * @return Result */ public function migrateall($target, $maxworkers = null, $vms = null) { $parms = ['target' => $target, 'maxworkers' => $maxworkers, 'vms' => $vms]; - return $this->client->post("/nodes/{$this->node}/migrateall", $parms); + return $this->getClient()->post("/nodes/{$this->node}/migrateall", $parms); } } @@ -8395,57 +8595,58 @@ public function get($storage) /** * Storage index. - * @param $type Only list storage of specific type + * @param string $type Only list storage of specific type * Enum: dir,drbd,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,rbd,sheepdog,zfs,zfspool - * @return mixed + * @return Result */ public function index($type = null) { $parms = ['type' => $type]; - return $this->client->get("/storage", $parms); + return $this->getClient()->get("/storage", $parms); } /** * Create a new storage. - * @param $storage The storage identifier. - * @param $type Storage type. + * @param string $storage The storage identifier. + * @param string $type Storage type. * Enum: dir,drbd,glusterfs,iscsi,iscsidirect,lvm,lvmthin,nfs,rbd,sheepdog,zfs,zfspool - * @param $authsupported Authsupported. - * @param $base Base volume. This volume is automatically activated. - * @param $blocksize block size - * @param $comstar_hg host group for comstar views - * @param $comstar_tg target group for comstar views - * @param $content Allowed content types. NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs. - * @param $disable Flag to disable the storage. - * @param $export NFS export path. - * @param $format Default image format. - * @param $is_mountpoint Assume the directory is an externally managed mountpoint. If nothing is mounted the storage will be considered offline. - * @param $iscsiprovider iscsi provider - * @param $krbd Access rbd through krbd kernel module. - * @param $maxfiles Maximal number of backup files per VM. Use '0' for unlimted. - * @param $mkdir Create the directory if it doesn't exist. - * @param $monhost Monitors daemon ips. - * @param $nodes List of cluster node names. - * @param $nowritecache disable write caching on the target - * @param $options NFS mount options (see 'man nfs') - * @param $path File system path. - * @param $pool Pool. - * @param $portal iSCSI portal (IP or DNS name with optional port). - * @param $redundancy The redundancy count specifies the number of nodes to which the resource should be deployed. It must be at least 1 and at most the number of nodes in the cluster. - * @param $saferemove Zero-out data when removing LVs. - * @param $saferemove_throughput Wipe throughput (cstream -t parameter value). - * @param $server Server IP or DNS name. - * @param $server2 Backup volfile server IP or DNS name. - * @param $shared Mark storage as shared. - * @param $sparse use sparse volumes - * @param $tagged_only Only use logical volumes tagged with 'pve-vm-ID'. - * @param $target iSCSI target. - * @param $thinpool LVM thin pool LV name. - * @param $transport Gluster transport: tcp or rdma + * @param string $authsupported Authsupported. + * @param string $base Base volume. This volume is automatically activated. + * @param string $blocksize block size + * @param string $comstar_hg host group for comstar views + * @param string $comstar_tg target group for comstar views + * @param string $content Allowed content types. NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs. + * @param bool $disable Flag to disable the storage. + * @param string $export NFS export path. + * @param string $format Default image format. + * @param bool $is_mountpoint Assume the directory is an externally managed mountpoint. If nothing is mounted the storage will be considered offline. + * @param string $iscsiprovider iscsi provider + * @param bool $krbd Access rbd through krbd kernel module. + * @param int $maxfiles Maximal number of backup files per VM. Use '0' for unlimted. + * @param bool $mkdir Create the directory if it doesn't exist. + * @param string $monhost Monitors daemon ips. + * @param string $nodes List of cluster node names. + * @param bool $nowritecache disable write caching on the target + * @param string $options NFS mount options (see 'man nfs') + * @param string $path File system path. + * @param string $pool Pool. + * @param string $portal iSCSI portal (IP or DNS name with optional port). + * @param int $redundancy The redundancy count specifies the number of nodes to which the resource should be deployed. It must be at least 1 and at most the number of nodes in the cluster. + * @param bool $saferemove Zero-out data when removing LVs. + * @param string $saferemove_throughput Wipe throughput (cstream -t parameter value). + * @param string $server Server IP or DNS name. + * @param string $server2 Backup volfile server IP or DNS name. + * @param bool $shared Mark storage as shared. + * @param bool $sparse use sparse volumes + * @param bool $tagged_only Only use logical volumes tagged with 'pve-vm-ID'. + * @param string $target iSCSI target. + * @param string $thinpool LVM thin pool LV name. + * @param string $transport Gluster transport: tcp or rdma * Enum: tcp,rdma,unix - * @param $username RBD Id. - * @param $vgname Volume group name. - * @param $volume Glusterfs Volume. + * @param string $username RBD Id. + * @param string $vgname Volume group name. + * @param string $volume Glusterfs Volume. + * @return Result */ public function create($storage, $type, $authsupported = null, $base = null, $blocksize = null, $comstar_hg = null, $comstar_tg = null, $content = null, $disable = null, $export = null, $format = null, $is_mountpoint = null, $iscsiprovider = null, $krbd = null, $maxfiles = null, $mkdir = null, $monhost = null, $nodes = null, $nowritecache = null, $options = null, $path = null, $pool = null, $portal = null, $redundancy = null, $saferemove = null, $saferemove_throughput = null, $server = null, $server2 = null, $shared = null, $sparse = null, $tagged_only = null, $target = null, $thinpool = null, $transport = null, $username = null, $vgname = null, $volume = null) { @@ -8486,7 +8687,7 @@ public function create($storage, $type, $authsupported = null, $base = null, $bl 'username' => $username, 'vgname' => $vgname, 'volume' => $volume]; - $this->client->post("/storage", $parms); + return $this->getClient()->post("/storage", $parms); } } @@ -8502,50 +8703,52 @@ function __construct($client, $storage) /** * Delete storage configuration. + * @return Result */ public function delete() { - $this->client->delete("/storage/{$this->storage}"); + return $this->getClient()->delete("/storage/{$this->storage}"); } /** * Read storage configuration. - * @return mixed + * @return Result */ public function read() { - return $this->client->get("/storage/{$this->storage}"); + return $this->getClient()->get("/storage/{$this->storage}"); } /** * Update storage configuration. - * @param $blocksize block size - * @param $comstar_hg host group for comstar views - * @param $comstar_tg target group for comstar views - * @param $content Allowed content types. NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs. - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $disable Flag to disable the storage. - * @param $format Default image format. - * @param $is_mountpoint Assume the directory is an externally managed mountpoint. If nothing is mounted the storage will be considered offline. - * @param $krbd Access rbd through krbd kernel module. - * @param $maxfiles Maximal number of backup files per VM. Use '0' for unlimted. - * @param $mkdir Create the directory if it doesn't exist. - * @param $nodes List of cluster node names. - * @param $nowritecache disable write caching on the target - * @param $options NFS mount options (see 'man nfs') - * @param $pool Pool. - * @param $redundancy The redundancy count specifies the number of nodes to which the resource should be deployed. It must be at least 1 and at most the number of nodes in the cluster. - * @param $saferemove Zero-out data when removing LVs. - * @param $saferemove_throughput Wipe throughput (cstream -t parameter value). - * @param $server Server IP or DNS name. - * @param $server2 Backup volfile server IP or DNS name. - * @param $shared Mark storage as shared. - * @param $sparse use sparse volumes - * @param $tagged_only Only use logical volumes tagged with 'pve-vm-ID'. - * @param $transport Gluster transport: tcp or rdma + * @param string $blocksize block size + * @param string $comstar_hg host group for comstar views + * @param string $comstar_tg target group for comstar views + * @param string $content Allowed content types. NOTE: the value 'rootdir' is used for Containers, and value 'images' for VMs. + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param bool $disable Flag to disable the storage. + * @param string $format Default image format. + * @param bool $is_mountpoint Assume the directory is an externally managed mountpoint. If nothing is mounted the storage will be considered offline. + * @param bool $krbd Access rbd through krbd kernel module. + * @param int $maxfiles Maximal number of backup files per VM. Use '0' for unlimted. + * @param bool $mkdir Create the directory if it doesn't exist. + * @param string $nodes List of cluster node names. + * @param bool $nowritecache disable write caching on the target + * @param string $options NFS mount options (see 'man nfs') + * @param string $pool Pool. + * @param int $redundancy The redundancy count specifies the number of nodes to which the resource should be deployed. It must be at least 1 and at most the number of nodes in the cluster. + * @param bool $saferemove Zero-out data when removing LVs. + * @param string $saferemove_throughput Wipe throughput (cstream -t parameter value). + * @param string $server Server IP or DNS name. + * @param string $server2 Backup volfile server IP or DNS name. + * @param bool $shared Mark storage as shared. + * @param bool $sparse use sparse volumes + * @param bool $tagged_only Only use logical volumes tagged with 'pve-vm-ID'. + * @param string $transport Gluster transport: tcp or rdma * Enum: tcp,rdma,unix - * @param $username RBD Id. + * @param string $username RBD Id. + * @return Result */ public function update($blocksize = null, $comstar_hg = null, $comstar_tg = null, $content = null, $delete = null, $digest = null, $disable = null, $format = null, $is_mountpoint = null, $krbd = null, $maxfiles = null, $mkdir = null, $nodes = null, $nowritecache = null, $options = null, $pool = null, $redundancy = null, $saferemove = null, $saferemove_throughput = null, $server = null, $server2 = null, $shared = null, $sparse = null, $tagged_only = null, $transport = null, $username = null) { @@ -8575,7 +8778,7 @@ public function update($blocksize = null, $comstar_hg = null, $comstar_tg = null 'tagged_only' => $tagged_only, 'transport' => $transport, 'username' => $username]; - $this->client->put("/storage/{$this->storage}", $parms); + return $this->getClient()->put("/storage/{$this->storage}", $parms); } } @@ -8637,11 +8840,11 @@ public function getPassword() /** * Directory index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/access"); + return $this->getClient()->get("/access"); } } @@ -8659,27 +8862,28 @@ public function get($userid) /** * User index. - * @param $enabled Optional filter for enable property. - * @return mixed + * @param bool $enabled Optional filter for enable property. + * @return Result */ public function index($enabled = null) { $parms = ['enabled' => $enabled]; - return $this->client->get("/access/users", $parms); + return $this->getClient()->get("/access/users", $parms); } /** * Create new user. - * @param $userid User ID - * @param $comment - * @param $email - * @param $enable Enable the account (default). You can set this to '0' to disable the accout - * @param $expire Account expiration date (seconds since epoch). '0' means no expiration date. - * @param $firstname - * @param $groups - * @param $keys Keys for two factor auth (yubico). - * @param $lastname - * @param $password Initial password. + * @param string $userid User ID + * @param string $comment + * @param string $email + * @param bool $enable Enable the account (default). You can set this to '0' to disable the accout + * @param int $expire Account expiration date (seconds since epoch). '0' means no expiration date. + * @param string $firstname + * @param string $groups + * @param string $keys Keys for two factor auth (yubico). + * @param string $lastname + * @param string $password Initial password. + * @return Result */ public function createUser($userid, $comment = null, $email = null, $enable = null, $expire = null, $firstname = null, $groups = null, $keys = null, $lastname = null, $password = null) { @@ -8693,7 +8897,7 @@ public function createUser($userid, $comment = null, $email = null, $enable = nu 'keys' => $keys, 'lastname' => $lastname, 'password' => $password]; - $this->client->post("/access/users", $parms); + return $this->getClient()->post("/access/users", $parms); } } @@ -8709,32 +8913,34 @@ function __construct($client, $userid) /** * Delete user. + * @return Result */ public function deleteUser() { - $this->client->delete("/access/users/{$this->userid}"); + return $this->getClient()->delete("/access/users/{$this->userid}"); } /** * Get user configuration. - * @return mixed + * @return Result */ public function readUser() { - return $this->client->get("/access/users/{$this->userid}"); + return $this->getClient()->get("/access/users/{$this->userid}"); } /** * Update user configuration. - * @param $append - * @param $comment - * @param $email - * @param $enable Enable/disable the account. - * @param $expire Account expiration date (seconds since epoch). '0' means no expiration date. - * @param $firstname - * @param $groups - * @param $keys Keys for two factor auth (yubico). - * @param $lastname + * @param bool $append + * @param string $comment + * @param string $email + * @param bool $enable Enable/disable the account. + * @param int $expire Account expiration date (seconds since epoch). '0' means no expiration date. + * @param string $firstname + * @param string $groups + * @param string $keys Keys for two factor auth (yubico). + * @param string $lastname + * @return Result */ public function updateUser($append = null, $comment = null, $email = null, $enable = null, $expire = null, $firstname = null, $groups = null, $keys = null, $lastname = null) { @@ -8747,7 +8953,7 @@ public function updateUser($append = null, $comment = null, $email = null, $enab 'groups' => $groups, 'keys' => $keys, 'lastname' => $lastname]; - $this->client->put("/access/users/{$this->userid}", $parms); + return $this->getClient()->put("/access/users/{$this->userid}", $parms); } } @@ -8765,23 +8971,24 @@ public function get($groupid) /** * Group index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/access/groups"); + return $this->getClient()->get("/access/groups"); } /** * Create new group. - * @param $groupid - * @param $comment + * @param string $groupid + * @param string $comment + * @return Result */ public function createGroup($groupid, $comment = null) { $parms = ['groupid' => $groupid, 'comment' => $comment]; - $this->client->post("/access/groups", $parms); + return $this->getClient()->post("/access/groups", $parms); } } @@ -8797,29 +9004,31 @@ function __construct($client, $groupid) /** * Delete group. + * @return Result */ public function deleteGroup() { - $this->client->delete("/access/groups/{$this->groupid}"); + return $this->getClient()->delete("/access/groups/{$this->groupid}"); } /** * Get group configuration. - * @return mixed + * @return Result */ public function readGroup() { - return $this->client->get("/access/groups/{$this->groupid}"); + return $this->getClient()->get("/access/groups/{$this->groupid}"); } /** * Update group data. - * @param $comment + * @param string $comment + * @return Result */ public function updateGroup($comment = null) { $parms = ['comment' => $comment]; - $this->client->put("/access/groups/{$this->groupid}", $parms); + return $this->getClient()->put("/access/groups/{$this->groupid}", $parms); } } @@ -8837,23 +9046,24 @@ public function get($roleid) /** * Role index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/access/roles"); + return $this->getClient()->get("/access/roles"); } /** * Create new role. - * @param $roleid - * @param $privs + * @param string $roleid + * @param string $privs + * @return Result */ public function createRole($roleid, $privs = null) { $parms = ['roleid' => $roleid, 'privs' => $privs]; - $this->client->post("/access/roles", $parms); + return $this->getClient()->post("/access/roles", $parms); } } @@ -8869,31 +9079,33 @@ function __construct($client, $roleid) /** * Delete role. + * @return Result */ public function deleteRole() { - $this->client->delete("/access/roles/{$this->roleid}"); + return $this->getClient()->delete("/access/roles/{$this->roleid}"); } /** * Get role configuration. - * @return mixed + * @return Result */ public function readRole() { - return $this->client->get("/access/roles/{$this->roleid}"); + return $this->getClient()->get("/access/roles/{$this->roleid}"); } /** * Create new role. - * @param $privs - * @param $append + * @param string $privs + * @param bool $append + * @return Result */ public function updateRole($privs, $append = null) { $parms = ['privs' => $privs, 'append' => $append]; - $this->client->put("/access/roles/{$this->roleid}", $parms); + return $this->getClient()->put("/access/roles/{$this->roleid}", $parms); } } @@ -8906,21 +9118,22 @@ function __construct($client) /** * Get Access Control List (ACLs). - * @return mixed + * @return Result */ public function readAcl() { - return $this->client->get("/access/acl"); + return $this->getClient()->get("/access/acl"); } /** * Update Access Control List (add or remove permissions). - * @param $path Access control path - * @param $roles List of roles. - * @param $delete Remove permissions (instead of adding it). - * @param $groups List of groups. - * @param $propagate Allow to propagate (inherit) permissions. - * @param $users List of users. + * @param string $path Access control path + * @param string $roles List of roles. + * @param bool $delete Remove permissions (instead of adding it). + * @param string $groups List of groups. + * @param bool $propagate Allow to propagate (inherit) permissions. + * @param string $users List of users. + * @return Result */ public function updateAcl($path, $roles, $delete = null, $groups = null, $propagate = null, $users = null) { @@ -8930,7 +9143,7 @@ public function updateAcl($path, $roles, $delete = null, $groups = null, $propag 'groups' => $groups, 'propagate' => $propagate, 'users' => $users]; - $this->client->put("/access/acl", $parms); + return $this->getClient()->put("/access/acl", $parms); } } @@ -8948,29 +9161,30 @@ public function get($realm) /** * Authentication domain index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/access/domains"); + return $this->getClient()->get("/access/domains"); } /** * Add an authentication server. - * @param $realm Authentication domain ID - * @param $type Realm type. + * @param string $realm Authentication domain ID + * @param string $type Realm type. * Enum: ad,ldap,pam,pve - * @param $base_dn LDAP base domain name - * @param $bind_dn LDAP bind domain name - * @param $comment Description. - * @param $default Use this as default realm - * @param $domain AD domain name - * @param $port Server port. - * @param $secure Use secure LDAPS protocol. - * @param $server1 Server IP address (or DNS name) - * @param $server2 Fallback Server IP address (or DNS name) - * @param $tfa Use Two-factor authentication. - * @param $user_attr LDAP user attribute name + * @param string $base_dn LDAP base domain name + * @param string $bind_dn LDAP bind domain name + * @param string $comment Description. + * @param bool $default Use this as default realm + * @param string $domain AD domain name + * @param int $port Server port. + * @param bool $secure Use secure LDAPS protocol. + * @param string $server1 Server IP address (or DNS name) + * @param string $server2 Fallback Server IP address (or DNS name) + * @param string $tfa Use Two-factor authentication. + * @param string $user_attr LDAP user attribute name + * @return Result */ public function create($realm, $type, $base_dn = null, $bind_dn = null, $comment = null, $default = null, $domain = null, $port = null, $secure = null, $server1 = null, $server2 = null, $tfa = null, $user_attr = null) { @@ -8987,7 +9201,7 @@ public function create($realm, $type, $base_dn = null, $bind_dn = null, $comment 'server2' => $server2, 'tfa' => $tfa, 'user_attr' => $user_attr]; - $this->client->post("/access/domains", $parms); + return $this->getClient()->post("/access/domains", $parms); } } @@ -9003,36 +9217,38 @@ function __construct($client, $realm) /** * Delete an authentication server. + * @return Result */ public function delete() { - $this->client->delete("/access/domains/{$this->realm}"); + return $this->getClient()->delete("/access/domains/{$this->realm}"); } /** * Get auth server configuration. - * @return mixed + * @return Result */ public function read() { - return $this->client->get("/access/domains/{$this->realm}"); + return $this->getClient()->get("/access/domains/{$this->realm}"); } /** * Update authentication server settings. - * @param $base_dn LDAP base domain name - * @param $bind_dn LDAP bind domain name - * @param $comment Description. - * @param $default Use this as default realm - * @param $delete A list of settings you want to delete. - * @param $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. - * @param $domain AD domain name - * @param $port Server port. - * @param $secure Use secure LDAPS protocol. - * @param $server1 Server IP address (or DNS name) - * @param $server2 Fallback Server IP address (or DNS name) - * @param $tfa Use Two-factor authentication. - * @param $user_attr LDAP user attribute name + * @param string $base_dn LDAP base domain name + * @param string $bind_dn LDAP bind domain name + * @param string $comment Description. + * @param bool $default Use this as default realm + * @param string $delete A list of settings you want to delete. + * @param string $digest Prevent changes if current configuration file has different SHA1 digest. This can be used to prevent concurrent modifications. + * @param string $domain AD domain name + * @param int $port Server port. + * @param bool $secure Use secure LDAPS protocol. + * @param string $server1 Server IP address (or DNS name) + * @param string $server2 Fallback Server IP address (or DNS name) + * @param string $tfa Use Two-factor authentication. + * @param string $user_attr LDAP user attribute name + * @return Result */ public function update($base_dn = null, $bind_dn = null, $comment = null, $default = null, $delete = null, $digest = null, $domain = null, $port = null, $secure = null, $server1 = null, $server2 = null, $tfa = null, $user_attr = null) { @@ -9049,7 +9265,7 @@ public function update($base_dn = null, $bind_dn = null, $comment = null, $defau 'server2' => $server2, 'tfa' => $tfa, 'user_attr' => $user_attr]; - $this->client->put("/access/domains/{$this->realm}", $parms); + return $this->getClient()->put("/access/domains/{$this->realm}", $parms); } } @@ -9062,21 +9278,22 @@ function __construct($client) /** * Dummy. Useful for formaters which want to priovde a login page. + * @return Result */ public function getTicket() { - $this->client->get("/access/ticket"); + return $this->getClient()->get("/access/ticket"); } /** * Create or verify authentication ticket. - * @param $password The secret password. This can also be a valid ticket. - * @param $username User name - * @param $otp One-time password for Two-factor authentication. - * @param $path Verify ticket, and check if user have access 'privs' on 'path' - * @param $privs Verify ticket, and check if user have access 'privs' on 'path' - * @param $realm You can optionally pass the realm using this parameter. Normally the realm is simply added to the username &lt;username&gt;@&lt;relam&gt;. - * @return mixed + * @param string $password The secret password. This can also be a valid ticket. + * @param string $username User name + * @param string $otp One-time password for Two-factor authentication. + * @param string $path Verify ticket, and check if user have access 'privs' on 'path' + * @param string $privs Verify ticket, and check if user have access 'privs' on 'path' + * @param string $realm You can optionally pass the realm using this parameter. Normally the realm is simply added to the username &lt;username&gt;@&lt;relam&gt;. + * @return Result */ public function createTicket($password, $username, $otp = null, $path = null, $privs = null, $realm = null) { @@ -9086,7 +9303,7 @@ public function createTicket($password, $username, $otp = null, $path = null, $p 'path' => $path, 'privs' => $privs, 'realm' => $realm]; - return $this->client->post("/access/ticket", $parms); + return $this->getClient()->post("/access/ticket", $parms); } } @@ -9099,14 +9316,15 @@ function __construct($client) /** * Change user password. - * @param $password The new password. - * @param $userid User ID + * @param string $password The new password. + * @param string $userid User ID + * @return Result */ public function changePasssword($password, $userid) { $parms = ['password' => $password, 'userid' => $userid]; - $this->client->put("/access/password", $parms); + return $this->getClient()->put("/access/password", $parms); } } @@ -9124,23 +9342,24 @@ public function get($poolid) /** * Pool index. - * @return mixed + * @return Result */ public function index() { - return $this->client->get("/pools"); + return $this->getClient()->get("/pools"); } /** * Create new pool. - * @param $poolid - * @param $comment + * @param string $poolid + * @param string $comment + * @return Result */ public function createPool($poolid, $comment = null) { $parms = ['poolid' => $poolid, 'comment' => $comment]; - $this->client->post("/pools", $parms); + return $this->getClient()->post("/pools", $parms); } } @@ -9156,27 +9375,29 @@ function __construct($client, $poolid) /** * Delete pool. + * @return Result */ public function deletePool() { - $this->client->delete("/pools/{$this->poolid}"); + return $this->getClient()->delete("/pools/{$this->poolid}"); } /** * Get pool configuration. - * @return mixed + * @return Result */ public function readPool() { - return $this->client->get("/pools/{$this->poolid}"); + return $this->getClient()->get("/pools/{$this->poolid}"); } /** * Update pool data. - * @param $comment - * @param $delete Remove vms/storage (instead of adding it). - * @param $storage List of storage IDs. - * @param $vms List of virtual machines. + * @param string $comment + * @param bool $delete Remove vms/storage (instead of adding it). + * @param string $storage List of storage IDs. + * @param string $vms List of virtual machines. + * @return Result */ public function updatePool($comment = null, $delete = null, $storage = null, $vms = null) { @@ -9184,7 +9405,7 @@ public function updatePool($comment = null, $delete = null, $storage = null, $vm 'delete' => $delete, 'storage' => $storage, 'vms' => $vms]; - $this->client->put("/pools/{$this->poolid}", $parms); + return $this->getClient()->put("/pools/{$this->poolid}", $parms); } } @@ -9197,11 +9418,11 @@ function __construct($client) /** * API version details. The result also includes the global datacenter confguration. - * @return mixed + * @return Result */ public function version() { - return $this->client->get("/version"); + return $this->getClient()->get("/version"); } } } \ No newline at end of file