Change IP via API?

flamewalker

Verified User
Joined
Aug 21, 2007
Messages
64
Hey guys,

I have tried searching, and looking through the API's to no avail.

What I am looking for is to be able to modify the IP of an account. For instance, when they get an SSL certificate, they need their own IP. I am trying to be able to modify it via API.

I have successfully been able to code for changing the email, package, and password, and just need to be able to edit/change the IP.

TIA.
Jamey
 
I looked but wasnt able to find it anywhere. It might need to be a feature request unless someone else might know what it is.
 
I need that too - I have many IP addressess on my server and 'd like to change IP quickly. It is easy when you have only few accounts but when you have many it is not so easy to make it manually...
 
Thnx ... but I need it with the following command:

Code:
$sock->query('/CMD_API_ACCOUNT_USER', $arrtest );

.... next ...

 $sock->set_login(username_here,password_of_the_user); //to work as an user not an admin

              $usermodify = array(
                  'action' => 'ip',
                  'username' => username_here,
                  'ip' => new_ip_here,
                  'save' => 'submit'
                );

            $sock->query('/CMD_API_MODIFY_USER', $usermodify);


                $result = $sock->fetch_parsed_body();

And I can't change an IP. What is the action - tested ip, action,customize and nothing worked.
 
Last edited:
As it said here http://www.directadmin.com/features.php?id=390

CMD_API_MODIFY_USER

with the same options that CMD_MODIFY_USER uses.

HTML:
<form action="CMD_MODIFY_USER" method="POST">
<input type=hidden name=action value=ip>
<input type=hidden name=user value="support">
<tr><td class=listtitle colspan=3>Change the User's IP</td></tr>
<tr><td class=list>Set IP to</td><td class=list align=center><select class=selectclass name=ip>
<option selected value="195.bbb.ccc.85">195.bbb.ccc.85 - support's current IP</option >
<option value="195.bbb.ccc.83">195.bbb.ccc.83 - Shared - Server</option >
<option value="195.bbb.ccc.86">195.bbb.ccc.86 - Shared</option >
<option value="195.bbb.ccc.94">195.bbb.ccc.94</option >
<option value="195.bbb.ccc.95">195.bbb.ccc.95</option >
</select ></td><td class=list><input type=submit value="Save"></td></tr>
</form>

And what result do you have there?
 
$sock->set_login(username_here,password_of_the_user); //to work as an user not an admin

You should login as reseller, not the owner but the creator of the account for which you want to change IP.
 
Last edited:
Script is logged as a user with the set_login, after that trying to run the API command and got:

Error modifying username xxxxxxx on server new_ip_here

So I have tried many combinations with action => ip, customize, single ... no luck. I am not a good programmer so may be I don;t understand everything.

edit: I can see the status of the created username : user in DA.
 
Last edited:
The script should login as a reseller, not the owner but the creator of the account for which you want to change IP.
 
The script should login as a reseller, not the owner but the creator of the account for which you want to change IP.

OK :) Now got it... the problem is that on my own dedicated server I don't use reseller's accounts. Every single/user account is created under "Resellers Level"

Is this possible to change IP from CLI ?
 
Back
Top