PHP code example of imactool / dssplat

1. Go to this page and download the library: Download imactool/dssplat library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

imactool / dssplat example snippets

 

 use Imactool\Dssplat\DssPlat;

 $config = [
     'ip' => '192.168.0.12',
     'port' => '8314',
     'loginName' => 'system',
     'loginPass' => '123456',
 ];

 $app = new DssPlat($config);
 
 $result = $app->Auth->login(); //必须先登录,才可以继续调用其他的接口
 
 
 //获取组织树
 $result = $app->Org->getVimsTree();
 var_dump($result);
 if ($result['success'] == true){
     echo "成功获取到组织树 <Br/>";
    foreach ($result['data'] as $val){
        echo "父级节点 【{$val['id']}】<br/>";
    }
 }

 //查询设备
 $res = $app->Org->getDeviceInfo();
 if ($res['result']['code'] == 'success'){
     echo "成功获取到 查询设备  <Br/>";
     $val = [];
     foreach ($res['data'] as $val){
        var_dump($val);
     }
 }