Delete Distro

Use the Delete Distro API to delete the distro information from the server. By default Virtualizor provides information about eight types of distributions viz. CentOS, Fedora, openSUSE, Debian, Ubuntu, Scientific, Windows and Webuzo which cannot be deleted. Only the distro information added by the user can be deleted. The API response will contain “done” as “1” on successful removal of the distribution information.

HTTP Request

https://hostname:4085/index.php?act=list_distros&delete=DISTRO

Parameters

NameMethodValueDescriptionRequired
actGETlist_distrosThe action will return done as 1 after deletingYes
deleteGETtextThe name distro that needs to be deletedYes

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['delete'] = 'test_distro';

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

    print_r(json_encode($output));

?>

Output

{
    "title": "List Distros",
    "done": 1,
    "oses": null,
    "oslist": null,
    "ostemplates": null,
    "mgs": null,
    "timenow": 1536091730,
    "time_taken": "0.283"
}
Was this helpful to you?