Tasks

Use Tasks API to get detailed information of the tasks performed on VPS on your server.

HTTP Request

https://hostname:4083/index.php?act=ctasks&svs=vpsid

Parameters

NameTypeValueDescriptionRequired
actGETctasksThe action will retrieve all data regarding to the particular vpsYes
svsPOSTvpsidThe vps whose tasks needs to be retrievedYes

Sample Code

PHP

<?php
    require_once('/usr/local/virtualizor/sdk/enduser.php');

    $key =  'your_api_key';
    $pass = 'your_api_pass';
    $ip = 'your_Server_ip';

    $admin = new Virtualizor_Enduser_API($ip, $key, $pass);
    $post['act'] = "ctasks";
    $post['svs'] = 3609;

    $output = $admin->tasks($post);

    print_r(json_encode($output));
?>

Curl

curl -k -X GET -L "https://hostname:4083/index.php?act=ctasks&svs=3609&api=json&apikey=you_api_key&apipass=your_api_pass"

Output

{
    "uid": "372",
    "act": "ctasks",
    "timezone": 1,
    "timenow": "October 9, 2016, 3:37 am",
    "vpsid": "3609",
    "username": "test@test.com",
    "user_type": "2",
    "preferences": {
        "fname": "test",
        "lname": "test",
        "language": "english",
        "theme": "default",
        "timezone": 1,
        "logo": ""
    },
    "url": "index.php?",
    "rdns": {
        "pdnsid": "12"
    },
    "pdns": {
        "pdnsid": "12"
    },
    "support_link": "http://softaculous.com",
    "title": "Tasks",
    "tasks": {
        "_2407": {
            "actid": "2407",
            "slaveactid": "0",
            "uid": "0",
            "vpsid": "3609",
            "serid": "0",
            "action": "Install Recipe",
            "data": "a:6:{s:3:"rid";s:1:"9";s:4:"name";s:7:"test287";s:4:"code";s:25:"#!/bin/shnntouch /newtest";s:4:"desc";s:16:"Just testing yar";s:4:"logo";s:0:"";s:6:"status";s:1:"1";}",
            "time": "1475972822",
            "status_txt": "Change will occur when the VPS is booted again.",
            "status": "1",
            "progress": "0%",
            "started": "Task not Started",
            "updated": "Task not Updated",
            "ended": "Task not Ended",
            "proc_id": "0",
            "ip": "127.0.0.1",
            "internal": "0",
            "email": "root",
            "server_name": "localhost"
        },
        "_2391": {
            "actid": "2391",
            "slaveactid": "0",
            "uid": "0",
            "vpsid": "3609",
            "serid": "0",
            "action": "VPS Start",
            "data": "b:0;",
            "time": "1475818020",
            "status_txt": "Task Completed",
            "status": "1",
            "progress": "Task Completed",
            "started": "October 7, 2016, 6:27 am",
            "updated": "October 7, 2016, 6:27 am",
            "ended": "October 7, 2016, 6:27 am",
            "proc_id": "0",
            "ip": "",
            "internal": "0",
            "email": "root",
            "server_name": "localhost"
        },
        "_2390": {
            "actid": "2390",
            "slaveactid": "0",
            "uid": "0",
            "vpsid": "3609",
            "serid": "0",
            "action": "Changing Password",
            "time": "1475818019",
            "status_txt": "Completed",
            "status": "1",
            "progress": "Task Completed",
            "started": "October 7, 2016, 7:57 am",
            "updated": "October 7, 2016, 7:57 am",
            "ended": "October 7, 2016, 7:57 am",
            "proc_id": "0",
            "ip": "",
            "internal": "0",
            "email": "root",
            "data": "b:0;",
            "server_name": "localhost"
        },
        "_2389": {
            "actid": "2389",
            "slaveactid": "0",
            "uid": "372",
            "vpsid": "3609",
            "serid": "0",
            "action": "VPS Start",
            "data": "b:0;",
            "time": "1475818011",
            "status_txt": "Task Completed",
            "status": "1",
            "progress": "Task Completed",
            "started": "October 7, 2016, 6:26 am",
            "updated": "October 7, 2016, 6:27 am",
            "ended": "October 7, 2016, 6:27 am",
            "proc_id": "0",
            "ip": "58.146.104.55",
            "internal": "0",
            "email": "test@test.com",
            "server_name": "localhost"
        },
        "_2388": {
            "actid": "2388",
            "slaveactid": "0",
            "uid": "0",
            "vpsid": "3609",
            "serid": "0",
            "action": "Creating VPS",
            "data": "a:10:{s:12:"progress_msg";s:25:"Performing final steps...";s:5:"newvs";a:59:{s:4:"uuid";s:16:"bibk7btcce26eauw";s:4:"plid";i:0;s:8:"hostname";s:12:"test_userapi";s:5:"space";i:10;s:3:"ram";i:1024;s:9:"bandwidth";i:0;s:13:"network_speed";i:0;s:12:"upload_speed";i:-1;s:5:"cores";i:4;s:6:"cpupin";i:-1;s:3:"uid";i:372;s:2:"io";i:0;s:5:"burst";i:0;s:11:"cpu_percent";i:200;s:4:"swap";i:1024;s:4:"acpi";i:1;s:4:"apic";i:1;s:3:"pae";i:1;s:3:"vnc";i:1;s:7:"vncport";i:0;s:6:"shadow";i:0;s:4:"virt";s:3:"kvm";s:3:"hvm";i:0;s:3:"iso";s:0:"";s:4:"boot";s:3:"cda";s:12:"band_suspend";i:1;s:6:"tuntap";i:0;s:3:"ppp";i:0;s:10:"mac_status";i:0;s:17:"osreinstall_limit";i:0;s:2:"mg";a:0:{}s:6:"webuzo";i:0;s:9:"kvm_cache";s:0:"";s:7:"io_mode";s:0:"";s:10:"vnc_keymap";s:0:"";s:6:"virtio";i:0;s:8:"cpu_mode";s:0:"";s:13:"admin_managed";i:0;s:3:"rdp";i:0;s:17:"disable_nw_config";i:0;s:16:"topology_sockets";i:0;s:14:"topology_cores";i:0;s:16:"topology_threads";i:0;s:3:"mac";s:0:"";s:4:"osid";i:347;s:3:"cpu";i:1024;s:7:"sec_iso";s:0:"";s:7:"kvm_vga";i:0;s:12:"acceleration";i:0;s:16:"disable_ebtables";i:0;s:8:"vps_name";s:5:"v2117";s:3:"ubc";s:0:"";s:5:"vpsid";s:4:"3609";s:3:"ips";a:1:{i:0;s:7:"1.1.1.3";}s:4:"ipv6";a:0:{}s:11:"ipv6_subnet";a:0:{}s:7:"ips_int";a:0:{}s:11:"vnc_details";s:19:"199.204.187.90:6288";}s:3:"dns";a:0:{}s:5:"serid";i:0;s:10:"user_email";s:23:"test@test.com";s:9:"user_pass";N;s:7:"noemail";s:0:"";s:13:"add_to_backup";s:0:"";s:13:"control_panel";s:0:"";s:6:"recipe";i:0;}",
            "time": "1475817999",
            "status_txt": "Task Completed",
            "status": "1",
            "progress": "Task Completed",
            "started": "October 7, 2016, 6:26 am",
            "updated": "October 7, 2016, 6:27 am",
            "ended": "October 7, 2016, 6:27 am",
            "proc_id": "0",
            "ip": "127.0.0.1",
            "internal": "0",
            "email": "root",
            "server_name": "localhost"
        }
    },
    "page": {
        "start": "0",
        "len": 50,
        "maxNum": "8"
    },
    "time_taken": "0.098"
}
Was this helpful to you?