EAPI

This is a Command line API to perform operations.

Introduction

About eapi

The eapi is a command line API tool to manage some basic operations on Eenos. This api tool will help to develop Eenos apps. 

This API tool have currently some limited functionality, if you like to see some features on this, please let us know.

How to access eapi?

Please use the  command line   /usr/bin/eapi

Results From EAPI

The EAPI will output results as YAML, JSON, or JsonPretty format. The default output format is YAML. The eapi output contains three parts.

All available API commands can be refereed from the coming pages.

login

Authentication or Login Check

To test the login of an Eenos user with the password. 

Please provide the password in a base64 encoded format. 

It is dangerous to use this command in plain shell which will expose the password of the user. Use this command for testing purposes only and change the user password after testing.

Command:

/usr/local/eenos/scripts/eapi --user=EENOS_USER  --login=base64_ENCODED_PASSWORD

Where,

Output:

An Example output for Eenso user foo is as follows,

data:
  user: foo
message: Login success - foo
status: ok

userinfo

Get the Eenos User Information

This api option will fetch the Eenso user information and show it.

Command:

/usr/local/eenos/scripts/eapi --userinfo --user=USER

Where USER is the  Eenos username

Example :

Fetch the user info of Eenos user  fun as YAML

# /usr/local/eenos/scripts/eapi --userinfo --user=fun
data:
  addondomains: unlimited
  bandwidth: unlimited
  contactemail: fun@fun.com
  dedicatedip:
    ipv4: 10.40.192.204
    ipv6: 2a01:4f8:120:20xx::xx
    status: 'off'
    status6: 'off'
  dkim: 'on'
  domain: fun.com
  email: unlimited
  feature: Default
  ftp: unlimited
  homedir: /home/fun
  language: en
  maillist: unlimited
  mailquota: unlimited
  mailserver: local
  nameservers:
  - ns1.domain.com
  - ns2.domain.com
  - ns3.domain.com
  owner: root
  package: Gold
  parkeddomains: unlimited
  quota: unlimited
  reseller:
    selfown: 'off'
    status: 'off'
  setuptime: 2021-01-23 23:14
  shell:
    shell: /usr/sbin/nologin
    status: 'off'
  spf: 'on'
  sql: unlimited
  subdomains: unlimited
  theme: default
  user: fun
message: user information of - fun
status: ok

Fetch the user info of Eenos user  fun as  JSON Pretty

 # /usr/local/eenos/scripts/eapi --userinfo --user=fun --output=jsonpretty
{
    "status": "ok",
    "message": "user information of - fun",
    "data": {
        "addondomains": "unlimited",
        "bandwidth": "unlimited",
        "contactemail": "fun@fun.com",
        "dedicatedip": {
            "ipv4": "10.40.192.204",
            "ipv6": "2a01:4f8:120:20xx::xx",
            "status": "off",
            "status6": "off"
        },
        "dkim": "on",
        "domain": "fun.com",
        "email": "unlimited",
        "feature": "Default",
        "ftp": "unlimited",
        "homedir": "/home/fun",
        "language": "en",
        "maillist": "unlimited",
        "mailquota": "unlimited",
        "mailserver": "local",
        "nameservers": [
            "ns1.domain.com",
            "ns2.domain.com",
            "ns3.domain.com"
        ],
        "owner": "root",
        "package": "Gold",
        "parkeddomains": "unlimited",
        "quota": "unlimited",
        "reseller": {
            "selfown": "off",
            "status": "off"
        },
        "setuptime": "2021-01-23 23:14",
        "shell": {
            "shell": "/usr/sbin/nologin",
            "status": "off"
        },
        "spf": "on",
        "sql": "unlimited",
        "subdomains": "unlimited",
        "theme": "default",
        "user": "fun"
    }