PHP code example of meklis / switcher-core-client

1. Go to this page and download the library: Download meklis/switcher-core-client 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/ */

    

meklis / switcher-core-client example snippets

 


e = (new \Meklis\SwCoreClient\Objects\Device())
    ->setIp("10.1.1.11")
    ->setCommunity("public");

$client = new \Meklis\SwCoreClient\Client();
$resp = $client->detectByDevice($device);
 

nt = new \Meklis\SwCoreClient\Client();

$req = \Meklis\SwCoreClient\Objects\Request::init(
    (new \Meklis\SwCoreClient\Objects\Device())->setIp('10.1.1.11')->setCommunity('public'),
    "system"
);

$resp = $client->call($req);
 

nt = new \Meklis\SwCoreClient\Client();

$reqs = [
    \Meklis\SwCoreClient\Objects\Request::init(
        (new \Meklis\SwCoreClient\Objects\Device())->setIp('10.1.1.11')->setCommunity('public'),
        "system"
    ),
    \Meklis\SwCoreClient\Objects\Request::init(
        (new \Meklis\SwCoreClient\Objects\Device())->setIp('10.1.1.11')->setCommunity('public'),
        "fdb",
        ['interface' => 27]
    ),
];

$resp = $client->callMulti($reqs);

print_r($resp);