Jump to content

Question

Posted

I don't know if I'm missing something here.

 

But I can't change the package on an active service. I tried as admin (changing the package/term under upgrade/downgrade) and I tried from the client area.

 

Never calls the SolusVM module. Nothing in the logs about telling Solus to change packages.

 

Doesn't appear to be any documentation on this either.

 

Also, if i try to price override with a price of $0, it removes the price override entirely.

 

5 answers to this question

Recommended Posts

  • 0
Posted

Happy to take a look at the code if you want to post it, PM it, or email it.

 

The SolusVM module is getting a lot of upgrades for 3.5, including configurable options and ability to order multiple IPs and remove specific IPs. Not sure about package change, Tyson wrote the SolusVM module and sort of maintains it.

  • 0
Posted

Happy to take a look at the code if you want to post it, PM it, or email it.

 

The SolusVM module is getting a lot of upgrades for 3.5, including configurable options and ability to order multiple IPs and remove specific IPs. Not sure about package change, Tyson wrote the SolusVM module and sort of maintains it.

 

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;
	}

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...