Skip to content

Get immediate

Dev Support

on our community forums

Plans

Scripts for creating and editing hosting plans (packages).

List Plans

To list all current hosting packages (plans) run:

bash
opencli plan-list

Example output:

bash
opencli plan-list
+----+---------------------+---------------------------------+---------------+----------------+-------------+-----------+------------+--------------+----------+------+------+-----------+--------------+
| id | name                | description                     | domains_limit | websites_limit | email_limit | ftp_limit | disk_limit | inodes_limit | db_limit | cpu  | ram  | bandwidth | storage_file |
+----+---------------------+---------------------------------+---------------+----------------+-------------+-----------+------------+--------------+----------+------+------+-----------+--------------+
|  1 | ubuntu_nginx_mysql  | Unlimited disk space and Nginx  |             0 |             10 |           0 |         0 | 10 GB      |      1000000 |        0 | 1    | 1g   |       100 | 0 GB         |
|  2 | ubuntu_apache_mysql | Unlimited disk space and Apache |             0 |             10 |           0 |         0 | 10 GB      |      1000000 |        0 | 1    | 1g   |       100 | 0 GB         |
+----+---------------------+---------------------------------+---------------+----------------+-------------+-----------+------------+--------------+----------+------+------+-----------+--------------+

You can also format the data as JSON:

bash
opencli plan-list --json

Create Plan

To create a new plan run the following command:

bash
opencli plan-create name"<TEXT>" description="<TEXT>" emails=<COUNT> ftp=<COUNT> domains=<COUNT> websites=<COUNT> disk=<COUNT> inodes=<COUNT> databases=<COUNT> cpu=<COUNT> ram=<COUNT> bandwidth=<COUNT>
ParameterDescriptionTypeNotes
nameName of the planStringUse quotes for multiple words
descriptionPlan descriptionStringUse quotes for multiple words
email_limitMax number of email accountsInteger0 for unlimited
ftp_limitMax number of FTP accountsInteger0 for unlimited
domains_limitMax number of domainsInteger0 for unlimited
websites_limitMax number of websitesInteger0 for unlimited
disk_limitDisk space limit in GBInteger
inodes_limitMax number of inodesIntegerMinimum 250000
db_limitMax number of databasesInteger0 for unlimited
cpuCPU core limitInteger
ramRAM limit in GBInteger
bandwidthPort speed in Mbit/sInteger

Example:

bash
opencli plan-create 'basic' 'Basic Hosting Plan' 10 5 10 5 50 500000 10 2 4 nginx 1000

List Users on Plan

List all users that are currently using a plan:

bash
opencli plan-usage

Example output:

bash
opencli plan-usage
+----+----------+-------+----------------+---------------------+
| id | username | email | plan_name      | registered_date     |
+----+----------+-------+----------------+---------------------+
|  2 | rasa     | rasa  | cloud_4_apache | 2023-11-30 10:33:52 |
|  3 | aas      | sasa  | cloud_4_apache | 2023-11-30 12:01:49 |
+----+----------+-------+----------------+---------------------+

You can also format the data as JSON:

bash
opencli plan-usage --json

Delete Plan

Delete a plan if no users are currently using it.

bash
opencli plan-delete <PLAN_NAME>

Example:

bash
root@stefan:~# opencli plan-delete 'ubuntu_nginx_mysql'
Plan 'ubuntu_nginx_mysql' deleted successfully.

TIP: use ' or " around the plan name if it contains spaces: "plan name here".

--json flag can be passed to return the response as JSON:

bash
root@stefan:~# opencli plan-delete 'ubuntu_nginx_mysql'  --json
{"message": "Plan 'ubuntu_nginx_mysql' deleted successfully."}

Edit Plan

Change plan limits.

bash
opencli plan-edit id=<ID> name"<TEXT>" description="<TEXT>" emails=<COUNT> ftp=<COUNT> domains=<COUNT> websites=<COUNT> disk=<COUNT> inodes=<COUNT> databases=<COUNT> cpu=<COUNT> ram=<COUNT> bandwidth=<COUNT> --debug
ParameterDescriptionTypeNotes
plan_idID of the planIntegerRequired
new_plan_nameNew name of the planStringUse quotes for multiple words
descriptionPlan descriptionStringUse quotes for multiple words
email_limitMax number of email accountsInteger0 for unlimited
ftp_limitMax number of FTP accountsInteger0 for unlimited
domains_limitMax number of domainsInteger0 for unlimited
websites_limitMax number of websitesInteger0 for unlimited
disk_limitDisk space limit in GBInteger
inodes_limitMax number of inodesIntegerMinimum 250000
db_limitMax number of databasesInteger0 for unlimited
cpuCPU core limitInteger
ramRAM limit in GBInteger
bandwidthPort speed in Mbit/sInteger

Example:

bash
opencli plan-edit 1 "sad_se_zove_ovako" "novi plan skroz" 0 0 0 0 10 500000 1 1 1 openpanel/nginx 500

Released under the MIT License.