Get Virtualizor

Add Distro

Use the Add Distro API to add distro information on the server. This is the information about the distribution flavor of the OS that will be used for the creation of Virtual Private Servers. By default Virtualizor provides information about eight types of distributions viz. CentOS, Fedora, openSUSE, Debian, Ubuntu, Scientific, Windows and Webuzo. In addition to that you can add information about any new distros using this API. The API response will contain "done" as "1" on successful addition of the distribution information.

HTTP Request

https://hostname:4085/index.php?act=add_distro

Parameters

NameMethodValueDescriptionRequired
actGETadd_distroThe action specified to perform operation and retrieve dataYes
distroPOSTtextName of the distroYes
distro_namePOSTtextActual name of the distroYes
distro_descPOSTtextDescription of the distroNo
distro_logoPOSTtextUrl of Logo of the distroNo
distro_screenshotPOSTtextURL Screenshot of the distroNo

Sample Code

<?php

    require_once('/usr/local/virtualizor/sdk/admin.php');

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

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

    $post = array();
    $post['distro'] = 'test_distro';
    $post['distro_name'] = 'test';
    $post['distro_desc'] = 'This is a test distro';

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

    print_r(json_encode($output));

?>

Output

{
    "title": "Virtualizor",
    "done": 1,
    "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
\n
\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
\n
\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
\n
\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
\n
\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
\n
\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
\n
\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",
            "logo": "",
            "screenshot": "",
            "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. \n
\n
\nDebian 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.\n
\n
\nDebian 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.",
            "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
\n
Canonical's rigorous release management, quality assurance, stress testing and product design enhances the quality of Ubuntu Server.\n
\n
\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
\n
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.",
            "permanent": 1
        },
        "windows": {
            "distro": "windows",
            "name": "Windows",
            "logo": "",
            "screenshot": "",
            "desc": "Microsoft Windows, or simply Windows, is a metafamily of graphical operating systems developed, marketed, and sold by Microsoft. \n
\n
Microsoft, the developer of Windows, has registered several trademarks each of which denote a family of Windows operating systems that target a specific sector of the computing industry.",
            "permanent": 1
        },
        "webuzo": {
            "distro": "webuzo",
            "name": "Webuzo",
            "logo": "",
            "screenshot": "",
            "desc": "Webuzo is a Single User Control panel which helps users deploy Web Apps (WordPress, Joomla, Drupal, etc) or System Apps (Apache, NGINX, PHP, Java, MongoDB, etc) on their Virtual Private Servers or in the Cloud. Webuzo enables you to focus more on using applications rather than maintaining them. Webuzo is also available in the form of Virtual Appliances.",
            "permanent": 1
        },
        "test": {
            "distro": "test",
            "name": "Test name",
            "desc": "",
            "logo": "",
            "screenshot": ""
        },
        "test_distro": {
            "distro": "test_distro",
            "name": "test",
            "desc": "This is a test distro",
            "logo": "",
            "screenshot": ""
        }
    },
    "timenow": 1536090659,
    "time_taken": "0.208"
}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list