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
Name | Method | Value | Description | Parameters |
---|---|---|---|---|
act | GET | editmg | The action specified to perform the operation and will "done" as "true" after the mediagroup is successfully updated | Yes |
mgid | POST | Int | ID of the mediagroup | Yes |
mg_desc | POST | text | The description of the media group | Yes |
mg_name | POST | text | The name given to the mediagroup | Yes |
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"
}