The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

/xml-api/listips - returns empty string

Discussion in 'cPanel Developers' started by steelaz, Jan 9, 2009.

  1. steelaz

    steelaz Member

    Joined:
    Nov 19, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    WHM 11.24.2

    Other API calls work fine. During debugging called "/xml-api/listips" and did a var_dump() on raw result. Here's the output:

    Code:
    string(194) "HTTP/1.0 200 OK
    Connection: close
    Server: whostmgr/11.24.2
    Content-type: text/xml
    
    
    <!-- Web Host Manager  (c) cPanel, Inc. 2008 http://cpanel.net/  Unauthorized copying is prohibited. -->
    "
    
    Any ideas?
     
  2. fanfavorite

    fanfavorite Active Member

    Joined:
    Jun 1, 2008
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    I think this is a bug with the output. It is not displaying the XML correctly. I have the same issue.
     
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,279
    Likes Received:
    8
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The user you are logging into the API/WHM as, do they have root-level access to the server or just that of a typical reseller?
     
  4. fanfavorite

    fanfavorite Active Member

    Joined:
    Jun 1, 2008
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    Reseller for me. Not sure about the person above.
     
  5. steelaz

    steelaz Member

    Joined:
    Nov 19, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    It was reseller, switched to root and it started working, thank you.

    I have another problem now. Trying to delete IP using:

    Code:
    /xml-api/delip?ip=xxx.xxx.xxx.xxx&ethernetdev=eth1:638&skipifshutdown=1
    WHM returns:

    Code:
    status = 1;
    statusmsg = "xxx.xxx.xxx.xxx has been removed";
    But IP is still there. When listing IP, "removable" => 1. Removing manually works fine. Could colon in "ethernetdev" be a problem?
     
  6. MattDees

    MattDees cPanel Product Owner
    Staff Member

    Joined:
    Apr 29, 2005
    Messages:
    417
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    etherdev isn't meant to take the virtual device parameter, just the device, so you would pass it eth0, not eth0:1. There is a confusing warning message involved with all of this that I will see about getting fixed

    So, a proper call will look like:

    QUERY IS: https://192.168.1.243:2087/xml-api/delip?etherdev=eth0&ip=192.168.1.250

    RESPONSE IS:
    <delip>
    <delip>
    <status>1</status>
    <statusmsg>eth0:1 is now down, 192.168.1.250 has been removed</statusmsg>
    </delip>
    </delip>

    <!-- Web Host Manager (c) cPanel, Inc. 2008 http://cpanel.net/ Unauthorized copying is prohibited. -->



    OR


    QUERY IS: https://192.168.1.243:2087/xml-api/delip?etherdev=&ip=192.168.1.250

    RESPONSE IS:
    <delip>
    <delip>
    <status>1</status>
    <statusmsg>eth0:1 is now down, 192.168.1.250 has been removed</statusmsg>
    </delip>
    </delip>

    <!-- Web Host Manager (c) cPanel, Inc. 2008 http://cpanel.net/ Unauthorized copying is prohibited. -->
     
    #6 MattDees, Jan 14, 2009
    Last edited: Jan 14, 2009
  7. steelaz

    steelaz Member

    Joined:
    Nov 19, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    I get the same result passing just "eth1" - successful statusmsg but IP is still there.

    Do I need to restart some service for IPs to be deleted? Someone mentioned "Rebuilding IP address pool"
     
  8. steelaz

    steelaz Member

    Joined:
    Nov 19, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    1
    Fixed it with the help of support ticket.

    Removed "ethernetdev" parameter completely and it worked. Working call looks like this:

    Code:
    /xml-api/delip?ip=xxx.xxx.xxx.xxx
    Also please note that "status" always returns 1 with successful "statusmsg", so for example even invalid IP produces no errors:

    Code:
    /xml-api/delip?ip=1111111111
    returns

    Code:
    <delip>
    <delip>
    <status>1</status>
    <statusmsg>1111111111 has been removed</statusmsg>
    </delip>
    </delip>
     
Loading...

Share This Page