Skip to content

Commit 6359678

Browse files
committed
Merge pull request #3 from ypilpre/patch-1
Update pve2_api.class.php
2 parents d8caa09 + 417d53b commit 6359678

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

pve2_api.class.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,48 @@ public function get_node_list () {
341341
return $this->pve_cluster_node_list;
342342
}
343343

344+
345+
/*
346+
Get Last VMID from a Cluster or a Node
347+
348+
return an VMID
349+
*/
350+
351+
public function get_next_vmid() {
352+
if (!$this->constructor_success) {
353+
return false;
354+
}
355+
$vmid = $this->pve_action("/cluster/nextid","GET");
356+
if ($vmid == null)
357+
{
358+
return false;
359+
}else {
360+
return $vmid;
361+
}
362+
363+
/*
364+
Return the version and minor revision of Proxmox Server
365+
*/
366+
367+
368+
public function get_version() {
369+
if (!$this->constructor_success) {
370+
return false;
371+
}
372+
$version = $this->pve_action("/version","GET");
373+
if ($version == null)
374+
{
375+
return false;
376+
}else {
377+
return $version['version'];
378+
}
379+
380+
381+
}
382+
383+
384+
385+
344386
/*
345387
* object/array? get (string action_path)
346388
*/

0 commit comments

Comments
 (0)