timnboys Posted September 14, 2015 Report Posted September 14, 2015 Does blesta have a opennebula billing module or could one be made? as I need one to hopefully use opennebula free panel instead of the paid panel I am currently using. To update everyone that is looking at this thread I made my own module for opennebula you can read about it on the cubedata website: https://cubedata.net/opennebula Quote
Michael Posted September 14, 2015 Report Posted September 14, 2015 Nope, and yes anything can be made, the question is by who? If you wan't Blesta to add it to their to-do list open a feature request. Or you could hire a developer. Quote
ariq01 Posted September 14, 2015 Report Posted September 14, 2015 prefer vestacp for blesta. But until now vestacp stilln't develop blesta module Quote
timnboys Posted September 14, 2015 Author Report Posted September 14, 2015 prefer vestacp for blesta. But until now vestacp stilln't develop blesta module really because I am talking about vps provisoning and billing not a vps instead also does anyone have a sample provisioning module sdk like whmcs does for blesta? that I can build ontop of to make a opennebula module? Quote
Paul Posted September 14, 2015 Report Posted September 14, 2015 really because I am talking about vps provisoning and billing not a vps instead also does anyone have a sample provisioning module sdk like whmcs does for blesta? that I can build ontop of to make a opennebula module? The module docs are here - https://docs.blesta.com/display/dev/Modules And, all modules that ship with Blesta are open, so they serve as good examples. I'd look at one that's most similar to what you're trying to accomplish. Michael and timnboys 2 Quote
timnboys Posted September 14, 2015 Author Report Posted September 14, 2015 The module docs are here - https://docs.blesta.com/display/dev/Modules And, all modules that ship with Blesta are open, so they serve as good examples. I'd look at one that's most similar to what you're trying to accomplish. thanks paul for helping me out to get started on it. please do find a module I can use for a example to build off of. Quote
Michael Posted September 14, 2015 Report Posted September 14, 2015 thanks paul for helping me out to get started on it. please do find a module I can use for a example to build off of. Pick one you know coding they are all open as Paul said he didn't say he'd find one. Quote
timnboys Posted September 14, 2015 Author Report Posted September 14, 2015 Pick one you know coding they are all open as Paul said he didn't say he'd find one. Okay I will use the virtualizor module as example and built off of it thanks Michael dance for suggesting that to me Michael 1 Quote
activa Posted September 14, 2015 Report Posted September 14, 2015 opennebula hasn't a ready to use php class , you need to wite your own . if you have the skils is not so complicated as all the >CLI command are well documented in thier wiki . Michael 1 Quote
timnboys Posted January 4, 2016 Author Report Posted January 4, 2016 Okay I have made good progress on this and implemented the xmlrpc methods using a php library to handle it all is good except blesta refuses to show my module on my dev blesta. Michael 1 Quote
Paul Posted January 4, 2016 Report Posted January 4, 2016 Okay I have made good progress on this and implemented the xmlrpc methods using a php library to handle it all is good except blesta refuses to show my module on my dev blesta. If your module doesn't appear under Settings > Company > Modules > Available, it's probably missing something. If you'd like us to take a look, you can open a ticket and include the module. Michael 1 Quote
Tyson Posted January 5, 2016 Report Posted January 5, 2016 The most common reason for a module to not appear is if it does not follow the file structure pattern, particularly the file name of the module's directory and the main module file (they should match). The second reason is if the file name does not correspond directly to the class name in camel-case. Michael 1 Quote
timnboys Posted January 5, 2016 Author Report Posted January 5, 2016 The most common reason for a module to not appear is if it does not follow the file structure pattern, particularly the file name of the module's directory and the main module file (they should match). The second reason is if the file name does not correspond directly to the class name in camel-case. It appears it was due to my php syntax error. but I have got another problem now when I try to provision a service it doesn't even look like in opennebula anything was provisioned Also it just says service has been added and appears active but there isn't nothing in opennebula to show for it and also I don't know if it is another php syntax error on my part but when I try to select a server in the package details it doesn't even list the server I have added(it just gives a blank dropdown box) is there anyway to log the communication between the module & opennebula to see if maybe the data isn't being passed right or if opennebula doesn't see a parameter right or something? Quote
activa Posted January 6, 2016 Report Posted January 6, 2016 have you included tha api call inthe addservice function ? you should check module logs if any errors . what i can really suggest is to make a plain php file to create the service in openeboula, if it work it would easy to include it in blesta . Quote
timnboys Posted January 6, 2016 Author Report Posted January 6, 2016 have you included tha api call inthe addservice function ? you should check module logs if any errors . what i can really suggest is to make a plain php file to create the service in openeboula, if it work it would easy to include it in blesta . well the api call is all in one file(the main file) as it goes down to a function below the addservice function to call the xmlrpc server of opennebula and provision the vm with the provided information passed to the function(to the api call function) but it doesn't seem like it does anything as I looked on opennebula after running the addservice but there isn't nothing there. also the module logs are empty. Quote
Tyson Posted January 6, 2016 Report Posted January 6, 2016 If this is your custom module, you would add logging yourself in that module, otherwise nothing will appear in the module log. The docs show an example that includes logging, but you can look at other modules in Blesta for working examples too. Quote
activa Posted January 6, 2016 Report Posted January 6, 2016 well the api call is all in one file(the main file) as it goes down to a function below the addservice function to call the xmlrpc server of opennebula and provision the vm with the provided information passed to the function(to the api call function) but it doesn't seem like it does anything as I looked on opennebula after running the addservice but there isn't nothing there. also the module logs are empty. as i suggest again, try to use a standalone file without blesta , to test that the api + your function work . Quote
timnboys Posted January 8, 2016 Author Report Posted January 8, 2016 Okay I have gotten it working somewhat but is there a way to hook into blesta's addservice method right after the service is created to do "post creation" actions like chown the vm inside opennebula to the user id and then setting the user quota? all I am basically looking for is to be able to tie into the creation of service process right after the service is created and the service info is saved. Quote
Tyson Posted January 9, 2016 Report Posted January 9, 2016 Why do you need to wait for Blesta to save the service info before you perform additional actions on the VM? You should perform all the actions you need to perform in addService before returning the service fields. Quote
timnboys Posted January 9, 2016 Author Report Posted January 9, 2016 Why do you need to wait for Blesta to save the service info before you perform additional actions on the VM? You should perform all the actions you need to perform in addService before returning the service fields. I have figured it out I was trying to use a separate function to handle chowning the permission on opennebula to the user and not oneadmin which is what the module uses to communicate with opennebula's xmlrpc api and I only wanted to wait until blesta saved the service info so i could get the vpsid and userid from the set of serviceinfo but figured out how to use the variables inside the addservice function to pass the vpsid and userid info to the separate function so that is working now and yes I pass the vpsid and userid variables inside the addservice function when there created to the separate function that now does the additional required actions and then returns the execution back to the addservice function where it saves the service info finally after doing all of that. I figured it out right after making the original post on this on how to use the variables that store the vpsid and userid in addservice when there created by the xmlrpc api to pass to the separate actions function so sorry for not updating as the flow is now addservice creates the vm and user and then passes the execution to the other function with the vpsid and userid variables and then once the other function is done it returns execution back to the addservice function which then saves the service info after completing all the actions needed. so it now works like this addservice()->otherfunction()->addservice() so when addservice creates and fills the vpsid and userid variables it then passes execution to otherfunction() which then uses those passed variables to finish up with the vm's and once it is done it passes execution back to addservice() where it saves the service info and is done basically. Quote
timnboys Posted January 9, 2016 Author Report Posted January 9, 2016 Okay now I have another issue the package fields don't want to show up now. could one of the blesta dev's or someone point me in the right direction of what I have done wrong in my code of my custom module to cause it and how to fix it? Quote
Blesta Addons Posted January 9, 2016 Report Posted January 9, 2016 Okay now I have another issue the package fields don't want to show up now. could one of the blesta dev's or someone point me in the right direction of what I have done wrong in my code of my custom module to cause it and how to fix it? you need to work with firebug of Mozilla to check the console result . Quote
timnboys Posted January 9, 2016 Author Report Posted January 9, 2016 you need to work with firebug of Mozilla to check the console result . okay I have narrowed it down to the getmodulerowkey method and I have tried all of the variables in my module and still cannot get it to work and don't remember what I did last time to get it to work. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us" dir="ltr"> <head> <title>Blesta</title> <link rel="stylesheet" type="text/css" href="/app/views/errors/css/styles.css" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> </head> <body> <div class="program_error"> <h3>Oh noes!</h3> <div class="contents"> <p>Undefined property: stdClass::$opennebula.module_row on line <strong>148</strong> in <strong>/var/www/html/app/controllers/admin_packages.php</strong></p> </div> </div> </body> </html> please help me as this is one of those I am stuck times and I don't know what I did to cause this. Quote
Blesta Addons Posted January 10, 2016 Report Posted January 10, 2016 okay I have narrowed it down to the getmodulerowkey method and I have tried all of the variables in my module and still cannot get it to work and don't remember what I did last time to get it to work. please help me as this is one of those I am stuck times and I don't know what I did to cause this. Have defined the module_row in the json config file if you use it . Can you post the function you have error in it ? Quote
timnboys Posted January 10, 2016 Author Report Posted January 10, 2016 Have defined the module_row in the json config file if you use it . Can you post the function you have error in it ? No I don't use the json config file I put it in the module class itself. here is the function: /** * Returns the key used to identify the primary field from the set of module row meta fields. * This value can be any of the module row meta fields. * * @return string The key used to identify the primary field from the set of module row meta fields */ public function moduleRowMetaKey() { return "server_key"; } I don't know if it has existed before in my dev blesta db(and I have changed alot since then) so what do you think it is? as I cannot pin it down to any function besides the one above when trying to edit/add a package with the module. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.