设为首页收藏本站

安而遇随-随遇而安

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
安而遇随-随遇而安 首页 其他 转载 查看内容

kangle API操作接口

2017-7-11 01:50| 发布者: admin| 查看: 623| 评论: 0|原作者: websc|来自: 永恒社区

摘要: 请求验证的文件请求url:http://服务器IP地址(或域名):3312/api/index.phpAPI接口权限验证:每发送一条api调用,必需带的参数有:c : (control)表示哪个控制文件(目前有whm,cdn)a : (action)表示哪个方法,以下介绍r : ...

请求验证的文件
请求url:http://服务器IP地址(或域名):3312/api/index.php
API接口权限验证:每发送一条api调用,必需带的参数有:

  • c : (control)表示哪个控制文件(目前有whm,cdn)

  • a : (action)表示哪个方法,以下介绍

  • r : 随机数

  • s : 秘钥,通过md5(a + skey +r)得到,如a=add,skey=test,r=888,则s=md5(addtest888)

  • 其中skey是服务器安全码



如:

  • http://192.168.1.20:3312/api/index.php?c=whm&a=add&r=888&s=8e4fc6f181bedf11c64bac3bf341ca6a




如果验证s不通过,你会得到以下的返回
  • {"result":403,"msg":"\u6743\u9650\u9519\u8bef,\u8bf7\u68c0\u67e5\u901a\u4fe1\u5b89\u5168\u7801\u662f\u5426\u6b63\u786e"}




接口的返回数据
如果接口加了json=1参数过来,你将得到json数据。如果没有,将得到xml数据。
友情提示:请最好带json=1参数过来。以后的接口默认情况下考虑输出json。
=============================================================================
获取easypanel的信息(包括了kangle的信息)
c : whm
a : info
调用成功后你将得到如下返回数据:
  • {"result":200,"server":[{"0":"kangle"}],"version":[{"0":"3.4.8"}],"type":[{"0":"enterprise"}],"os":[{"0":"windows"}],"license_id":[{"0":"73646_1387957818"}],"license_name":[{"0":"dsdds"}],"total_run":[{"0":"611038"}],"connect":[{"0":"4"}],"request":[{"0":"14105"}],"accept":[{"0":"4722"}],"vh":[{"0":"43"}],"kangle_home":[{"0":"D:\\\easypanel\\"}],"update_code":[{"0":"win_x64"}],"easypanel_version":"2.6.17"}



其中result=200表示调用成功。
version是kangle的版本
type是kangle的商业版还是免费版(enterprise  or free)
total_run 是运行时间
vh 是虚拟主机数量
connect是当前有多少请求进来。

实例http://localhost:3312/api/index.php?c=whm&a=info&r=888&s=c819ddc971b9fc174fd3739b74c3ed13
=============================================================================
获取站点的信息
c : whm
a : getVh
name : (虚拟主机名称)
如果有这个站点,则返回:

  • {"result":200,"name":"asdf","doc_root":"D:\/home\/ftp\/a\/asdf","uid":"a1017","gid":"K~w_dSjgZe9MVqb","module":"php","templete":"easypanel","subtemplete":null,"create_time":"1444195060","expire_time2":0,"status":0,"subdir_flag":"1","subdir":"wwwroot","web_quota":"1000","db_quota":"0","domain":"-1","htaccess":".htaccess","max_connect":"0","max_worker":"8","max_queue":"0","ftp":"1","log_file":"logs\/access.log","access":"access.xml","db_name":"asdf","speed_limit":"0","product_id":"0","envs":"","cs":0,"cdn":"0","ext_passwd":0,"db_type":"mysql","log_handle":"1","max_subdir":"0","flow":"0","sync_seq":0,"flow_limit":"0","ftp_connect":"0","ftp_usl":"0","ftp_dsl":"0","ip":"","port":"","certificate":null,"certificate_key":null,"ftp_subdir":null,"last_password_error":"'''0'''","password_error_count":"'''0'''","password_security":null,"ssi":"1","ignore_backup":"0","cron":"0","recordid":"10001"}




如果没有该站点,返回

  • {"result":500}





虚拟主机的参数说明
name : 主机名称
doc_root:主机的主目录
uid:系统生成(用户在服务器上的账户ID),权限控制使用。不可更改。
gid :系统账户组ID
module:是属于哪个模块,目前有php和iis两个模块。
templete,subtemplete,已废弃
create_time :创建时间
expire_time2 :过期时间
status:站点状态,0正常,1为关闭。
subdir_flag 是否允许子域名,1为允许,0为不允许
subdir 默认子目录名称
web_quota 空间大小
db_quota 数据库大小
domain :允许绑定域名数量 -1为不限
max_connect 最多连接数
max_worker 最多工作者
ftp : 是否开通ftp,1为开通,0为不开通
db_name 数据库名称(一般和主机名称等同,sql server 特殊)


注:加入参数json=1才能以json形式显示,默认为xml形式


实例:http://localhost:3312/api/index.php?c=whm&a=getVh&name=yonghensq&r=888&s=2f66bdf22ef05d27272011f5a3265316&json=1
=============================================================================
创建站点
固定参数:

  • c : whm

  • a : add_vh

  • r : 随机

  • s : 秘钥

  • init : 1  //表示创建

  • name:网站账号,数据库账号,ftp账号同步

  • passwd:网站密码,数据库密码,ftp密码同步(只创建时同步)




以下为可选参数(用于发送空间的一些参数,如网页大小,数据库大小,有三种方式,第一种是发送产品ID,第二种是发送产品名称,最后一种是发送详细的参数);
第一种:发送产品ID

  • product_id:easypanel里的产品ID


[color=rgb(51, 102, 153) !important]复制代码

例:
  • http://www.kanglesoft.com:3312/api/?c=whm&a=add_vh&r=3333&s=sdfasdfsadfddaffsdf3&name=webtest&passwd=webpasswd&init=1&product_id=1



第二种:发送产品名称
  • Product_name:easypanel里的产品名称



例:
  • http://www.kanglesoft.com:3312/api/?c=whm&a=add_vh&r=3333&s=sdfasdfsadfddaffsdf3&name=webtest&passwd=webpasswd&init=1&product_name=php100



第三种:发送详细的参数:
  • cdn:是否为CDN空间,是则发送1

  • Templete:语言(html|php|iis)

  • Subtemplete:语言引擎,php52|php53|php5217

  • web_quota:网页空间大小,数字

  • db_quota:数据库大小,数字

  • db_type:数据库类型,mysql|sqlsrv

  • subdir_flag:是否允许绑定子目录,1为是

  • Subdir:默认绑定目录,可为空,例:wwwroot

  • max_subdir:最多子目录数

  • domain:需要绑定的域名,可空,默认会绑定到subdir指 定的目录下。

  • ftp:是否开启ftp,1为是

  • ftp_connect:ftp最多连接数

  • ftp_usl:ftp上传速度限制,单位kb

  • ftp_dsl:ftp下载限制。单位kb

  • access:是否启用自定义控制,如果是请输入自定义控制文件名access.xml

  • speed_limit:带宽限制,数字型,默认为不限

  • log_handle:是否开启日志析分功能,1为是

  • flow_limit:流量限制,数字型,默认不限


注:200为创建成功 500重复了
实例:http://localhost:3312/api/index.php?c=whm&a=add_vh&r=888&s=7dc796167fdbd7204435e80d6445d56e&name=baibai&passwd=123456&init=1
=============================================================================
获取站点列表
a : whm
c : listVh
r : 随机数
s : 秘钥
返回样列数据(json)

  • {"result":200,"rows":[{"name":"dnsdun","doc_root":"D:\\project\\dnsdun","uid":"a1001","module":"php","templete":"easypanel","subtemplete":null,"create_time":"1408332566","expire_time2":"'''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''","status":"0","subdir_flag":"1","subdir":"wwwroot","web_quota":"1000","db_quota":"1000","domain":"-1","htaccess":".htaccess","max_connect":"0","max_worker":"8","max_queue":"0","ftp":"0","log_file":"logs\/access.log","access":"access.xml","db_name":"dnsdun","speed_limit":"0","product_id":"0","envs":"","cs":"'''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''","cdn":"0","ext_passwd":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","db_type":"mysql","log_handle":"1","max_subdir":"0","flow":"0","sync_seq":"'''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''","flow_limit":"0","ftp_connect":"0","ftp_usl":"0","ftp_dsl":"0","ip":"","port":"","certificate":null,"certificate_key":null,"ftp_subdir":"","last_password_error":"'0'","password_error_count":"'0'","password_security":null,"ssi":"1","ignore_backup":"0","cron":"0","recordid":"10406"},{"name":"vhmshost","doc_root":"D:\/home\/ftp\/v\/vhmshost","uid":"a1011","module":"php","templete":"easypanel","subtemplete":null,"create_time":"1437731150","expire_time2":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","status":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","subdir_flag":"1","subdir":"wwwroot","web_quota":"1000","db_quota":"1000","domain":"-1","htaccess":".htaccess","max_connect":"0","max_worker":"8","max_queue":"0","ftp":"1","log_file":"logs\/access.log","access":"access.xml","db_name":"vhmshost","speed_limit":"0","product_id":"0","envs":"","cs":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","cdn":"0","ext_passwd":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","db_type":"mysql","log_handle":"1","max_subdir":"0","flow":"0","sync_seq":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","flow_limit":"0","ftp_connect":"0","ftp_usl":"0","ftp_dsl":"0","ip":"","port":"","certificate":null,"certificate_key":null,"ftp_subdir":null,"last_password_error":"'''0'''","password_error_count":"'''0'''","password_security":null,"ssi":"1","ignore_backup":"0","cron":"0","recordid":"10505"},{"name":"kangle","doc_root":"D:\/home\/ftp\/k\/kangle","uid":"a1012","module":"php","templete":"easypanel","subtemplete":null,"create_time":"1440134528","expire_time2":"1443014667.584","status":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","subdir_flag":"1","subdir":"wwwroot","web_quota":"1000","db_quota":"0","domain":"-1","htaccess":".htaccess","max_connect":"0","max_worker":"8","max_queue":"0","ftp":"1","log_file":"logs\/access.log","access":"access.xml","db_name":"kangle","speed_limit":"102400","product_id":"0","envs":"","cs":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","cdn":"0","ext_passwd":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","db_type":"mysql","log_handle":"1","max_subdir":"0","flow":"0","sync_seq":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","flow_limit":"0","ftp_connect":"0","ftp_usl":"0","ftp_dsl":"0","ip":"","port":"","certificate":null,"certificate_key":null,"ftp_subdir":null,"last_password_error":"'''0'''","password_error_count":"'''0'''","password_security":null,"ssi":"1","ignore_backup":"0","cron":"0","recordid":"10637"},{"name":"php100010","doc_root":"D:\/home\/ftp\/p\/php100010","uid":"a1013","module":"","templete":"php","subtemplete":"php52","create_time":"1441868079","expire_time2":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","status":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","subdir_flag":"1","subdir":"\/wwwroot","web_quota":"100","db_quota":"100","domain":"-1","htaccess":".htaccess","max_connect":"0","max_worker":"8","max_queue":"0","ftp":"1","log_file":"logs\/access.log","access":"access.xml","db_name":"php100010","speed_limit":"0","product_id":"10","envs":"","cs":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","cdn":"0","ext_passwd":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","db_type":"mysql","log_handle":"0","max_subdir":"0","flow":"0","sync_seq":"'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''0'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''","flow_limit":"0","ftp_connect":"0","ftp_usl":"0","ftp_dsl":"0","ip":"","port":"","certificate":null,"certificate_key":null,"ftp_subdir":null,"last_password_error":"'''0'''","password_error_count":"'''0'''","password_security":null,"ssi":"0","ignore_backup":"0","cron":"0","recordid":"10866"}]}



修改站点密码
c :whm
a : change_password
r : 随机数
s : 秘钥
name :站点名称
passwd :新的密码

例 :

  • http://localhost:3312/api/index.php?c=whm&a=change_password&name=dnsdun&passwd=kangle&json=1



返回成功:
  • {"result":200}



更改站点状态
c : whm
a : update_vh
r : 随机数
s : 秘钥
name : 站点名称
status : 新状态(0正常,1关闭)
例 :
  • http://localhost:3312/api/index.php?c=whm&a=update_vh&name=dnsdun&status=1&json=1



返回:
  • {"result":200}



删除站点
c : whm
a : del_vh
r : 随机数
s : 秘钥
name : 站点名称

成功返回:
  • {"result":200}



获取站点的数据库使用量
c : whm 
a : getDbUsed
r : 随机数
s : 秘钥
name : 站点名称

例:
  • http://localhost:3312/api/index.php?c=whm&a=getDbUsed&name=dnsdun&json=1




成功返回:
  • {"result":200,"used":1000}




PHP调用kangle的API 


根据管理的API公布写了一个类封装了一个操作集合,这是一个kangleAPI的一个封装吧,是在其他地方看到的,接口包含获取easypanel的信息(包括了kangle的信息)、获取站点信息、创建kangle站点、修改指定kangle站点信息、获取kangle站点列表、修改指定kangle站点密码、修改指定kangle站点状态、删除指定kangle站点、获取指定kangle站点的数据库使用量。


调用页示例:

<?php
//引入类
include_once('kangle_init.class.php');
//初始化
//$kangle = new kangle_init('IP或域名(默认127.0.0.1)','端口(默认3312)','秘钥(默认test)','协议(http/https,默认http)');
$kangle = new kangle_init('127.0.0.1','3312','asfsvsvsyYD6Y6ue','http');
//调用方法示例,具体请参照类文件,有详细的代码注释说明
$kangle->update_vh('test',0)


封装的函数:

<?php
class kangle_init{
   /*
    * 配置需求:PHP >= 5.2.0
    * by:  千里溃
    * 参照出处: https://www.kanglesoft.com/thread-44506-1-1.html
    * c : (control)表示哪个控制文件(目前有whm,cdn)
    * a : (action)表示哪个方法,以下介绍
    * r : 随机数
    * s : 秘钥,通过md5(a + skey +r)得到,如a=add,skey=test,r=888,则s=md5(addtest888)
    * 其中skey是服务器安全码
    * 所有返回成功都报[result] => 200
    * 不成功报[result] => 500 或者 新建(修改)站点时 product_id 和 product_name 都存在参数时报 [result] => 505
    */


   public $protocol ;
   public $ip;
   public $port;
   public $r;
   public $skey;

   public function __construct($ip = '127.0.0.1',$port = '3312',$skey = 'test',$protocol = 'http')
   {
       $this->protocol = $protocol; //仅支持http和https
       $this->ip = $ip;
       $this->port = $port;
       $this->r = rand(100000,999999);
       $this->skey = $skey;
   }
   public function __destruct()
   {
       // TODO: Implement __destruct() method.
   }
   public function url($info=array()){
       $url = '';
       foreach ($info as $k=>$v){
           $url .= $k.'='.$v.'&';
       }
       return $this->protocol.'://'.$this->ip.':'.$this->port.'/api/index.php?'.$url.'r='.$this->r.'&s='.md5($info['a'].$this->skey.$this->r).'&json=1';
   }

   public function open($info=array()){
       $url = $this->url($info);
       if(function_exists('curl_init')){
           $ch = curl_init();
           curl_setopt($ch, CURLOPT_URL, $url);
           curl_setopt($ch, CURLOPT_TIMEOUT, 5);
           curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
           if ($this->protocol == 'https' or $this->protocol == 'HTTPS'){
               curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // 跳过证书检查
               curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, true);  // 从证书中检查SSL加密算法是否存在
           }
           $r = curl_exec($ch);
           curl_close($ch);
           return json_decode($r,true);
       }else{
           return json_decode(file_get_contents($url),true);
       }
   }

   //获取easypanel的信息(包括了kangle的信息)
   public function info(){
       /*
        * c : whm
        * a : info
        * 调用成功后你将得到如下返回数据:
        * {"result":200,"server":[{"0":"kangle"}],"version":[{"0":"3.4.8"}],"type":[{"0":"enterprise"}],"os":[{"0":"windows"}],"license_id":[{"0":"73646_1387957818"}],"license_name":[{"0":"dsdds"}],"total_run":[{"0":"611038"}],"connect":[{"0":"4"}],"request":[{"0":"14105"}],"accept":[{"0":"4722"}],"vh":[{"0":"43"}],"kangle_home":[{"0":"D:\\\easypanel\\"}],"update_code":[{"0":"win_x64"}],"easypanel_version":"2.6.17"}
        * 其中result=200表示调用成功。
        * version是kangle的版本
        * type是kangle的商业版还是免费版(enterprise  or free)
        * total_run 是运行时间
        * vh 是虚拟主机数量
        * connect是当前有多少请求进来。
        *
        */

       return $this->open(array('c'=>'whm','a'=>'info'));

   }

   //获取站点信息
   public function getvh($name = null){
       /*
        * c : whm
        * a : getVh
        * name : (虚拟主机名称)
        *
        * 返回的虚拟主机的参数说明
        * name : 主机名称
        * doc_root:主机的主目录
        * uid:系统生成(用户在服务器上的账户ID),权限控制使用。不可更改。
        * gid :系统账户组ID
        * module:是属于哪个模块,目前有php和iis两个模块。
        * templete,subtemplete,已废弃
        * create_time :创建时间
        * expire_time2 :过期时间
        * status:站点状态,0正常,1为关闭。
        * subdir_flag 是否允许子域名,1为允许,0为不允许
        * subdir 默认子目录名称
        * web_quota 空间大小
        * db_quota 数据库大小
        * domain :允许绑定域名数量 -1为不限
        * max_connect 最多连接数
        * max_worker 最多工作者
        * ftp : 是否开通ftp,1为开通,0为不开通
        * db_name 数据库名称(一般和主机名称等同,sql server 特殊)
        */
       return $this->open(array('c'=>'whm','a'=>'getVh','name'=>$name));
   }

   //创建站点
   public function add_vh($info = array()){
       /*
        * 固定值:
        * c : whm
        * a : add_vh
        * r : 随机
        * s : 秘钥
        * init : 1  //表示创建
        * name:网站账号,数据库账号,ftp账号同步
        * passwd:网站密码,数据库密码,ftp密码同步(只创建时同步)
        * product_id 和 product_name 都存在参数时报 [result] => 505,product_id 和 product_name 只能存在一个或者 一个都不存在,当一个都不存在时 详细配置虚拟主机参数
        */
       if(trim(intval($info['product_id'])) != null and trim($info['product_name']) != null){
           return array('result'=>'505');
       }elseif(trim(intval($info['product_id'])) != null){
           return $this->open(array('c'=>'whm','a'=>'add_vh','init'=>1,'name'=>$info['name'],'passwd'=>$info['passwd'],'product_id'=>$info['product_id']));
       }elseif (trim($info['product_name']) != null){
           return $this->open(array('c'=>'whm','a'=>'add_vh','init'=>1,'name'=>$info['name'],'passwd'=>$info['passwd'],'product_id'=>$info['product_name']));
       }else{
           /*
            * 详细配置模式下的传入值列表
            * cdn:是否为CDN空间,是则发送1
            * Templete:语言(html|php|iis)
            * Subtemplete:语言引擎,php52|php53|php5217
            * web_quota:网页空间大小,数字
            * db_quota:数据库大小,数字
            * db_type:数据库类型,mysql|sqlsrv
            * subdir_flag:是否允许绑定子目录,1为是
            * Subdir:默认绑定目录,可为空,例:wwwroot
            * max_subdir:最多子目录数
            * domain:需要绑定的域名,可空,默认会绑定到subdir指 定的目录下。
            * ftp:是否开启ftp,1为是
            * ftp_connect:ftp最多连接数
            * ftp_usl:ftp上传速度限制,单位kb
            * ftp_dsl:ftp下载限制。单位kb
            * access:是否启用自定义控制,如果是请输入自定义控制文件名access.xml
            * speed_limit:带宽限制,数字型,默认为不限(kb)
            * log_handle:是否开启日志析分功能,1为是
            * flow_limit:流量限制,数字型,默认不限(kb)
            */
           $info=array('c'=>'whm','a'=>'add_vh','init'=>1,'name'=>$info['name'],'passwd'=>$info['passwd']);
           return $this->open($info);

       }
   }

   //修改站点信息
   public function edit_vh($info = array()){
       /*
        * 固定值:
        * c : whm
        * a : add_vh
        * r : 随机
        * s : 秘钥
        * edit : 1  //表示修改
        * name:网站账号,数据库账号,ftp账号同步
        * passwd:网站密码,数据库密码,ftp密码同步(只创建时同步)
        *  product_id 和 product_name 都存在参数时报 [result] => 505,product_id 和 product_name 只能存在一个或者 一个都不存在,当一个都不存在时 详细配置虚拟主机参数
        */
       if(trim(intval($info['product_id'])) != null and trim($info['product_name']) != null){
           return array('result'=>'505');
       }elseif(trim(intval($info['product_id'])) != null){
           return $this->open(array('c'=>'whm','a'=>'add_vh','edit'=>'1','name'=>$info['name'],'passwd'=>$info['passwd'],'product_id'=>$info['product_id']));
       }elseif (trim($info['product_name']) != null){
           return $this->open(array('c'=>'whm','a'=>'add_vh','edit'=>'1','name'=>$info['name'],'passwd'=>$info['passwd'],'product_id'=>$info['product_name']));
       }else{
           /*
            * 详细配置模式下的传入值列表
            * cdn:是否为CDN空间,是则发送1
            * Templete:语言(html|php|iis)
            * Subtemplete:语言引擎,php52|php53|php5217
            * web_quota:网页空间大小,数字
            * db_quota:数据库大小,数字
            * db_type:数据库类型,mysql|sqlsrv
            * subdir_flag:是否允许绑定子目录,1为是
            * Subdir:默认绑定目录,可为空,例:wwwroot
            * max_subdir:最多子目录数
            * domain:需要绑定的域名,可空,默认会绑定到subdir指 定的目录下。
            * ftp:是否开启ftp,1为是
            * ftp_connect:ftp最多连接数
            * ftp_usl:ftp上传速度限制,单位kb
            * ftp_dsl:ftp下载限制。单位kb
            * access:是否启用自定义控制,如果是请输入自定义控制文件名access.xml
            * speed_limit:带宽限制,数字型,默认为不限(kb)
            * log_handle:是否开启日志析分功能,1为是
            * flow_limit:流量限制,数字型,默认不限(kb)
            */
           $info=array('c'=>'whm','a'=>'add_vh','edit'=>'1','name'=>$info['name'],'passwd'=>$info['passwd']);
           return $this->open($info);

       }
   }

   //获取站点列表
   public function listvh(){
       /*
        * a : whm
        * c : listVh
        */
       return $this->open(array('c'=>'whm','a'=>'listVh'));
   }

   //修改站点密码
   public function change_password($name,$passwd){
       /*
        * c :whm
        * a : change_password
        * name :站点名称
        * passwd :新的密码
        */
       return $this->open(array('c'=>'whm','a'=>'change_password','name'=>$name,'passwd'=>$passwd));
   }

   //修改站点状态
   public function update_vh($name,$status){
       /*
        * c :whm
        * a : update_vh
        * name :站点名称
        * status : 新状态(0正常,1关闭)
        */
       return $this->open(array('c'=>'whm','a'=>'update_vh','name'=>$name,'status'=>$status));
   }


   //删除站点
   public function del_vh($name){
       /*
        * c :whm
        * a : del_vh
        * name :站点名称
        */
       return $this->open(array('c'=>'whm','a'=>'del_vh','name'=>$name));
   }


   //获取站点的数据库使用量
   public function getDbUsed($name){
       /*
        * c :whm
        * a : getDbUsed
        * name :站点名称
        */
       return $this->open(array('c'=>'whm','a'=>'getDbUsed','name'=>$name));
   }

}





鲜花

握手

雷人

路过

鸡蛋

相关阅读

最新评论

返回顶部