Monitoring, Management & Location Tracking

 View Only
last person joined: one year ago 

Articles relating to existing and legacy HPE Aruba Networking products and solutions including AirWave, Meridian Apps, ALE, Central / HPE Aruba Networking Central, and UXI / HPE Aruba Networking User Experience Insight

Example of accessing AMP APIs using Zend 

Jun 27, 2014 03:07 PM

This example uses the Zend Framework (framework.zend.com) to get data from ap_list.xml:

 

$baseUrl = "https://myampserver.domain.com";
$username = "myuser";
$password = "mypassword";

$client = new Zend_Http_Client();
$client->setCookieJar();
$client->setUri($baseUrl."/LOGIN");
$client->setParameterPost('credential_0',$username);
$client->setParameterPost('credential_1',$password);
// we are simply authenticating
$client->setParameterPost('destination',$baseUrl);
$response = $client->request('POST');

// Then we can go on and use other uri's for example getting an AP with
id of '123' in xml
// Just comment out the $arguments line if you want to grab all of them
$arguments = array('id' => 123);

$client->setUri($baseUrl."/ap_list.xml");

if(isset($arguments))
{
foreach($arguments as $arg => $value)
$client->setParameterGet($arg, $value);
}

$response = $client->request('GET');
$xml = new SimpleXMLElement($response->getBody());

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Related Entries and Links

No Related Resource entered.