LxCenter HyperVM & Kloxo Support

Forum



Members   Search      Help    Register    Login    Home
Home » Kloxo Community Support » Knowledge Base » The lxadmin API
The lxadmin API [message #8829] Thu, 19 July 2007 20:28 Go to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

First, you will need to provide the login credentials, in the forum of login-class, login-name, and login-password. The login-class is always 'client'.

The actions supported are: add, delete, update, simplelist

To add a client:

First you will need to get the resourceplan and dnstemplate list from lxadmin using simplelist.

 
 bin/webcommand.php?action=simplelist&resource=resourceplan
 


This will return an associative array with keys as the actual names and the values as display names.

 
 [newone___client_s_vv_p_admin]=newone&[hostingplan___client_s_vv_p_admin]=hostingplan
 



 
 bin/webcommand.php?action=simplelist&resource=dnstemplate
 


Result:
 
 [neon]=neon&[goodone]=goodone&[monohart]=monohart&[newstuff]=newstuff
 


Now, you can create a client and the default domain.

 
 bin/webcommand.php?action=add&class=client&name=newname&v-type=reseller&v-password=hello&v-plan_name=newone___client_s_vv_p_admin&v-domain_name=hello.com&v-dnstemplate_name=goodone'


You need to supply:

class, name, v-type, v-password, v-plan_name, v-domain_name, v-dnstemplate_name

Thanks.


Re: The lxadmin API: Update a client. [message #8835 is a reply to message #8829] Thu, 19 July 2007 23:11 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

Upgrading/Downgrading a client: Change Plan.
First get the list of resource plans.

 
  bin/webcommand.php?action=simplelist&resource=resourceplan
  


Change the client's plan to the new resource plan.

 
/bin/webcommand.php?class=client&name=showing&action=update&subaction=change_plan&v-resourceplan_name=newplan___client_s_vv_p_admin'



Disable/Enable a client.

You need to provide class, name, action, subaction

 
  bin/webcommand.php?class=client&name=showing&action=update&subaction=disable
  bin/webcommand.php?class=client&name=showing&action=update&subaction=enable
  


Thanks.


Re: The lxadmin API: Update a client. [message #14706 is a reply to message #8835] Tue, 02 October 2007 20:12 Go to previous messageGo to next message
pageranklady is currently offline pageranklady  United States
Messages: 4
Registered: October 2007
Member
Has the API changed ?
I referred to the Wiki and the examples here.

All the above examples give.
__error_need_action_class_and_name


Re: The lxadmin API: Update a client. [message #14709 is a reply to message #14706] Tue, 02 October 2007 20:40 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Definitely not. Mostly you have some spelling mistake. The action, class or name is missing.

Thanks.

icon14.gif  Re: The lxadmin API: Update a client. [message #18563 is a reply to message #14709] Tue, 08 January 2008 05:16 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
How about API for requesting the installed APPS in a given domain?

And API for all the existing mail users and its current usage?

regards,

--reynan

Re: The lxadmin API: Update a client. [message #19288 is a reply to message #18563] Mon, 21 January 2008 00:07 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
Quote:


>
>
> How about API for requesting the installed APPS in a given domain?
>
> And API for all the existing mail users and its current usage?
>
> regards,



Installed Apps is not availab.e You can get the mailusers by specifying these variables:

 

 action=simplelist
 parent-class=domain
 parent-name=domain.com
 class=mailaccount
 


Thanks.


Re: The lxadmin API [message #19299 is a reply to message #8829] Mon, 21 January 2008 01:21 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Quote:

Installed Apps is not availab.e You can get the mailusers by specifying these variables:



action=simplelist
parent-class=domain
parent-name=domain.com
class=mailaccount



Thanks for the update.

one last thing.. and i think one of the important things.

An API for the current resourceplan of a certain client/domain that they have been using.

And an API to change their current resourceplan.. (this will be used for upgrade and downgrade of client/domain) in terms of their bandwidth and total disk usage.
Re: The lxadmin API [message #19300 is a reply to message #19299] Mon, 21 January 2008 01:25 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion

You can use the getproperty action.

 
action=getproperty
class=class
name=name
v-resourceplan_used=


To change,

 
action=update
subaction=change_plan
v-resoureceplan_name=


Thanks.


On Mon, Jan 21, 2008 at 06:21:31AM -0000, Reynante wrote:
>
>
Re: The lxadmin API [message #19339 is a reply to message #8829] Mon, 21 January 2008 05:26 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Quote:

action=update
subaction=change_plan
v-resoureceplan_name=



Can you please check on this API. This doesn't work for me.


here is the code:

$json = lxlabs_get_via_json("http", $server, "7778", "action=update&class=domain&name=10mb.corp.emc.com.ph&subaction=change_plan&v-resourceplan_name=150mb___client_s_vv_p_customer_test");


and here is the result:

stdClass Object
(
    [message] => __error_need_v-resourceplan_name
    [return] => error
)


eventhough there is a resourceplan in the request.. still asking for a name v-resourceplan_name.

thanks

regards,

--reynan
Re: The lxadmin API [message #19342 is a reply to message #8829] Mon, 21 January 2008 05:47 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Quote:

and here is the result:

stdClass Object
(
[message] => __error_need_v-resourceplan_name
[return] => error
)



on second thought (via API), I used the login of the admin account and update the plan of one customer.. it works. It upgrade the plan to higher plan.

Is the change_plan only used for customer and not for the domain under the customer.? hmnn.. sound strange.

Here is the issue.. I want to upgrade (change plan) the domain under the customer, I used the customer name & password for login and the subaction upgrade_plan for a domain (e.g. example.com.ph).
After the execution.. the above error appear.


The second one.. I want to upgrade the customer plan under the admin account. I used the admin name and password for login via API and subaction upgrade_plan for a customer.
after the execution.. it works. here is the result.


stdClass Object
(
    [message] => __success_update_successful_on_client_customer_test
    [return] => success
)


Are there any permission that need to be done on the part of the customer(client) in able for him to upgrade the plan of the domain under him.?

regards,

--reynan
Re: The lxadmin API [message #19344 is a reply to message #19342] Mon, 21 January 2008 05:52 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
It was a bug, and has been fixed in 2222 version. Please update, and you will be able to change the plan for domain too.

Thanks.


On Mon, Jan 21, 2008 at 10:47:24AM -0000, Reynante wrote:
>
>
> Quote:
> > and here is the result:
> >
> > stdClass Object
> > (
> > [message] => __error_need_v-resourceplan_name
> > [return] => error
> > )
>
Re: The lxadmin API [message #19726 is a reply to message #8829] Thu, 24 January 2008 04:47 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
hello, this seems not working.. it always look for the action resource.

Quote:

Installed Apps is not availab.e You can get the mailusers by specifying these variables:



action=simplelist
parent-class=domain
parent-name=domain.com
class=mailaccount



Can you please check on this. I just need an API for:

** list of all the clients/customer under the admin account.
** list of all domains under the client/customer account.
** list of all mailusers under the domain account.

here is the error in API.. i was login as admin account.

stdClass Object
(
    [message] => __error_need_action_resource

    [return] => error
)



Re: The lxadmin API [message #19727 is a reply to message #19726] Thu, 24 January 2008 05:17 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
action=simplelist, the variable is 'resource' , parent-class is mmail. Please note the 2 'm's.

 
parent-class=mmail
parent-name=domain.com
action=simplelist
resource=mailaccount



Thanks.


On Thu, Jan 24, 2008 at 09:47:19AM -0000, Reynante wrote:
>
>
> hello, this seems not working.. it always look for the action resource.
Re: The lxadmin API [message #19728 is a reply to message #8829] Thu, 24 January 2008 05:47 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Quote:


action=simplelist, the variable is 'resource' , parent-class is mmail. Please note the 2 'm's.


parent-class=mmail
parent-name=domain.com
action=simplelist
resource=mailaccount



still not working.. can you please check.


$json =lxlabs_get_via_json("action=simplelist&parent-class=mmail&parent-name=startercustomer.corp.emc.com.ph&resource=mailaccount");


result:

stdClass Object
(
    [message] => __error_no_resource_for_mailaccount
    [return] => error
)


another thing, if i should list the customers under admin.. should the info must this data:

parent-class=client
parent-name=client_name
action=simplelist
resource=customer


am i right?

regards,

--reynan
Re: The lxadmin API [message #19729 is a reply to message #19728] Thu, 24 January 2008 05:49 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
UPdate to the latest version.

Thanks.


On Thu, Jan 24, 2008 at 10:47:18AM -0000, Reynante wrote:
>
>
Re: The lxadmin API [message #23855 is a reply to message #8829] Fri, 29 February 2008 02:44 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Hello,

I just add a slave server to my lxadmin master. Is there any API to move one reseller account to another. e.g from lxadmin master to lxadmin slave, or lxadmin slave to lxadmin slave and vice versa.

regards,

--reynan
Re: The lxadmin API [message #23857 is a reply to message #23855] Fri, 29 February 2008 02:50 Go to previous messageGo to next message
Lxhelp
Messages: 23691
Registered: July 2006
The Champion
No, you have to go to client home -> servers and change the values and update. We will provide an API for that, but at present, lxadmin API is only for single server.

Thanks.


On Fri, Feb 29, 2008 at 07:44:18AM -0000, Reynante wrote:
>
>
> Hello,
Re: The lxadmin API [message #28620 is a reply to message #8829] Thu, 03 April 2008 08:25 Go to previous messageGo to next message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
hello, are there any changes in the API. I used this API before to list all my clients under the admin account.

## for customer account
$json=lxlabs_get_via_json("action=simplelist&parent-class=client&parent-name=admin&resource=client");


with this code, i get a response

stdClass Object
(
    [message] => __error_you_are_not_the_owner_of_parent
    [return] => error
)


is there something wrong with the api?

regards,

--reynan
Re: The lxadmin API [message #30143 is a reply to message #8829] Mon, 28 April 2008 07:19 Go to previous message
reynan is currently offline reynan  Philippines
Messages: 279
Registered: January 2008
Location: Manila, Philippines
Senior Member
Hello,

Is there a way to get the current server of the domain where it has been hosts?

I tried to used the API, but I don't know the correct parameter to get the current server of the domain. If it is hosts in the localhost / slave server, what IP?

$json = lxlabs_get_via_json("http", $server,"7778","action=getproperty&class=client&name=domain.com&v-used-traffic_usage=&v-used-maildisk_usage=&v-used-mysqldb_usage=&v-used-totaldisk_usage=");



with this, i get the result:

stdClass Object
(
    [message] => success
    [result] => stdClass Object
        (
            [v-used-traffic_usage] => -
            [v-used-maildisk_usage] => -
            [v-used-mysqldb_usage] => 0
            [v-used-totaldisk_usage] => 0
        )

    [return] => success
)


Then I tried to add the param:
"v-syncserver" --> but no success.
"v-webserver" --> still no luck
"v-mysqldb_server" --> still no luck.

Any idea? I just want to know via API to what server did the domain hosts.?

regards,

--reynan
Previous Topic:Getting a download file box for php on apache lxadmin
Next Topic:HostInABox uses too much memory.
Goto Forum:
  


Current Time: Tue Jun 18 17:09:48 EDT 2013

Total time taken to generate the page: 0.01359 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