Get Virtualizor

OS Reinstall

Use OS Reinstall API to reinstall current OS or new OS on VPS of your server.

HTTP Request

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

Parameters

NameTypeValueDescriptionRequired
actGETostemplateThe action will reinstall the os inside the vpsYes
svsPOSTvpsidThe vps in which the OS needs to be installed.This will be passed in URLYes
reinsosPOST1/0If set then the OS will be installed in the vpsYes
newosPOSTIntThe OS that needs to be installed inside the vps. Value will be osid.Yes
newpassPOSTnewpassThe password that needs to be set inside the vpsYes
confPOSTnewpassConfirmation required to set the password.Yes
vidPOSTvpsidThe vpsid in which OS will be re-installed.This will be passed as a POST ParameterYes
rebuild_sshkeyPOSTIntProvide public ssh key
No

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['reinsos'] = 1;
    $post['newos'] = '272';
    $post['newpass'] = 'Test123';
    $post['conf'] = 'Test123';
    $vid = 3096;
    $output = $admin->os($post,$vid);

    print_r(json_encode($output));
?>

Curl

curl -k -X POST -d "reinsos=1&newos=272&newpass=Test123 
&conf=Test123" -L"https://hostname:4083/index.php?act=ostemplate 
&svs=3609&api=json&apikey=your_api_key&apipass=your_api_pass"

Output

{
    "uid": "372",
    "act": "ostemplate",
    "timezone": 1,
    "timenow": "October 9, 2016, 4:50 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": "Re-Install OS",
    "done": {
        "msg": "The OS was reinstalled successfully"
    },
    "oslist": {
        "kvm": {
            "centos": {
                "272": {
                    "osid": "272",
                    "type": "kvm",
                    "name": "centos-6.5-x86_64",
                    "filename": "centos-6.5-x86_64.img",
                    "size": "1074855936",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=272",
                    "distro": "centos",
                    "Nvirt": "kvm"
                },
                "334": {
                    "osid": "334",
                    "type": "kvm",
                    "name": "centos-7.0-x86_64",
                    "filename": "centos-7.0-x86_64.img",
                    "size": "1291845632",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=334",
                    "distro": "centos",
                    "Nvirt": "kvm",
                    "mg": [16]
                },
                "347": {
                    "osid": "347",
                    "type": "kvm",
                    "name": "centos-6.6-x86_64",
                    "filename": "centos-6.6-x86_64.img",
                    "size": "1074855936",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=347",
                    "distro": "centos",
                    "Nvirt": "kvm"
                },
                "381": {
                    "osid": "381",
                    "type": "kvm",
                    "name": "centos-7.1-x86_64",
                    "filename": "centos-7.1-x86_64.img",
                    "size": "1074855936",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=381",
                    "distro": "centos",
                    "Nvirt": "kvm"
                }
            },
            "debian": {
                "399": {
                    "osid": "399",
                    "type": "kvm",
                    "name": "debian-8.0-x86_64",
                    "filename": "debian-8.0-x86_64.img",
                    "size": "1073741824",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=399",
                    "distro": "debian",
                    "Nvirt": "kvm"
                }
            },
            "ubuntu": {
                "405": {
                    "osid": "405",
                    "type": "kvm",
                    "name": "ubuntu-15.04-x86_64",
                    "filename": "ubuntu-15.04-x86_64.img",
                    "size": "1476395008",
                    "pygrub": "0",
                    "drive": "",
                    "hvm": "0",
                    "perf_ops": "1",
                    "active": "1",
                    "url": "http://files.virtualizor.com/ostemplates.php?osid=405",
                    "distro": "ubuntu",
                    "Nvirt": "kvm"
                },
                "100067": {
                    "type": "kvm",
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "url": "https://cloud-images.ubuntu.com/releases/16.04/release/ubuntu-16.04-server-cloudimg-amd64-disk1.img",
                    "filename": "ubuntu-16.04-server-cloudimg-amd64-disk1.img",
                    "name": "ubuntu-16.04-server-cloudimg-amd64-disk1.img",
                    "size": 309264384,
                    "distro": "ubuntu",
                    "Nvirt": "kvm"
                },
                "100083": {
                    "type": "kvm",
                    "url": "",
                    "filename": "ubuntu-16.04-x86_64",
                    "name": "ubuntu-16.04-x86_64",
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "size": 2147483648,
                    "distro": "ubuntu",
                    "Nvirt": "kvm"
                }
            },
            "others": {
                "100053": {
                    "type": "kvm",
                    "fstype": "ext3",
                    "url": "",
                    "filename": "install-image-6.34.4.img",
                    "name": "install-image-6.34.4",
                    "size": 67108864,
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100063": {
                    "type": "kvm",
                    "filename": "CentOSVirtioEnabledTemplate2.img",
                    "name": "CentOSVirtioEnabledTemplate2",
                    "url": "",
                    "size": 5368709120,
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100065": {
                    "type": "kvm",
                    "filename": "92_openvz_abhi.img",
                    "name": "92_openvz_abhi",
                    "url": "",
                    "size": 6442450944,
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100068": {
                    "type": "kvm",
                    "filename": "Ubuntu.img",
                    "name": "Ubuntu",
                    "url": "",
                    "size": 4294967296,
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100070": {
                    "type": "kvm",
                    "filename": "ub16041_testx64.img",
                    "name": "ub16041_testx64",
                    "url": "",
                    "size": 5368709120,
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100071": {
                    "type": "kvm",
                    "fstype": "ext3",
                    "url": "",
                    "filename": "mikrotek_chr_6363.img",
                    "name": "mikrotek_chr_6363.img",
                    "size": 134217728,
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100081": {
                    "type": "kvm",
                    "filename": "create-template.img",
                    "name": "create-template",
                    "url": "",
                    "size": 2147483648,
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "distro": "others",
                    "Nvirt": "kvm"
                },
                "100082": {
                    "type": "kvm",
                    "url": "",
                    "filename": "windows_2003R264.img",
                    "name": "windows_2003R264.img",
                    "fstype": "ext3",
                    "size": 5368709120,
                    "distro": "others",
                    "Nvirt": "kvm"
                }
            },
            "windows": {
                "100080": {
                    "type": "kvm",
                    "fstype": "ext3",
                    "perf_ops": "true",
                    "url": "",
                    "filename": "windows-2012server.img",
                    "name": "windows-2012server.img",
                    "size": 10737418240,
                    "distro": "windows",
                    "Nvirt": "kvm"
                }
            }
        },
        "openvz": {
            "centos": {
                "100077": {
                    "type": "openvz",
                    "fstype": "ext3",
                    "url": "https://download.openvz.org/template/precreated/centos-6-x86-minimal.tar.gz",
                    "filename": "centos-7-x86_64-minimal",
                    "name": "centos-7-x86_64-minimal",
                    "size": 125431402,
                    "distro": "centos",
                    "Nvirt": "openvz"
                }
            }
        }
    },
    "virt": "kvm",
    "distros": {
        "centos": {
            "distro": "centos",
            "name": "CentOS",
            "logo": "",
            "screenshot": "",
            "desc": "CentOS is an Enterprise-class Linux Distribution derived from sources freely provided to the public by a prominent North American Enterprise Linux vendor.n<br />n<br />nCentOS conforms fully with the upstream vendors redistribution policy and aims to be 100% binary compatible. CentOS mainly changes packages to remove upstream vendor branding and artwork.  n<br />n<br />nCentOS is developed by a small but growing team of core developers. CentOS is free.",
            "permanent": 1
        },
        "fedora": {
            "distro": "fedora",
            "name": "Fedora",
            "logo": "",
            "screenshot": "",
            "desc": "Fedora is a Linux-based operating system that showcases the latest in free and open source software. Fedora is always free for anyone to use, modify, and distribute. n<br />n<br />nIt is built by people across the globe who work together as a community: the Fedora Project. The Fedora Project is open and anyone is welcome to join.n<br />n<br />nThe Fedora Project is out front for you, leading the advancement of free, open software and content.",
            "permanent": 1
        },
        "suse": {
            "distro": "suse",
            "name": "openSUSE",
            "logo": "",
            "screenshot": "",
            "desc": "openSUSE is a free and Linux-based operating system for your PC, Laptop or Server. nThe openSUSE project is a worldwide effort that promotes the use of Linux everywhere. n<br />n<br />nopenSUSE creates one of the world's best Linux distributions, working together in an open, transparent and friendly manner as part of the worldwide Free and Open Source Software community.n<br />n<br />nThe project is controlled by its community and relies on the contributions of individuals, working as testers, writers, translators, usability experts, artists and ambassadors or developers.",
            "permanent": 1
        },
        "debian": {
            "distro": "debian",
            "name": "Debian",
            "desc": "Debian is a free operating system (OS) for your computer. An operating system is the set of basic programs and utilities that make your computer run. rn<br />rn<br />rnDebian uses the Linux kernel (the core of an operating system), but most of the basic OS tools come from the GNU project; hence the name GNU/Linux.rn<br />rn<br />rnDebian GNU/Linux provides more than a pure OS: it comes with over 25000 packages, precompiled software bundled up in a nice format for easy installation on your machine.",
            "logo": "",
            "screenshot": "",
            "permanent": 1
        },
        "ubuntu": {
            "distro": "ubuntu",
            "name": "Ubuntu",
            "logo": "",
            "screenshot": "",
            "desc": "Ubuntu is part of the Debian family of Linux operating systems, which has the largest pool of developer talent, with every package built by experts. n<br />n<br />Canonical's rigorous release management, quality assurance, stress testing and product design enhances the quality of Ubuntu Server.n<br />n<br />nSuper-fast and great-looking, Ubuntu is a secure, intuitive operating system that powers desktops, servers, netbooks and laptops. Ubuntu is, and always will be, absolutely free.",
            "permanent": 1
        },
        "scientific": {
            "distro": "scientific",
            "name": "Scientific",
            "logo": "",
            "screenshot": "",
            "desc": "Scientific Linux is an Enterprise Linux rebuild sponsored by Fermi National Accelerator Laboratory. n<br />n<br />Scientific Linux has been installed all over the world. At one time or another Scientific Linux has had an install base in experiments on all seven continents. It has even been loaded onto systems at the International Space Station."
        },
        "newditrosss": {
            "distro": "newditrosss",
            "name": "newditrosss",
            "desc": "",
            "logo": "http://serversub.net/img/Windows_logo_-_2012_derivative.svg.png",
            "screenshot": ""
        },
        "test": {
            "distro": "test",
            "name": "Test Distro",
            "desc": "shi <b> abdccsd </b>asasasjljrnaskdaskd;lasdrnadasjdkaljsd",
            "logo": "http://www.littleendian.com/wp-content/uploads/windows_logo_2012_small.png",
            "screenshot": "http://i444.photobucket.com/albums/qq169/temari253/Naruto-1.jpg"
        },
        "test_distro": {
            "distro": "test_distro",
            "name": "test",
            "desc": "This is a test distro",
            "logo": "",
            "screenshot": ""
        },
        "windows": {
            "distro": "windows",
            "name": "Windows",
            "desc": "Test",
            "logo": "http://serversub.net/img/Windows_logo_-_2012_derivative.svg.png",
            "screenshot": ""
        }
    },
    "time_taken": "28.18"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list