API Ostemplates Lists

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 Ostemplates Lists

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->ostemplates();
    print_r($output);
?>

Returns:

Array
(
    [3] => Array
        (
            [osid] => 3
            [type] => openvz
            [name] => centos-5-x86
            [filename] => centos-5-x86.tar.gz
            [size] => 182495369
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 0
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=3
            [distro] => centos
        )

    [4] => Array
        (
            [osid] => 4
            [type] => openvz
            [name] => centos-5-x86_64
            [filename] => centos-5-x86_64.tar.gz
            [size] => 192755726
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 0
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=4
            [distro] => centos
        )

    [88] => Array
        (
            [osid] => 88
            [type] => kvm
            [name] => centos-5.8-x86
            [filename] => centos-5.8-x86.img
            [size] => 1175519232
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=88
            [distro] => centos
        )

    [89] => Array
        (
            [osid] => 89
            [type] => kvm
            [name] => centos-5.8-x86_64
            [filename] => centos-5.8-x86_64.img
            [size] => 1175519232
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=89
            [distro] => centos
        )

    [100] => Array
        (
            [osid] => 100
            [type] => kvm
            [name] => ubuntu-12.04-x86
            [filename] => ubuntu-12.04-x86.img
            [size] => 1175519232
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=100
            [distro] => ubuntu
        )

    [101] => Array
        (
            [osid] => 101
            [type] => kvm
            [name] => ubuntu-12.04-x86_64
            [filename] => ubuntu-12.04-x86_64.img
            [size] => 1175519232
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=101
            [distro] => ubuntu
        )

    [116] => Array
        (
            [osid] => 116
            [type] => openvz
            [name] => centos-6-x86
            [filename] => centos-6-x86.tar.gz
            [size] => 212728128
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 0
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=116
            [distro] => centos
        )

    [151] => Array
        (
            [osid] => 151
            [type] => kvm
            [name] => ubuntu-12.10-x86
            [filename] => ubuntu-12.10-x86.img
            [size] => 1259405312
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=151
            [distro] => ubuntu
        )

    [152] => Array
        (
            [osid] => 152
            [type] => kvm
            [name] => ubuntu-12.10-x86_64
            [filename] => ubuntu-12.10-x86_64.img
            [size] => 1259405312
            [pygrub] => 0
            [drive] => 
            [hvm] => 0
            [perf_ops] => 1
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=152
            [distro] => ubuntu
        )

    [175] => Array
        (
            [osid] => 175
            [type] => xen
            [name] => centos-5.8-x86
            [filename] => centos-5.8-x86.tar.gz
            [size] => 217149172
            [pygrub] => 1
            [drive] => 
            [hvm] => 0
            [perf_ops] => 0
            [active] => 1
            [url] => http://files.virtualizor.com/ostemplates.php?osid=175
            [distro] => centos
        )

        .
        .
        .
)