(Supporting Network Advisor 12.3.0)
Table Of Contents
- Contents
- About This Document
- Overview of the Network Advisor REST API
- Getting Started
- Using the Brocade Network Advisor REST API
- Introduction
- Logging in and out
- Specifying content type
- Versioning (backward compatibility)
- Using the Topology API
- Using the SAN Fabric Discovery API
- Using the Traffic Flow API
- Using the Summary Data API
- Using the Events API
- Using the Zoning API
- Using the Historical Performance Data API
- Fibre Channel Routing
- Handling errors
- Use Cases
- API Reference
- Request and Response Schemas
- Topology
- SAN fabric discovery
- Summary data
- SummaryResponse
- StatusSummary
- AssetClassificationSummary
- NetworkObjectCountSummary
- EventsSummary
- BottleneckViolationsSummary
- OutOfRangeViolationsSummary
- PortHealthViolationsSummary
- VmViolationsSummary
- SummariesResponse
- PortsMonitorSummaryData
- MonitorDistributionData
- ProductsMonitorSummaryData
- FlowMonitorSummaryData
- Events
- Zoning
- Historical performance data
- Authentication and session management

Brocade Network Advisor REST API Guide 25
53-1003160-01
Specifying content type
3
Logout request headers
A valid token is required for logout and this is sent through the HTTP request header. You must add
the header while forming the HTTP POST request.
Sample logout request (Python)
The following is an example of an HTTP POST request for logout sent using Python.
HttpClient hc = new HttpClient();
method = new PostMethod("http://10.24.48.103/rest/logout");
method.addRequestHeader("WStoken", token);
Sample logout request (Java)
The following is sample Java code for terminating a REST API session with Network Advisor.
HttpURLConnection con = null;
try {
/**
* Create the HTTP connection object with the URI, method and headers
*/
URL obj = new URL("http://10.24.48.103/rest/logout");
con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.addRequestProperty("WStoken", "wppCy/NGdC4o5gGFJjXRMv7blhc=");
System.out.println("CALLING POST http://10.24.48.103/rest/logout");
/**
* Make the HTTP call
*/
int responseCode = con.getResponseCode();
System.out.println("Response code is " + responseCode);
if (HttpURLConnection.HTTP_NO_CONTENT != responseCode) {
PRINT_ERROR(con);
assert false : "REST FAILED for logout, responseCode = " + responseCode;
}
} catch (IOException ie) {
System.out.println(ie.toString());
} finally {
if (null != con) {
con.disconnect();
}
}
Specifying content type
All Brocade Network Advisor REST API requests that return data support both XML and JSON
formats. Depending on the content type you request, the proper data format is returned.
TABLE 7 Logout request headers
Request header name Request header value
WStoken The token obtained from login