• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Command Line Interfase to SB anyone?

J

JRios

Guest
I am not too familiar with SB yet, i am looking for a way to auto create users con SB, perhpas as in PLESK by a command line, or in this case is it as simple as adding the user directable to the database table??? ... any help would be appreciated ! ;)
 
thanks....i e?

Thanks for the response, i can almost figure out what to do, care to give me and example? i mean how do i send that command? thru a web page? do i just put it in a http request? should i run it from the server? :( any help appreciated

BTW, i am using SB for Linux ...
 
SiteBuilder implements SOAP-based API (http://en.wikipedia.org/wiki/SOAP)

Here is the simple code that invokes CreateAccountWithNewPlan to create reseller. Note that in practice one should use a combination of CreatePlan and CreateAccountFull instead of CreateAccountWithNewPlan.

Code:
#!/usr/bin/env perl

use SOAP::Lite +trace => [ qw (all) ];

my $soap = SOAP::Lite
    -> proxy('http://sitebuilder.yourserver/ServiceFacade/AccountWebService.asmx')
    -> ns('http://swsoft.com/SiteBuilder/AccountService/v_3_2');

my @headers = (SOAP::Header->name("CredentialsSoapHeader" =>
                \SOAP::Data->value(
					SOAP::Header->name("Login" => "admin"),
					SOAP::Header->name("Password" => "admin")
                )
));
$headers[0]->uri("http://swsoft.com/SiteBuilder/AccountService/v_3_2");

my @data = (
        SOAP::Data->name("username", "test"),
        SOAP::Data->name("password", "test"),
        SOAP::Data->name("firstName", "john"),
        SOAP::Data->name("lastName", "doe"),
        SOAP::Data->name("email", '[email protected]'),
        SOAP::Data->name("role", "Reseller"),
);

$soap->CreateAccountWithNewPlan(@data, @headers);

You'll need sitebuilder-remote_admin package installed as well as perl with SOAP::Lite to run this code.
 
Back
Top