Edit Media Group

Use the Edit Media Group API to update a particular media groups present on the Virtualizor panel. Media groups allow the admin to manage the ISOs / OS templates which are used for creating Virtual Private Servers. You can group multiple ISOs in a single media group and assign that media group to particular enduser, ensuring that the enduser has access to only those ISOs for creating Virtual Private Servers. The API response will contain “done” as “true” on successful update of the media group.

HTTP Request

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

Parameters

NameMethodValueDescriptionParameters
actGETeditmgThe action specified to perform the operation and will “done” as “true” after the mediagroup is successfully updatedYes
mgidPOSTIntID of the mediagroupYes
mg_descPOSTtextThe description of the media groupYes
mg_namePOSTtextThe name given to the mediagroupYes

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['mgid'] = 22;
    $post['mg_name'] = 'test-api-mg';
    $post['mg_desc'] = 'The edit is working';

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

    print_r(json_encode($output));
?>

Output

{
    "title": "Edit Media Group",
    "done": true,
    "timenow": 1536088838,
    "time_taken": "0.218"
}
Was this helpful to you?