It's dead simple, just a copy of unsuspend/suspend but with a dif api function and the plan as an argument.
public function changeServicePackage($package_from, $package_to, $service, $parent_package=null, $parent_service=null) {
if (($row = $this->getModuleRow())) {
$api = $this->getApi($row->meta->user_id, $row->meta->key, $row->meta->host, $row->meta->port);
$api->loadCommand("solusvm_vserver");
$service_fields = $this->serviceFieldsToObject($service->fields);
// Attempt to change the virtual server plan
try {
// Load up the Virtual Server API
$vserver_api = new SolusvmVserver($api);
$params = array('vserverid' => $service_fields->solusvm_vserver_id, 'plan' => $package_to->meta->plan);
// Change the Virtual Server Plan
$this->log($row->meta->host . "|vserver-change", serialize($params), "input", true);
$response = $this->parseResponse($vserver_api->change($params), $row);
}
catch (Exception $e) {
// Internal Error
$this->Input->setErrors(array('api' => array('internal' => Language::_("Solusvm.!error.api.internal", true))));
return;
}
}
return null;
}