LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » LxCenter » Command-line Management » [commandline] New fully scriptable hosting framework
[commandline] New fully scriptable hosting framework [message #27644] Fri, 28 March 2008 01:49 Go to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

Lxadmin has stopped being a mere control panel and now it is a full scriptable, 100% object oriented hosting framework. We have added a concept called as reflection, where you can use a script to get the internals of lxadmin directly. For instance, you need not wait for us to publish API. Instead, you can query lxadmin directly, and it will tell you how to add/update a particular object.

For instance, if you want to know how to add a mailforward to an mmail object, you can do this:

 
  /script/reflect --type=add --parent-class=mmail --parent-name=domain.com --class=mailforward
  


In effect, you are asking lxadmin: "How can I add a mailforward to the mmail-domain.com object". The reply is the list of variables that are needed, in this case, it prints

  nname Mail Account
  forwardaddress Forward To



Using the above information, now you can add a mailforward:

 
  /script/add --parent-class=mmail --parent-name=domain.com --class=mailforward --v-nname=mfname --v-forwardadress="|/script"
  


How to Update an object

The next task is how to update an object. You can use reflection to find out the actual variables involved in executing a particular subaction for the update. For instance, how to update the hot link protection in web.

 
 /script/reflect --type=update --subaction=hotlink_protection --class=web --name=domain.com
 


Output:

 
 hotlink_flag Enable Hotlink Protection
 text_hotlink_allowed Allowed Domains (one Per Line)
 hotlink_redirect Redirect To (img)
  


It actually prints the variable and the description. All flag variables are either 'on' or 'off'. So to turn on hotlink protection on a web object, you do this:

 
  /script/update --class=web --name=domain.com --subaction=hotlink_protection --v-hotlink_flag=on --v-text_hotlink_allowed= --v-hotlink_redirect=/img/image.gif
  


Thanks.

[Updated on: Thu, 03 April 2008 22:00] by Moderator

Report message to a moderator

Re: [commandline] New fully scriptable hosting framework [message #27659 is a reply to message #27644] Fri, 28 March 2008 07:28 Go to previous messageGo to next message
Alcedema is currently offline Alcedema  United Kingdom
Messages: 79
Registered: March 2008
Valuable Member
Thanks for updating reflect! I'll give this a try now.
Re: [commandline] New fully scriptable hosting framework [message #27755 is a reply to message #27659] Fri, 28 March 2008 17:49 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
It would be even greater if you add a --help parameter to /script/reflect which will output a help about the possible parameters to the command (like --type, --class, etc.) along with their descriptions.

You could do this for the other commands (add, update) too. Thank you.


Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #27818 is a reply to message #27755] Sat, 29 March 2008 06:51 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
It would be even greater if you add a --help parameter to /script/reflect which will output a help about the possible parameters to the command (like --type, --class, etc.) along with their descriptions.

You could do this for the other commands (add, update) too. Thank you.


Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #28779 is a reply to message #27818] Fri, 04 April 2008 09:47 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
It would be even greater if you add a --help parameter to /script/reflect which will output a help about the possible parameters to the command (like --type, --class, etc.) along with their descriptions.

You could do this for the other commands (add, update) too. Thank you.


Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #28908 is a reply to message #28779] Sun, 06 April 2008 04:39 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
LxHelp, please answer, I bump this topic 4 times already. Thank you.

Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #28977 is a reply to message #28908] Mon, 07 April 2008 03:18 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
..... 5 times Mad

Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #43026 is a reply to message #28977] Sun, 26 October 2008 03:49 Go to previous messageGo to next message
adminmaster is currently offline adminmaster  India
Messages: 102
Registered: July 2005
Valuable Member
Administrator


The reflect command now has a built-in help. Actually, now that i use it routinely, i realized that an in-built help is absolutely essential. And it is now 100% complete too.

You can even use to to add an installapp to a domain.

Re: New fully scriptable hosting framework [message #43027 is a reply to message #43026] Sun, 26 October 2008 03:53 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
How to add wordpress to a domain:

 
 /script/reflect --type=add --parent-class=web --parent-name=domain.com --class=installsoft --v-val=wordpress
 



On Sun, Oct 26, 2008 at 07:49:16AM -0000, Administrator wrote:
>
>
>


Re: [commandline] New fully scriptable hosting framework [message #43028 is a reply to message #43026] Sun, 26 October 2008 04:16 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
adminmaster wrote on Sun, 26 October 2008 09:49



The reflect command now has a built-in help. Actually, now that i use it routinely, i realized that an in-built help is absolutely essential. And it is now 100% complete too.

You can even use to to add an installapp to a domain.



Great news! And how do we invoke this help? With --help it doesn't work. Please specify. Thank you.


Dragomir Denev
DGM
www.dgm.bg
Re: New fully scriptable hosting framework [message #43029 is a reply to message #43028] Sun, 26 October 2008 04:25 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Just run:

 /script/reflect
 



On Sun, Oct 26, 2008 at 08:16:39AM -0000, Dragomir Denev wrote:
>
>
> adminmaster wrote on Sun, 26 October 2008 09:49
> > The reflect command now has a built-in help. Actually, now that i use it routinely, i realized that an in-built help is absolutely essential. And it is now 100% complete too.


Re: New fully scriptable hosting framework [message #43030 is a reply to message #43028] Sun, 26 October 2008 04:28 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Update to the latest version, and --help will also work.

 
 /script/reflect --help
 


How to add a customer to admin

 
  /script/reflect --type=add --parent-class=client --parent-name=admin --class=client --v-val=customer
  


If you have lxadmin Enterprise, it will automatically show server parameters too.

How to add a reseller:

 
  /script/reflect --type=add --parent-class=client --parent-name=admin --class=client --v-val=reseller
  




On Sun, Oct 26, 2008 at 08:16:39AM -0000, Dragomir Denev wrote:
>
>


Re: [commandline] New fully scriptable hosting framework [message #43031 is a reply to message #43026] Sun, 26 October 2008 04:39 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
adminmaster wrote on Sun, 26 October 2008 09:49


The reflect command now has a built-in help. Actually, now that i use it routinely, i realized that an in-built help is absolutely essential. And it is now 100% complete too.


Haha! Is this what you call essential help:
# /script/reflect --help
Usage: reflect --type=add --parent-class= --parent-name= --class= [--v-var= --v-val=]
Usage: reflect --type=update --subaction= --class= --name=

Yes, I couldn't live without those 2 lines also.

Come on, LxHelp, you know what help I am talking about. Type "whatever command --help" in your linux box and you'll see what I mean.

have you at least read my first request about this:
Quote:

It would be even greater if you add a --help parameter to /script/reflect which will output a help about the possible parameters to the command (like --type, --class, etc.) along with their descriptions.

You could do this for the other commands (add, update) too. Thank you.


Please, try to make this really usefull. Thank you.

PS:Sorry for being such a pain in the ass but I hope you understand we're both trying to make the product better Wink


Dragomir Denev
DGM
www.dgm.bg
Re: New fully scriptable hosting framework [message #43032 is a reply to message #43031] Sun, 26 October 2008 04:46 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

Quote:


>
>
> Please, try to make this really usefull. Thank you.
>
> PS:Sorry for being such a pain in the ass but I hope you understand we're both trying to make the product better ;)



I have added some examples there too. You can update to the latest version and see.

The basic concept in lxadmin is always the same.

You always add an object to another object. The object you are adding to is called the parent, which is accessed via parent-class and parent-name.

I will publish the exact tree structure of lxadmin objects, which will give a clear idea of how to add anything to anywhere.




Re: New fully scriptable hosting framework [message #43034 is a reply to message #43032] Sun, 26 October 2008 04:58 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
My Idea is that you make all the needed information under our fingertips. It always better to just type "/script/reflect --help" and get all the needed help than to collect the pieces from the scattered posts on the forum.

Suggestions:

1. Add description for all possible --type parameters
2. Add a list of all possible parent classes and their descriptions
3. Add a list of all possible classes and their descriptions
4. Add a list of all possible subactions and their descriptions
5. For every class add the list of --v-var parameters

Make it a complete commandline help system where everything is in one place. The way it is now it is VERY difficult to find the needed info even for guys like me (and I'm pretty well into programming and stuff).

Thank you again


Dragomir Denev
DGM
www.dgm.bg
Re: New fully scriptable hosting framework [message #43055 is a reply to message #43034] Sun, 26 October 2008 06:50 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Yes, I have to explain the class hierarchy there. The only variables you need to provide parent-class, parent-name, class and --v-var and --v-val.


On Sun, Oct 26, 2008 at 08:58:16AM -0000, Dragomir Denev wrote:
>
>
> My Idea is that you make all the needed information under our fingertips. It always better to just type "/script/reflect --help" and get all the needed help than to collect the pieces from the scattered posts on the forum.
>


Re: New fully scriptable hosting framework [message #43062 is a reply to message #43055] Sun, 26 October 2008 08:15 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
OK, thanks for understanding. We'll wait for this Smile

Dragomir Denev
DGM
www.dgm.bg
Re: New fully scriptable hosting framework [message #48145 is a reply to message #43062] Sat, 29 November 2008 14:58 Go to previous messageGo to next message
drank is currently offline drank  Bulgaria
Messages: 1324
Registered: June 2007
Senior Master
One month later - how is this feature going?

Dragomir Denev
DGM
www.dgm.bg
Re: [commandline] New fully scriptable hosting framework [message #53767 is a reply to message #27644] Fri, 16 January 2009 10:14 Go to previous messageGo to next message
denver is currently offline denver  Romania
Messages: 8
Registered: January 2009
Location: Timisoara, Romania
Member
examples are nice and all, but if you're going to only give examples instead of a comprehensive help message, make sure you give examples with all possible command line options.

In my opinion, a well laid out help message with 2-3 examples and a short description of each option is a greater help then 10-20 examples with no index of all command line options.

Also a short explanation of the basic concept will also help. It has already been explained time and again on this forum, but one should not have to browse countless topics just to get an understanding of how it works.

In hierarchical designs it also helps to have a grasp on the tree design...which comes first, which comes second, why, etc.

This is the biggest headache at the moment. Everything else about this product is pretty awesome.
Re: [commandline] New fully scriptable hosting framework [message #74042 is a reply to message #27644] Sun, 18 April 2010 15:41 Go to previous messageGo to next message
xokaido is currently offline xokaido  Georgia
Messages: 3
Registered: April 2010
Member
The main reason why this project ain't so popular is the documentation....
The project is really awesome, we just need little bit more investment to provide useful reference of all the features with their descriptions and options...
Documenting the software will involve others to join and help develop the project... I don't mean the project needs help in coding the software but the more people we've got, the more we are able to do... I'm in the hosting business about 5 years, have tried almost every hosting control panel (including free and non-free)... I can say this project is truly amazing... but the reason why others are "better" is the ability to quickly navigate through documentation what and how the feature does.
Re: [commandline] New fully scriptable hosting framework [message #74050 is a reply to message #27644] Sun, 18 April 2010 16:37 Go to previous messageGo to next message
Peter is currently offline Peter  Denmark
Messages: 149
Registered: August 2007
Valuable Member
LxCenter Advisor
This is a really old thread you are starting again. Non the less, your point is valid.

Documentation was lacking in LxLabs days, and still is. But now we are more people and a focus on documentation is present. It's a work in progress. The LxCenter team is still pretty new.
Re: [commandline] New fully scriptable hosting framework [message #74082 is a reply to message #27644] Mon, 19 April 2010 12:04 Go to previous message
xokaido is currently offline xokaido  Georgia
Messages: 3
Registered: April 2010
Member
I'm really happy and wish you all the best... Wink
And thank you for giving us such a great project... Smile
Previous Topic:How to change an domain/sub domain owner
Next Topic:API - Solutions
Goto Forum:
  


Current Time: Tue May 21 03:07:20 EDT 2013

Total time taken to generate the page: 0.01422 seconds
.:: Contact :: Home :: Privacy ::.

Click here to lend your support to: LxCenter and make a donation at www.pledgie.com !

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software