Skip to content

Latest commit

 

History

History
112 lines (87 loc) · 2.47 KB

README.md

File metadata and controls

112 lines (87 loc) · 2.47 KB

api-keyweb

A PHP client library for accessing Keyweb AG server status API.

License: GNU AGPLv3

Examples of using Keyweb API

Get server list

$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->GetServerList();
print_r($result);

Get server properties

Function parameters

  • Server ID
$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->GetServerProperties('KM21212');
print_r($result);

Set server properties

Function parameters

  • Server ID
  • rDNS for first IP address
  • rDNS for second IP address
  • Server Name as FQDN
$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->SetServerProperties('KM21212', 'ns.status.keyweb.de', 'ns2.status.keyweb.de', 'status.keyweb.de');
print_r($result);

Get reset history by server

Function parameters

  • Server ID
$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->ResetHistory('KM21212');
print_r($result);

Reset server

Function parameters

  • Server ID
  • Customer Number (for reset history)
$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->Reset('KM21212', '23232');
print_r($result);

Get traffic history by server

Function parameters

  • Server ID
  • Type of history
    • today
    • yesterday
    • weekly
    • monthly
    • date
    • lastslots
  • Date (only neccesary by using type 'date')
  • Last slots (only neccesary by using type 'lastslots')

API response

Depending on which 'type' was chosen, you get different response formats.

If you using the types today, yesterday, weekly or monthly, you will get a PNG graphic of the traffic history encoded in base64. In the other cases (date, lastslots), you get a tabular listing of the numeric traffic values.

$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->Traffic('KM21212');
print_r($result);

Set IP address reverse lookup

Function parameters

  • Server ID
  • IP address
  • rDNS
$keyweb = new Keyweb('23232', 'apiuser', 'apipass');
$keyweb->debug(true);

$result = $keyweb->SetReverseLookup('KM21212', '95.169.160.13', 'status.keyweb.de');
print_r($result);

External Resources