API Get Service List

From Virtualizor Wiki
Jump to: navigation, search

Get Services List

Example Code

<?php

    require_once('admin.php');

    $key =  'uketenhrhpunty5lhgwkcuxxxxxxxxxx';

    $pass = 'yrsofc3tg3tre7bjpfppspxxxxxxxxxx';

    $ip = 'xxx.xxx.xxx.xxx';

    $admin = new Virtualizor_Admin_API($ip, $key, $pass);

    $output = $admin->services();
    print_r($output);
?>

Returns:

Array
(
    [title] => Services
    [autostart] => Array
        (
            [0] => acpid
            [1] => auditd
            [2] => blk-availability
            [3] => cgconfig
            [4] => crond
            [5] => dhcpd
            [6] => firstboot
            [7] => haldaemon
            [8] => ip6tables
            [9] => iscsi
            [10] => iscsid
            [11] => ksm
            [12] => ksmtuned
            [13] => libvirt-guests
            [14] => libvirtd
            [15] => lvm2-monitor
            [16] => mdmonitor
            [17] => messagebus
            [18] => netfs
            [19] => network
            [20] => nfslock
            [21] => portreserve
            [22] => rpcbind
            [23] => rpcgssd
            [24] => rsyslog
            [25] => sendmail
            [26] => sshd
            [27] => udev-post
            [28] => vboxautostart-service
            [29] => vboxballoonctrl-service
            [30] => vboxdrv
            [31] => vboxweb-service
            [32] => virtnetwork
            [33] => virtualizor
            [34] => zzvirtservice
        )

    [running] => Array
        (
            [0] => acpid
            [1] => auditd
            [2] => cgconfig
            [3] => crond
            [4] => dhcpd
            [5] => dnsmasq
            [6] => ebtables
            [7] => firstboot
            [8] => haldaemon
            [9] => ip6tables
            [10] => ipmi
            [11] => iptables
            [12] => ksm
            [13] => ksmtuned
            [14] => libvirtd
            [15] => mdmonitor
            [16] => messagebus
            [17] => netconsole
            [18] => network
            [19] => nfslock
            [20] => rpcbind
            [21] => rsyslog
            [22] => sendmail
            [23] => sshd
            [24] => vboxballoonctrl-service
            [25] => vboxdrv
            [26] => vboxweb-service
            [27] => virtnetwork
            [28] => virtualizor
        )

    [services] => Array
        (
            [0] => acpid
            [1] => auditd
            [2] => cgconfig
            [3] => crond
            [4] => dhcpd
            [5] => dnsmasq
            [6] => ebtables
            [7] => firstboot
            [8] => haldaemon
            [9] => ip6tables
            [10] => ipmi
            [11] => iptables
            [12] => ksm
            [13] => ksmtuned
            [14] => libvirtd
            [15] => mdmonitor
            [16] => messagebus
            [17] => netconsole
            [18] => network
            [19] => nfslock
            [20] => rpcbind
            [21] => rsyslog
            [22] => sendmail
            [23] => sshd
            [24] => vboxballoonctrl-service
            [25] => vboxdrv
            [26] => vboxweb-service
            [27] => virtnetwork
            [28] => virtualizor
            [31] => blk-availability
            [38] => iscsi
            [39] => iscsid
            [42] => libvirt-guests
            [44] => lvm2-monitor
            [47] => netfs
            [50] => portreserve
            [52] => rpcgssd
            [56] => udev-post
            [57] => vboxautostart-service
            [63] => zzvirtservice
        )

    [timenow] => 1403247121
    [time_taken] => 1.026
)