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.

Bandwidth in XML API

Discussion in 'cPanel Developers' started by Andrewcp, Mar 6, 2009.

  1. Andrewcp

    Andrewcp Registered

    Joined:
    Mar 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Hi there

    What .xml file is the bandwidth displayed on using the XML API? It is not displayed in accountsummary xml file.
     
  2. 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
    .../xml-api/showbw :)
     
  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 contents of showbw look like the following:

    HTML:
    <acct>
      <deleted>0</deleted>
      <limit>BANDWIDTH-LIMIT-IN-BYTES</limit>
      <maindomain>MAIN-DOMAIN</maindomain>
      <owner>OWNER-OF-ACCOUNT</owner>
      <reseller>0 OR 1</reseller>
      <totalbytes>NUMBER-OF-BYTES-TRANSFERRED</totalbytes>
      <user>USERNAME</user>
    </acct>
    
     
  4. Andrewcp

    Andrewcp Registered

    Joined:
    Mar 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks very much David.

    What are the variables in .../xml-api/showbw? For example like the account summary xml file.

    <accountsummary>
    <acct>
    <disklimit>1000M</disklimit>
    </acct>

    It’s just I don't have access to cPanel and I am trying to write a script that parses the xml.

    Thanks very much.
     
  5. Andrewcp

    Andrewcp Registered

    Joined:
    Mar 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Thanks

    Can the xml be called by xml-api/showbw?user=xxxxx?
     
  6. 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
    To display the bandwidth consumption for an individual user, you would use:

    Code:
    xml-api/showbw?search=USERNAME&searchtype=user
    In this example, USERNAME is the user whose bandwidth information I desire.
     
  7. Andrewcp

    Andrewcp Registered

    Joined:
    Mar 6, 2009
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    This there a date variable in showbw? For some reason 2009 is being displayed?
     
  8. 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
    You mean 2009 is being displayed in the year tag, just like 3 is currently displayed in the month tag, indicating which month this bandwidth data is for?

    Yes, you can set month=MONTH_NUMBER and year=YEAR as GET parameters.
    - YEAR is a 4-digit year (e.g. 2008)
    - MONTH_NUMBER is a number representing a month (1 representing January .. 12 representing December).
     
  9. xfoxx

    xfoxx Registered

    Joined:
    May 27, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,there.Can i set day as GET parameters?
    How can I get the daily bandwidth with the XML-API?
     
    #9 xfoxx, May 27, 2009
    Last edited: May 28, 2009
  10. 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
    WHM does not generate daily bandwidth reports. Therefore, since WHM doesn't have this function - there is no API to access such information.
     
  11. xfoxx

    xfoxx Registered

    Joined:
    May 27, 2009
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    It's bad :( ,but thahks for your answer.I have one more, can i change the quota without using scripts/editquota.
     
  12. 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
    At this time, cPanel user quota modification is not available in our XML API except by means of changing the package associated with that account.
     
Loading...

Share This Page