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!

WHM API 1 getdiskusage - Permission problem

Discussion in 'cPanel Developers' started by Brooky A, Oct 4, 2018.

  1. Brooky A

    Brooky A Member

    Joined:
    Sep 16, 2015
    Messages:
    16
    Likes Received:
    4
    Trophy Points:
    3
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    Hi Guys,

    I'm looping though an array of cPanel servers using API 1 to get the disk usage with getdiskusage.

    Essentially I want to create new accounts on the server with the lowest percent disk space usage.

    This API call only works if I enable root access on my API token which doesn't seem to be a good idea.

    Can anyone suggest how I can either grant this specific permission or obtain the info in a different way?
     
  2. cPanelLauren

    cPanelLauren Forums Analyst II
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    3,072
    Likes Received:
    215
    Trophy Points:
    173
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @Brooky A

    You cannot run the API as any other user besides the root user, so authenticating as another user would not be acceptable.

    Thanks!
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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