API Get Logs

From Virtualizor Wiki
Jump to: navigation, search
NOTE
This is OLD API Documentation. Click on the following link for New API Documentation
Admin API

Get Logs


Parameters Description
page_number If not specified, then only first 50 records are returned
count Number of records to be returned, default is 50

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->logs( 1 );
    
    print_r($output);

?>

Returns:

Array
(
    [title] => Logs
    [logs] => Array
        (
            [3161] => Array
                (
                    [actid] => 3161
                    [uid] => 0
                    [id] => 1063
                    [action] => rebuild
                    [data] => 1138
                    [time] => 1403072155
                    [status] => 1
                    [ip] => 
                    [email] => root
                )

            
            [3174] => Array
                (
                    [actid] => 3174
                    [uid] => 0
                    [id] => 175
                    [action] => edittemplate
                    [data] => 
                    [time] => 1403161021
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3175] => Array
                (
                    [actid] => 3175
                    [uid] => 0
                    [id] => 100008
                    [action] => edittemplate
                    [data] => windows_2003R264.img
                    [time] => 1403161208
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3171] => Array
                (
                    [actid] => 3171
                    [uid] => 0
                    [id] => 0
                    [action] => config
                    [data] => 
                    [time] => 1403090685
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3172] => Array
                (
                    [actid] => 3172
                    [uid] => 0
                    [id] => 0
                    [action] => config
                    [data] => 
                    [time] => 1403158198
                    [status] => 1
                    [ip] =>xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3170] => Array
                (
                    [actid] => 3170
                    [uid] => 0
                    [id] => 1
                    [action] => editserver
                    [data] => 0dot114
                    [time] => 1403079932
                    [status] => 1
                    [ip] =>xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3168] => Array
                (
                    [actid] => 3168
                    [uid] => 0
                    [id] => 5
                    [action] => editplan
                    [data] => xen
                    [time] => 1403079253
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3169] => Array
                (
                    [actid] => 3169
                    [uid] => 0
                    [id] => 1
                    [action] => addserver
                    [data] => 0dot114
                    [time] => 1403079519
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3165] => Array
                (
                    [actid] => 3165
                    [uid] => 0
                    [id] => 5
                    [action] => editplan
                    [data] => xen
                    [time] => 1403079158
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3166] => Array
                (
                    [actid] => 3166
                    [uid] => 0
                    [id] => 5
                    [action] => editplan
                    [data] => xen_apitest
                    [time] => 1403079183
                    [status] => 1
                    [ip] => 115.97.2.181
                    [email] => root
                )

            [3167] => Array
                (
                    [actid] => 3167
                    [uid] => 0
                    [id] => 5
                    [action] => editplan
                    [data] => xen_apitest
                    [time] => 1403079188
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3163] => Array
                (
                    [actid] => 3163
                    [uid] => 0
                    [id] => 252
                    [action] => editippool
                    [data] => test
                    [time] => 1403075631
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

            [3164] => Array
                (
                    [actid] => 3164
                    [uid] => 0
                    [id] => 5
                    [action] => editplan
                    [data] => xen
                    [time] => 1403078731
                    [status] => 1
                    [ip] => xxx.xxx.xxx.xxx
                    [email] => root
                )

        )

    [timenow] => 1403242282
    [time_taken] => 0.016
)