Using The Rest Api - Dell FORCE10 Open Automation Configuration

Open automation guide
Table of Contents

Advertisement

#!/usr/bin/perl
require LWP::UserAgent;
# Create new LWP object and set the timeout large because "F10Ping" will take a
# while to return results (5 pings each with 5 second timeout, plus GUI delay).
my $ua = LWP::UserAgent->new;
$ua->timeout(300);
#Send HTTP GET request message and store response data
my $response = $ua->get('http://10.43.3.55/cgi-bin/F10Ping?IpAddress=10.43.0.1');
#Display response texts on success or display status
if ($response->is_success) {
print $response->decoded_content;
}
else {
die $response->status_line;
}
70
|
Programmatic Management

Using the REST API

The script-based REST API allows you to remotely access a switch that supports
Open Automation from a network management device through programmatic HTTP
requests to directly perform FTOS functions.
The REST API operates by invoking the CGI scripts within the HTTP server on the
switch. The HTTP server passes an HTTP request to the backend CGI scripts. For
more information on the HTTP server, see
The CGI scripts are shared with the Web GUI to retrieve data through the FTOS CLI.
The CGI script functions are stored on the switch under the main Web GUI directory
at /htdocs/cgi-bin.
Note: In Open Automation 2.0, the REST API supports only CGI scripts that perform
HTTP read (get) requests. HTTP write (post) requests that make configuration
changes will be supported in future releases.
All REST-based API calls return plain text output.
Prerequisites: You must know the IP address of the switch to which you want to
connect and there must be network connectivity from your remote device to the
switch.
Table 7-1
describes the CGI scripts supported in an HTTP get request to access the
REST API and return data from a remote Dell Force10 switch.
The following example shows how to embed a REST-based HTTP get request in a
Perl script run from a remote device.
Figure 7-1. Perl Sample with HTTP Get Request that Invokes the REST API
HTTP
Server.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Force10

Table of Contents