PHP RRD API error

spcvlt

Renowned Member
Sep 10, 2016
10
0
66
28
Hello everyone,

i want to get rrddata from webapi. I use the https://github.com/CpuID/pve2-api-php-client PHP-API. But this is dosent work. Can anyone help me?

PHP:
if ($px->login ()) {

        $status = $px->get("/nodes/kvm11/qemu/223/rrddata", array('timeframe' => 'hour'));
        var_dump($status);
        }

Code:
---------------------------------------------- 
FULL RESPONSE:  HTTP/1.1 400 Parameter verification failed. 
Cache-Control: max-age=0 Connection: close 
Date: Tue, 27 Sep 2016 21:25:59 GMT 
Pragma: no-cache Server: pve-api-daemon/3.0 
Content-Length: 81 
Content-Type: application/json;charset=UTF-8 Expires: Tue, 27 Sep 2016 21:25:59 GMT  {"errors":{"timeframe":"property is missing and it is not optional"},"data":null}  
END FULL RESPONSE  
Headers:  HTTP/1.1 400 Parameter verification failed. 
Cache-Control: max-age=0 
Connection: close 
Date: Tue, 27 Sep 2016 21:25:59 GMT 
Pragma: no-cache Server: pve-api-daemon/3.0 Content-Length: 81 
Content-Type: application/json;charset=UTF-8 Expires: Tue, 27 Sep 2016 21:25:59 GMT  
End Headers  Data:  {"errors":{"timeframe":"property is missing and it is not optional"},"data":null}  End Data  RESPONSE ARRA
 
Hi,

this error comes form a missing parameter.
I would check your array.
 
Thank you! I will try this php api.

can you say me in what unit these data? These are the data of the api of rrddata:
Code:
array (
    'diskread' => 866.13333333333298,
    'netin' => 595.68253009259297,
    'disk' => 0,
    'cpu' => 0.054978348011310497,
    'time' => 1473465600,
    'netout' => 1108.6603912037001,
    'maxdisk' => 16106127360,
    'maxmem' => 536870912,
    'maxcpu' => 1,
    'diskwrite' => 5995.6148148148104,
    'mem' => 297400986.92740703,
  ),