Ipmi - Endpoints Legacy Documentation

  • POST /ipmi/kvm

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
  • 
    {
        "success": true,
        "results": 1,
        "result": "BASE64_ENCODED_STRING"
    }
    ** Convert BASE64_DECODE(result) to {filename}.jnlp **
  • POST /ipmi/bandwidth

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • @param (enum) $start - Optional
      • day
      • week
      • month
    • @param (boolean) $graph - Optional
      • Default: True
  • 
    {
        "success": true,
        "results": 1,
        "result": {
            "SWITCH_NAME": {
                "1": {
                    "name": "PORT_ALIAS",
                    "data": {
                        "inbits_last": "423",
                        "outbits_last": "41",
                        "inbits_avg": "601",
                        "outbits_avg": "424",
                        "inbytes": "6490827",
                        "outbytes": "4584165",
                        "totalbytes": "11074992",
                        "95pct": "1780"
                    },
                    "graph": "BASE64_ENCODED_STRING"
                }
            }
        }
    }
    <img src="data:image/png;base64, BASE64_ENCODED_STRING">
  • POST /ipmi/user

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • @param (string) $username - Required
      • Match Pattern
        • @todo - REGEX MATCH [0-9]_[0-9]
    • @param (enum) $action - Required
      • createUser
      • deleteUser
      • resetPassword
  • 
    createUser
    {
        "success": true,
        "results": 3,
        "result": {
            "hostname": "127.0.0.1",
            "username": "YOUR_USERNAME",
            "password": "YOUR_PASSWORD"
        }
    }
    deleteUser
    {
        "success": true,
        "results": 1,
        "result": "User Removed"
    }
    resetPassword
    {
        "success": true,
        "results": 1,
        "result": {
            "value": "NEW_PASSWORD"
        }
    }
  • POST /ipmi/power

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • @param (enum) $action - Required
      • checkOn
        • Check if System is Powered On
      • checkOff
        • Check if System is Powered Off
      • on
        • Turn System Power On
      • off
        • Hard Shutdown
      • offHard
        • Hard Shutdown
      • offSoft
        • Request Graceful Shutdown
      • reboot
        • Power Cycle System ( Power Off wait 5 seconds Power On )
      • reset
        • Power Reset ( Reboot system without cutting power )
      • rebootPXE
        • Set next boot to PXE
      • rebootCDROM
        • Set next boot to CDROM
      • rebootBIOS
        • Set next boot to BIOS
  • POST /ipmi/reset

    • Description: Reset System IPMI Controller
    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • Return:
  • POST /ipmi/image

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • @param (enum) $action - Required
      • status
      • mountImage
      • unmountImage
      • setImage
        • @param (enum) $image - Required
          • CentOS-5.10-i386-bin-1of8.iso
          • CentOS-5.10-x86_64-bin-1of9.iso
          • CentOS-6.5-i386-minimal.iso
          • CentOS-6.5-x86_64-minimal.iso
          • Debian_5.0.9_x86_64.iso
          • Debian_5.0.9_x86.iso
          • Debian_6.0.7_x86_64.iso
          • Debian_6.0.7_x86.iso
          • Debian_7.0.0_x86_64.iso
          • Debian_7.0.0_x86.iso
          • ESXi-5.1.0.x86_64.iso
          • Fedora_16_x86_64.iso
          • Fedora_16_x86.iso
          • Fedora_17_x86_64.iso
          • Fedora_17_x86.iso
          • Fedora_18_x86_64.iso
          • Fedora_18_x86.iso
          • FreeNAS-9.1.0_x86_64.iso
          • FreeNAS-9.1.1_x86_64.iso
          • ubcd526.iso
          • ubcd527.iso
          • Ubuntu_10.04.4_x86_64.iso
          • Ubuntu_10.04.4_x86.iso
          • Ubuntu_11.10_x86_64.iso
          • Ubuntu_11.10_x86.iso
          • Ubuntu_12.04.2_x86_64.iso
          • Ubuntu_12.04.2_x86.iso
          • Ubuntu_12.10_x86_64.iso
          • Ubuntu_12.10_x86.iso
          • Ubuntu_13.04_x86_64.iso
          • Ubuntu_13.04_x86.iso
          • Ubuntu_13.10_x86_64.iso
          • Ubuntu_13.10_x86.iso
          • XenServer-5.6.0-install-cd.iso
          • XenServer-5.6.100-SP2-install-cd.iso
          • XenServer-6.0.0-install-cd.iso
          • XenServer-6.0.201-install-cd.iso
          • XenServer-6.1-install-cd.iso
          • XenServer-6.2.0-install-cd.iso
  • POST /ipmi/pxe

    • @param (string) $server - Required
      • Match Pattern
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}$
        • ^[dD][cC][0-9]{2}[rR][0-9]{2}[dD][sS][0-9]{2}[-][0-9]{2}$
    • @param (enum) $action - Required
      • status
      • stop
      • start
        • @param (enum)(int) $image - Required
          • 150
            • Centos 5 - 32 Bit
          • 149
            • Centos 5 - 64 Bit
          • 72
            • Centos 6 - 32 Bit
          • 71
            • Centos 6 - 64 Bit
          • 86
            • Debian 5 - 32 Bit
          • 85
            • Debian 5 - 64 Bit
          • 52
            • Debian 6 - 32 Bit
          • 55
            • Debian 6 - 64 Bit
          • 76
            • ProxmoxVE 2.0 - 64 Bit
          • 473
            • ProxmoxVE 3.0 - 64 Bit
          • 46
            • Scientific 6 - 64 Bit
          • 12
            • System Rescue - 32 Bit
          • 11
            • System Rescue - 64 Bit
          • 3
            • Ubuntu 10.04 - 32-bit
          • 2
            • Ubuntu 10.04 - 64 Bit
          • 64
            • Ubuntu 11.10 - 32 Bit
          • 68
            • Ubuntu 11.10 - 64 Bit
          • 80
            • Ubuntu 12.04 - 32 Bit
          • 79
            • Ubuntu 12.04 - 64 Bit
          • 82
            • Ubuntu 12.10 - 32 Bit
          • 81
            • Ubuntu 12.10 - 64 Bit
          • 224
            • Ubuntu 13.04 - 32 Bit
          • 223
            • Ubuntu 13.04 - 64 Bit
          • 25
            • Ultimate Boot CD - 32 Bit
          • 24
            • Ultimate Boot CD - 64 Bit
          • 61
            • VMware ESXi
          • 23
            • XenServer 5.6
          • 487
            • XenServer 6.2

IPMI - PHP Example


<?php
$q
->apiKey "YOUR_KEY";
$q->action "/ipmi/reset";
$q->post->server "SERVER_NAME";
foreach(
$q->post as $key => $value){
    
$postdata[$key] = $value;
}
$q->query http_build_query($postdata);
$ch curl_init();
curl_setopt($chCURLOPT_URL"API_URL" $q->action);
curl_setopt($chCURLOPT_HTTPHEADER, array("X-API-KEY: " $q->apiKey));
curl_setopt($chCURLOPT_POST1);
curl_setopt($chCURLOPT_TIMEOUT30);
curl_setopt($chCURLOPT_RETURNTRANSFER1);
curl_setopt($chCURLOPT_POSTFIELDS$api->query);
curl_setopt($chCURLOPT_FOLLOWLOCATION0);
curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
if(!
$result curl_exec($ch)){ 
    
trigger_error(curl_error($ch)); 

curl_close($ch); 
$d json_decode($result);
if(
$d->success == true){
    
$data->success true;
}else{
    
$data->success false;
}
$data->results $d->results;
$data->result $d->result;
return 
$data;
?>