<thead> <tr> <th class="text-center">IP Address</th> <th class="text-center">Description</th> <th class="text-center">Mode</th> <th class="text-center">Status</th> <th class="text-center"><span class="glyphicon glyphicon-remove"></span></th> </tr> </thead> <tbody> <?php $url = "http://" . $odl_host . ":8181/restconf/operations/sxp-controller:get-connections"; $sxpHeaders = array("accept: application/xml", "authorization: Basic YWRtaW46YWRtaW4=", "content-type: application/xml"); $sxpData = "<input xmlns=\"urn:opendaylight:sxp:controller\">\r <requested-node>127.0.0.1</requested-node>\r</input>"; $res = restCall("POST", $url, $odl_auth, $sxpHeaders, 8181, $sxpData); $xml = new SimpleXMLElement($res); //echo "<pre>"; //print_r($xml); //echo "</pre>"; foreach ($xml->connections->children() as $conn) { echo "<tr>"; echo " <td>", $conn->{'peer-address'}, "</td>"; echo " <td>", $conn->description, "</td>"; echo " <td class=\"text-center\">", ucfirst($conn->mode), "</td>"; echo " <td class=\"text-center " . ($conn->state == 'on' ? 'bg-success text-success' : 'bg-danger text-danger') . "\"><strong>", ucfirst($conn->state), "</strong></td>"; echo " <td class=\"text-center\"><a href=\"?del=1&peer=", $conn->{'peer-address'}, "\"><span class=\"glyphicon glyphicon-remove\"></span></a></td>"; echo "</tr>"; } ?> </tbody>
<?php unset($iseHeaders); $iseHeaders = array(); $iseHeaders[] = 'Accept: application/vnd.com.cisco.ise.trustsec.sgt.1.0+xml'; $iseHeaders[] = 'Content-Type: application/xml'; $iseResponse = restCall("GET", "https://" . $ise_host . ":9060/ers/config/sgt", $ise_auth, $iseHeaders, 9060); $xml = new SimpleXMLElement($iseResponse); ?> <label for="exampleInputPassword1">Select Cisco SGT</label> <select name="sgt-tag-id" class="form-control"> <?php foreach ($xml->resources->children() as $tag) { $iseHeaders = array(); $iseHeaders[] = 'Accept: application/vnd.com.cisco.ise.trustsec.sgt.1.0+xml'; $iseHeaders[] = 'Content-Type: application/xml'; $iseResponse = restCall("GET", $tag->link['href'], $ise_auth, $iseHeaders, 9060); $tagXML = new SimpleXMLElement($iseResponse); echo "<option value=\"", $tag['id'], "\">", $tag['name'], " (", $tagXML->value, ")</option>"; } ?> </select> </div> <input type="submit" name="add-mapping-submit" value="Add Mapping" class="btn btn-default" /> </form> </div> </div> </div> <div class="container" style="margin-bottom: 50px;">
<th>Security Group ID</th> <th>Misc</th> </tr> </tfoot> <tbody> <?php $getBindingsData = <<<EOD <input xmlns="urn:opendaylight:sxp:controller"> <requested-node>127.0.0.1</requested-node> </input> EOD; //echo "Query getting sent: <pre>", $getBindingsData, "</pre>"; $bindURL = "http://" . $odl_host . ":8181/restconf/operations/sxp-controller:get-node-bindings"; $odlHeaders = array("Accept: application/xml", "Content-Type: application/xml"); $res = restCall("POST", $bindURL, $odl_auth, $odlHeaders, 8181, $getBindingsData); //echo "<pre>CURL result: ", $res, "</pre>"; if ($res) { $xml = new SimpleXMLElement($res); // Display each mapping as row in summary table foreach ($xml as $mapping) { // Get remaining columns from SQL DB //$sql = "SELECT * FROM `cisco_nsx_bindings` WHERE "; //$res = $sqlConn->query($sql); //substr($string, 0, -3); echo <<<EOD <tr> <td>---</td> <td>{$mapping->sgt}</td> <td>{$mapping->{'ip-prefix'}}</td> <td>---</td>