Jump to content
  • 0

Changing The Package On A Service


Squidix Web Hosting

Question

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.

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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;
	}
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...