Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

/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:
    151
    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:
    51
    I think this is a bug with the output. It is not displaying the XML correctly. I have the same issue.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    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:
    51
    Reseller for me. Not sure about the person above.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. steelaz

    steelaz Member

    Joined:
    Nov 19, 2005
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    151
    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 Well-Known Member

    Joined:
    Apr 29, 2005
    Messages:
    416
    Likes Received:
    1
    Trophy Points:
    243
    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. -->
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #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:
    151
    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:
    151
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice