Dell FORCE10 Open Automation Configuration page 71

Open automation guide
Table of Contents

Advertisement

Figure 7-2. Python Sample with HTTP Get Request that Invokes the REST API
#!/usr/bin/python
import httplib
conn = httplib.HTTPConnection("10.42.51.5")
# Send HTTP GET request
conn.request("GET","/cgi-bin/F10Ping?IpAddress=10.42.0.13")
# Get response data
response = conn.getresponse()
# Display response texts on success or display status
if(response.status == 200):
# Handle response data
data = response.read()
print data
else :
# Handle error
print "Operation failed",response.status,response.reason
conn.close()
The following example shows how to embed an HTTP get request in Python script.
Programmatic Management | 71

Advertisement

Table of Contents
loading

This manual is also suitable for:

Force10

Table of Contents