1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
// Configuration $host = 'xxx.ovh.com'; $ip = 'xx.xx.xx.xx'; $login = 'xxxx-ovh'; $password = 'pass'; $types = array('traffic', 'packet', 'error'); $durations = array('day', 'week', 'month', 'year'); try { $soap = new SoapClient("https://www.ovh.com/soapi/soapi-re-1.61.wsdl"); $session = $soap->login($login, $password,"fr", false); foreach ($types as $type) { foreach ($durations as $duration) { $result[$type][$duration] = $soap->dedicatedMrtgInfo($session, $host, $type, $duration, $ip); } } $soap->logout($session); } catch(SoapFault $fault) { echo $fault; } |