Giter VIP home page Giter VIP logo

whmapi's Introduction

WHMApi python module

Simple to use python module to perform WHM operations directly from python code.

Use cases:

  • Test cPanel hooks modules
  • Write automation
  • Create test users
  • Check accounts and domains
  • and so on...

Example usage

To list all local cPanel users:

# List local cPanel user accounts.
from whmapi import APIClient

client = APIClient()
local_users = client.call('listaccts')

To use function with paramaeters:

# Find particular user.
from whmapi import APIClient

client = APIClient()
sample_user = client.call(
    function='listaccts',
    req_params={'searchtype': 'user',
                'search': 'example'})

Sample output:

{
   "data":{
      "acct":[
         {
            "maxaddons":"*unknown*",
            "ip":"0.0.0.0",
            "min_defer_fail_to_trigger_protection":"20",
            "legacy_backup":1,
            "diskused":"10M",
            "maxftp":"5",
            "startdate":"08 Jun 19 17:05",
            "max_defer_fail_percentage":"50",
            "disklimit":"150000M",
            "is_locked":0,
            "suspendtime":0,
            "email":"[email protected]",
            "domain":"example.com",
            "unix_startdate":1213866345,
            "user":"example",
            "plan":"Sample - Hosting",
            "shell":"/usr/local/cpanel/bin/noshell",
            "maxpop":"100",
            "backup":0,
            "theme":"awesometheme",
            "owner":"austghost",
            "max_email_per_hour":"500",
            "ipv6":[

            ],
            "suspendreason":"not suspended",
            "maxlst":"*unknown*",
            "suspended":0,
            "maxsql":"10",
            "maxparked":"5",
            "partition":"home5",
            "maxsub":"unlimited"
         }
      ]
   },
   "metadata":{
      "version":1,
      "reason":"OK",
      "result":1,
      "command":"accountsummary"
   }
}

Usefull linlks

WHMApi1 documentation

whmapi's People

Contributors

eh1k0 avatar noonedeadpunk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.