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.

cPanel API v2 Fileman

Discussion in 'cPanel Developers' started by s-h, Dec 10, 2014.

  1. s-h

    s-h Registered

    Joined:
    Apr 11, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hey,

    got a little problem, cause for unknown reason to me accounts that were migrated to my cPanel server (pkgacct/restorepkg) while u ask API2 for:
    Code:
    /xml-api/cpanel?user=migratedloginx&cpanel_xmlapi_module=Fileman&cpanel_xmlapi_func=getdiskinfo&cpanel_xmlapi_version=2
    Return values:
    Code:
    <data>
    <file_upload_max_bytes>99999999999999</file_upload_max_bytes>
    <file_upload_max_bytes_humansize>90,95 TB</file_upload_max_bytes_humansize>
    <file_upload_must_leave_bytes>5242880</file_upload_must_leave_bytes>
    <file_upload_must_leave_bytes_humansize>5 MB</file_upload_must_leave_bytes_humansize>
    <file_upload_remain>14832685056</file_upload_remain>
    <file_upload_remain_humansize>13,81 GB</file_upload_remain_humansize>
    <fileslimit>0</fileslimit>
    <fileslimit_humansize>0 </fileslimit_humansize>
    <filesremain>∞</filesremain>
    <filesremain_humansize>∞</filesremain_humansize>
    <filesused>38025</filesused>
    <filesused_humansize>37,13 KB</filesused_humansize>
    <spacelimit>15729688576</spacelimit>
    <spacelimit_humansize>14,65 GB</spacelimit_humansize>
    <spaceremain>14837927936</spaceremain>
    <spaceremain_humansize>13,82 GB</spaceremain_humansize>
    <spaceused>893039789</spaceused>
    <spaceused_humansize>851,67 MB</spaceused_humansize>
    </data>
    But when u ask regular created account via WHM API2 returns:
    Code:
    <data>
    <file_upload_max_bytes>99999999999999</file_upload_max_bytes>
    <file_upload_max_bytes_humansize>90.95 TB</file_upload_max_bytes_humansize>
    <file_upload_must_leave_bytes>5242880</file_upload_must_leave_bytes>
    <file_upload_must_leave_bytes_humansize>5 MB</file_upload_must_leave_bytes_humansize>
    <file_upload_remain>27349057536</file_upload_remain>
    <file_upload_remain_humansize>25.47 GB</file_upload_remain_humansize>
    <fileslimit>0</fileslimit>
    <fileslimit_humansize>0 bytes</fileslimit_humansize>
    <filesremain>∞</filesremain>
    <filesremain_humansize>∞</filesremain_humansize>
    <filesused>28896</filesused>
    <filesused_humansize>28.22 KB</filesused_humansize>
    <spacelimit>31457280000</spacelimit>
    <spacelimit_humansize>29.3 GB</spacelimit_humansize>
    <spaceremain>27354300416</spaceremain>
    <spaceremain_humansize>25.48 GB</spaceremain_humansize>
    <spaceused>4118572190</spaceused>
    <spaceused_humansize>3.84 GB</spaceused_humansize>
    </data>
    So main differances are commas in restored account and dots in created by WHM.
    Also:
    Code:
    <fileslimit_humansize>0 </fileslimit_humansize>
    And:
    Code:
    <fileslimit_humansize>0 bytes</fileslimit_humansize>
    Below output of quota, I think that api use it for generate results?
    Code:
    # /usr/local/cpanel/bin/quota regularuser
    dev                      blocks      quota      limit      grace      files      quota      limit      grace
    /dev/sda3                    48   30720000   30720000                    33          0          0           
    /dev/sdb1               4006772   30720000   30720000                 28864          0          0           
    # /usr/local/cpanel/bin/quota migratedloginx
    dev                      blocks      quota      limit      grace      files      quota      limit      grace
    /dev/sda3                   168   15361024   15361024                    64          0          0           
    /dev/sdb1                870692   15361024   15361024                 37961          0          0   
    Could you please tell me which file cause that mess so I can fix it and have same output for all accounts?

    Best regards,
     
    #1 s-h, Dec 10, 2014
    Last edited by a moderator: Dec 10, 2014
  2. s-h

    s-h Registered

    Joined:
    Apr 11, 2014
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Okey, problem solved, it was all about locales :)
     
  3. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Would you mind explaining the solution you found in more detail, so that others may benefit?
     
Loading...

Share This Page