Through the aaPanel API, you can fully control all the functions of the aaPanel Linux panel. In fact, all the functions used after the user logs in to the panel are also docked through the same interface, which means that if you are familiar with the browser debugger, you can easily Complete a third-party front-end docking against the operational parameters of the aaPanel Linux panel.
api_sk
signature:
| Parameter name | Parameter value | Description |
| request_time | Currentuinx timestamp[Must] | |
| request_token | md5(string(request_time)+md5(api_sk))[Must] | |
| Other parameters | Other parameters required by the functional interface [Optional] |
- Please use the POST method to request the API interface.
- In order to ensure the efficiency of the request, please save the cookie and attach a cookie on each request.
- For panel security considerations, be sure to add an IP whitelist
- All response content is unified into Json data format
PHP-Demo: https://www.bt.cn/api_demo_php.zip
Get system basic statistics
URI address:/system?action
Incoming parameters:No
Response:
| Field | Field value example | Description |
| system | CentOS Linux 7.5.1804 (Core) | Operating system information |
| version | 6.8.2 | Panel version |
| time | 0天23小时45分钟 | The time since the last boot to the present |
| cpuNum | 2 | CPU core number |
| cpuRealUsed | 2.01 | CPU usage (percentage) |
| memTotal | 1024 | Physical memory capacity (MB) |
| memRealUsed | 300 | Used physical memory (MB) |
| memFree | 724 | Available physical memory (MB) |
| memCached | 700 | Cached memory (MB) |
| memBuffers | 100 | System buffer (MB) |
"cpuRealUsed": 0.85,
"memTotal": 1741,
"system": "CentOS Linux 7.5.1804 (Core)",
"memRealUsed": 691,
"cpuNum": 6,
"memFree": 189,
"version": "6.8.1",
"time": "0\u592923\u5c0f\u65f657\u5206\u949f",
"memCached": 722,
"memBuffers": 139,
"isuser": 0
URI address:/system?action
Incoming parameters:No
Response:
| Field | Field value example | Description |
| [].path | / | Partition mount point |
| [].inodes | ["8675328","148216","8527112", "2%"] | Partition Inode Usage Information [Total, Used,Available, Usage] |
| [].size | ["8.3G","4.0G", "4.3G", "49%"] | Partition capacity usage information [total, used,available, usage] |
[ {"path": "/", "inodes": ["8675328", "148216", "8527112", "2%"], "size": ["8.3G", "4.0G", "4.3G", "49%"]
},
{ "path": "/www", "inodes": ["655360", "295093", "360267", "46%"], "size": ["9.8G", "3.7G", "5.6G", "40%"]
}
URI address:/system?action
Incoming parameters:NoResponse:
| Field | Field value example | Description |
| downTotal | 446326699 | Total reception (number of bytes) |
| upTotal | 77630707 | Total transmission (number of bytes) |
| downPackets | 1519428 | Total collection (a) |
| upPackets | 175326 | Total delivery (a) |
| down | 36.22 | Downstream traffic (KB) |
| up | 72.81 | Upstream traffic (KB) |
| cpu | [1.87, 6] | CPU real-time information [usage rate, core number] |
| mem | {memFree:189,memTotal: 1741,memCached: 722,memBuffers:139,memRealUsed: 691} | Memory real-time information |
| load | {max: 12, safe: 9,one:0, five: 0.01, limit: 12, fifteen: 0.05} | Load real-time information one: 1 minute five:5 minutes fifteen:10 minutes |
Response content example:
{ "load": {"max": 12, "safe": 9.0, "one": 0.01, "five": 0.02, "limit": 12, "fifteen": 0.05}, "down": 8.77, "downTotal": 453078627, "mem": {"memFree": 189, "memTotal": 1741, "memCached": 722, "memBuffers": 140, "memRealUsed": 690}, "up": 4.33, "upTotal": 78070942, "upPackets": 177930, "downPackets": 1548192, "cpu": [0.23, 6]
}
URI address:/ajax?action=GetTaskCount
传入参数:无
Incoming parameters:No
Response:0
| Parametername | Parameter value | Description |
| check | true | Force check for updates[Optional] |
| force | true | Perform an update [Optional] |
| Field | Field value example | Description |
| status | true | Get state true|false |
| version | 6.3.1 | Latest version number |
| updateMsg | string | Upgrade Instructions |
Response content example:
{ "status": true, "version": "6.3.1", "updateMsg": "Upgrade Instructions"
}
URI address:/data?action
| Parameter name | Parameter value | Description |
| p | 1 | Current page [optional] |
| limit | 15 | Number of rows retrieved [must pass] |
| type | -1 | Classification ID,-1: Sub-category O: Default classification [Optional] |
| order | id desc | Sorting rules Use id descending order: id desc Use name ascending order: name desc [Optional] |
| tojs | get_site_list | Paginated JS callback, if not passed,construct URl paging connection [Optional] |
| search | www | Search content [optional] |
| Field | Field value example | Description |
| data | Site list data | |
| page | Paging data | |
| where | type_id=0 | Data query condition |
Response content example:
{ "data": [ {
"status": "1", "ps": "bbb.com", "domain": 1, "name": "bbb.com", "addtime": "2018-12-14 16:14:03", "path": "/www/wwwroot/bbb.com", "backup_count": 0, "edate": "0000-00-00", "id": 64 } ], "where": "type_id=0", "page": "
URI address:/site?action=get_site_types
Incoming parameters: empty
Response content example:
[ {"id": 0, "name": "\u9ed8\u8ba4\u5206\u7c7b"}
]
URI address:/site?action=GetPHPVersion
Incoming parameters: empty
Response content example:
[ {"version": "00", "name": "\u7eaf\u9759\u6001"}, {"version": "56", "name": "PHP-56"}, {"version": "72", "name": "PHP-72"}
]
| Parameter name | Parameter value | Description |
| webname | {"domain":"w1.hao.com","domainlist":[],"count":0} | Website main domain name and domain name list Please pass JSON [Must] |
| path | /www/wwwroot/w1.hao.com | Root directory [Must] |
| type_id | 0 | Classification mark[Must] |
| type | PHP | Project type Please pass PHP [Must] |
| version | 72 | PHP version Please select from the PHP version list [Must] |
| port | 80 | Website port [Must] |
| ps | test | Website Remarks [Must] |
| ftp | true|false | Whether to create FTP[Must] |
| ftp_username | w1_hao_com | FTP username must be passed when you want to create FTP |
| ftp_password | WCBZ6cH87raERzXc | FTP password must be passed when you want to create FTP |
| sql codeing | true|false utf8|utf8mb4|gbk|big5 | Whether to createa database [Must] Database character set must pass when you want to create a database |
| datauser | w1_hao_com | Database username and name must be passed when you want to create a database |
| datapassword | PdbNjJy5hBA346AR | Database password must be passed when you want to create a database |
| Field | Field value example | Description |
| siteStatus | true|false | Whether the website was created successfully |
| ftpStatus | true|false | Whether FTP is successfully created |
| ftpUser | w2_hao_com | FTP username |
| ftpPass | sRxmY6xCn6zEsFtG | FTP password |
| databaseStatus | true |false | Whether the database was created successfully |
| databaseUser | w2_hao_com | Database username and name |
| databasePass | PdbNjJy5hBA346AR | Database password |
Response content example: {
"ftpStatus": true,
"databaseUser": "w2_hao_com",
"databaseStatus": true,
"ftpUser": "w2_hao_com",
"databasePass": "PdbNjJy5hBA346AR",
"siteStatus": true,
"ftpPass": "sRxmY6xCn6zEsFtG"
URI address:/site?action
| Parameter name | Parameter value | Description |
| id | 66 | Website ID [Must] |
| webname | w2_hao_com | Site name [Must] |
| ftp | 1 | Whether to delete the associated FTP,if you do not delete, please do not pass this parameter [Optional] |
| database | 1 | Whether to delete the associated database, if you do not delete, please do not pass this parameter [Optional] |
| path | 1 | Whether to delete the website root directory, if you do not delete,please do not pass this parameter [Optional] |
| Field | Field value example | Description |
| status | true|false | Whether the operation is successful |
| msg | successfully deleted! | Prompt content |
Response content example:
{ "status": true, "msg": "\u7ad9\u70b9\u5220\u9664\u6210\u529f!"
}
URI address:/site?action=SiteStop
| Parameter name | Parameter value | Description |
| id | 66 | Website ID [Must] |
| name | w2.hao.com | Website name (main domain) [Must] |
Response content example:
{ "status": true, "msg": "\u7ad9\u70b9\u5220\u9664\u6210\u529f!"
}
URI address:/site?action
| Parameter name | Parameter value | Description |
| id | 66 | Website ID [Must] |
| name | w2.hao.com | Website name (main domain) [Must] |
Response content example:
{ "status": true, "msg": "\u7ad9\u70b9\u5df2\u542f\u7528"
}
URI 地址:/site?action=SetEdate
| Parameter name | Parameter value | Description |
| id | 66 | Website ID[Must] |
| edate | 2019-01-01 | Expiration time Permanent: 0000-00-00 [Must] |
Response content example:
{ "status": true, "msg": "\u7ad9\u70b9\u5df2\u542f\u7528"
}
| Parametername | Parameter value | Description |
| id | 66 | Website ID [Must] |
| ps | test | Remarks [Must] |
Response content example:
{ "status": true, "msg": "\u4fee\u6539\u6210\u529f"
}
| Parameter name | Parameter value | Description |
| p | 1 | Current page [Optional] |
| limit | 5 | The number of data rows retrieved per page [Must] |
| type | 0 | Backup type, please pass O fixed [Must] |
| tojs | get_site_backup | Paginated JS callback,if not passed, construct URl paging connection [Optional] |
| search | 66 | Website ID [Must] |
| Parameter name | Parameter value | Description |
| data | Backup list data | |
| page | Paging data | |
| where | type_id=0 | Data query condition |
1 "data": [], "where": "pid
URI address:/site?action=ToBackup
| Parameter name | Parameter value | Description |
| id | 66 | Website ID [Must] |
Response content example:
{ "status": true, "msg": "\u5907\u4efd\u6210\u529f!"
URI address:/site?action=DelBackup
| Parameter name | Parameter value | Description |
| id | 121 | Backup list ID [Must] |
Response content example:
{ "status": true, "msg": "\u5220\u9664\u6210\u529f"
}
| Parameter name | Parameter value | Description |
| search | 66 | Website ID [Must] |
| list | true | Must pass true |
[ { "port": 80, "addtime": "2018-12-15 16:57:30", "pid": 65, "id": 73, "name": "w1.hao.com" }
URI address:/site?action=AddDomain
| Parameter name | Parameter value | Description |
| id | 66 | Website ID[Must] |
| webname | w2.hao.com | Sitename[Must] |
| domain | w4.hao.com:81 | The domain name to be added: port 80, the end product does not have to construct a port,and multiple domain names are separated by a newline [Must] |
Response content example:
{ "status": true, "msg": "\u57df\u540d\u6dfb\u52a0\u6210\u529f!"
}
| Parameter name | Parameter value | Description |
| id | 66 | Website ID[Must] |
| webname | w2.hao.com | Site name [Must] |
| domain | w4.hao.com | Domain name to be deleted [Must] |
| port | 80 | The port of the domain name [Must] |
{ "status": true, "msg": "\u5220\u9664\u6210\u529f"
}
URI address:/site?action=GetRewriteList
| Parameter name | Parameter value | Description |
| siteName | w2.hao.com | Site name [Must] |
| Field | Field value example | Description |
| rewrite | [ | Predefined pseudo static list |
Response content example: {
"rewrite": ["0.\u5f53\u524d", "EmpireCMS", "dabr", "dbshop", "dedecms", "default", "discuz", "discuzx", "discuzx2", "discuzx3", "drupal", "ecshop", "emlog", "laravel5", "maccms", "mvc", "niushop", "phpcms", "phpwind", "sablog", "seacms", "shopex", "thinkphp", "typecho", "typecho2", "weengine", "wordpress", "wp2", "zblog"] }
URI address:/files?action=GetFileBody
| Field | Field value example | Description |
| path | /www/server/panel/vhost/rewrite/nginx/name.con f | The file to be obtained [Must] |
URI address:/files?action=SaveFileBody
| Field | Field value example | Description |
| path | /www/server/panel/vhost/rewrite/nginx/名称.conf | Save location [Must] |
| data | Rule content |
| encoding | utf-8 | File code, please pass it utf-8 |
| Field | Field value example | Description |
| id | 1 | Website ID [Must] |
Retrieve anti-cross-hop configuration/run directory/log switch status/settable run directory list/password access status
URI 地址:/site?action=GetDirUserINI
| Field | Field value example | Description |
| id | 1 | Website ID [Must] |
| path | /www/wwwroot/w1.if22.cn | Website root directory [Must] |
Response content example: {
"pass": false, #Whether to set password access "logs": true, #Whether to write access logs "userini": true, #Whether to set up anti-crossing station "runPath": { "dirs": ["/"], #List of directories that can be used to set the run directory "runPath": "/" #Current running directory } }
URI address:/site?action=SetDirUserINI
| Field | Field value example | Description |
| path | /www/wwwroot/w1.if22.cn | Website root directory [Must] |
URI address:/site?action=logsOpen
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
URI address:/site?action=SetPath
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
| path | /www/wwwroot/w1.if22.cn | New website root directory [Must] |
| Parameter name | Parameter value | Description |
| id | 1 | Website ID[Must] |
| runPath | /public | Run directory based on the root of the website |
URI address:/site?action=SetHasPwd
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
| username | test | username |
| password | admin | password |
URI address:/site?action=CloseHasPwd
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
URI address:/site?action=GetLimitNet
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
URI 地址:/site?action
| Parameter name | Parameter value | Description |
| id | 1 | Website ID[Must] |
| perserver | 300 | Concurrency restrictions [Must] |
| perip | 25 | Single IP limit [Must] |
| limit_rate | 512 | Traffic limit [Must] |
URI address:/site?action=CloseLimitNet
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
URI address:/site?action=GetIndex
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
URI address:/site?action
| Parameter name | Parameter value | Description |
| id | 1 | Website ID [Must] |
| Index | index.php,index.html,index.htm,default.ph p,default.htm,default.html | Default document,each separated by a comma [Must] |
URI address:/files?action=GetFileBody
| Parameter name | Parameter value | Description |
| path | /www/server/panel/vhost/nginx/name.conf | The file to be obtained [Must] |
URI address:/files?action
| Parameter name | Parameter value | Description |
| path | /www/server/panel/vhost/nginx/name.conf | Save location [Must] |
| data | Profile content | |
| encoding | utf-8 | File encoding Please fillin utf-8 |