Comments (8)
After long years one developer helped me with this. It required very tiny edit. It possibly could have been made on the server, but the programmer suggested edit in the WHMCS 6 HyperVM module.
Find: $result->result;
Replace by: $list = $result->result;...
:)
from hypervm.
The HyperVM development is already inactive.
But try this:
$params=array();
$params["serverusername"].$params["serverpassword"]."8888"."action=simplelist&resource=resourceplan");
Original:
$params["serverusername"], $params["serverpassword"], "8888", "action=simplelist&resource=resourceplan" );
It will surely work 😄
Tested on Ubuntu 16 x64 server with 8GB of RAM, 250HDD disk space, Intel Dedicated Server.
Hosted by: ProTLD.Host
from hypervm.
Thx, but this NOT worked. When i replace
function hypervm_ChangePackage($params) {
$result = lxlabs_get_via_json( $params["serversecure"], $params["serverip"], $params["serverusername"], $params["serverpassword"], "8888", "action=simplelist&resource=resourceplan" );
by
function hypervm_ChangePackage($params) {
$params=array();
$result = lxlabs_get_via_json( $params["serversecure"].$params["serverip"].$params["serverusername"].$params["serverpassword"]."8888"."action=simplelist&resource=resourceplan");
(as you suggested, im doing my best)
the log file shows following commands was executed:
http://:8888/webcommand.php?login-class=client&login-name=&login-password=&output-type=json&class=vps&name=.vm&action=update&subaction=change_plan&v-newresourceplan=
https://:8887/webcommand.php?login-class=client&login-name=&login-password=&output-type=json&
(no server IP, no credentials)
result:
Curl Error: 6 - Couldn't resolve host ''
And when i remove
$params=array();
then HyperVM API returns:
error_cannot_find_the_resource_plan
The HyperVM logfile (/usr/local/lxlabs/hypervm/log/web_command):
12:46 Jun/03/2016: array (
'login-class' => 'client',
'login-name' => 'admin',
'login-password' => '',
'output-type' => 'json',
'action' => 'simplelist',
'resource' => 'resourceplan',
)
12:46 Jun/03/2016: __success_simplelist
12:46 Jun/03/2016: array (
'login-class' => 'client',
'login-name' => 'admin',
'login-password' => '',
'output-type' => 'json',
'class' => 'vps',
'name' => 'aqjrzaab.vm',
'action' => 'update',
'subaction' => 'change_plan',
'resourceplan' => '',
)
12:46 Jun/03/2016: __error_cannot_find_the_resource_plan
That simplelist response is (can see in my logfile):
{"message":"success","result":{"1024mb___client-":"1024mb","128mb___client-":"128mb","2048mb___client-":"2048mb","256mb___client-":"256mb","4096mb___client-":"4096mb","512mb___client-":"512mb","768mb___client-*":"768mb"},"return":"success"}
i also checked billing system database and the "configoption2" (the resource plan name), is set to "768mb" (without quotation marks)
I also came to the point to send request:
http://myservipishere:8888/webcommand.php?login-class=client&login-name=_&login-password=_&output-type=json&class=vps&name=aqjrzaab.vm&action=update&subaction=change_plan&v-newresourceplan=768mb&newresourceplan=768mb&resourceplan=768mb&v-plan_name=768mb
but same resource plan error in hypervm log.
so im unsure what is proper API URL to use to change plan?
Please what is wrong in my code so it returns "cannot_find_the_resource_plan"?
Thank You
from hypervm.
I haven't a lot of experiences on HyperVM because it has got dead development, but let me try to fix it for you. 😄
from hypervm.
Please switch to https://github.com/hypervm-ng/hypervm-ng It's a bit updated and fully working. Development is not dead (I am now on Virtuozzo7 support module). Fell free to commit bugs there and raise future enhancements
from hypervm.
Hi, everything except the resource plan change works in my HyperVM WHMCS PHP module.
The request to list resource plans is:
https://serverIPhere:8887/webcommand.php?login-class=client&login-name=*****&login-password=**********&output-type=json&action=simplelist&resource=resourceplan
response is:
{"message":"success","result":{"1024mb___client-*****":"1024mb","128mb___client-*****":"128mb","2048mb___client-*****":"2048mb","256mb___client-*****":"256mb","512mb___client-*****":"512mb","768mb___client-*****":"768mb"},"return":"success"}
then it apparently fails to provide resource plan name in next request:
https://serverIPhere:8887/webcommand.php?login-class=client&login-name=*****&login-password=**********&output-type=json&class=vps&name=phzedeca.vm&action=update&subaction=change_plan&v-newresourceplan=
response is:
{"message":"__error_cannot_find_the_resource_plan","return":"error"}
.php line behind the request:
$result = $list = lxlabs_get_via_json( $params["serversecure"], $params["serverip"], $params["serverusername"], $params["serverpassword"], "8888", "class=vps&name=" . $params["username"] . ".vm&action=update&subaction=change_plan&v-newresourceplan=" . $plansarray[strtolower( $params["configoption2"] )] . "" );
configoption2 should be one of following:
256mb
512mb
...
whole php function behind the request:
function hypervm_ChangePackage($params) {
$result = lxlabs_get_via_json( $params["serversecure"], $params["serverip"], $params["serverusername"], $params["serverpassword"], "8888", "action=simplelist&resource=resourceplan" );
$result->result;
if ($list) {
foreach ($list as $key => $value) {
$plansarray[strtolower( $value )] = $key;
}
}
$result = $list = lxlabs_get_via_json( $params["serversecure"], $params["serverip"], $params["serverusername"], $params["serverpassword"], "8888", "class=vps&name=" . $params["username"] . ".vm&action=update&subaction=change_plan&v-newresourceplan=" . $plansarray[strtolower( $params["configoption2"] )] . "" );
if (lxlabs_if_error( $result )) {
return $result->message;
}
return "success";
}
Please do you see any way to fix this so the resource plan name in supplied in the request?
from hypervm.
After long years one developer helped me with this. It required very tiny edit. It possibly could have been made on the server, but the programmer suggested edit in the WHMCS 6 HyperVM module.
Find: $result->result;
Replace by: $list = $result->result;
...
from hypervm.
please help me out, i am currently making OpenVZ 7 working with HyperVM https://github.com/taidos/hypervm-taidos please help out on this one
from hypervm.
Related Issues (9)
- After delete a slave server, cant delete VM's still showed in VM list HOT 3
- Full RHEL6 / CentOS6 support HOT 5
- Add new database flag
- Cemtos 6.5 minimal and beta version
- Does hypervm has more features and functionalities compare to solusvm? HOT 3
- Lxcenter.org not available HOT 5
- vswap on CentOS 6, how to skip privvmpages being added?
- What URL should i use instead of download.lxcenter.org/download/ ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hypervm.