Broadcom Brocade Network Advisor REST API, 14.4.2 User guide

Category
Software
Type
User guide
Supporting Brocade Network Advisor 14.4.2
API REFERENCE GUIDE
Brocade Network Advisor REST API Guide,
14.4.2
53-1005402-01
06 April 2018
Copyright
©
2018 Brocade Communications Systems LLC. All Rights Reserved. Brocade and the stylized B logo are among the trademarks of Brocade
Communications Systems LLC. Broadcom, the pulse logo, and Connecting everything are among the trademarks of Broadcom. The term "Broadcom"
refers to Broadcom Inc. and/or its subsidiaries.
Brocade, a Broadcom Inc. Company, reserves the right to make changes without further notice to any products or data herein to improve reliability,
function, or design. Information furnished by Brocade is believed to be accurate and reliable. However, Brocade does not assume any liability arising out of
the application or use of this information, nor the application or use of any product or circuit described herein, neither does it convey any license under its
patent rights nor the rights of others.
The product described by this document may contain open source software covered by the GNU General Public License or other open source license
agreements. To nd out which open source software is included in Brocade products, view the licensing terms applicable to the open source software, and
obtain a copy of the programming source code, please visit http://www.broadcom.com/support/bre-channel-networking/tools/oscd.
Brocade Network Advisor REST API Guide, 14.4.2
2 53-1005402-01
Contents
Overview of the Brocade Network Advisor REST API................................................................................................................................................7
Introduction to the Management application REST API............................................................................................................................................................7
Management application URIs............................................................................................................................................................................................................. 8
Protocol and edition support.................................................................................................................................................................................................................8
Default HTTPS port (443)............................................................................................................................................................................................................8
Non-default HTTPS port.............................................................................................................................................................................................................. 8
Edition support...................................................................................................................................................................................................................................8
Getting Started..................................................................................................................................................................................................................11
Introduction................................................................................................................................................................................................................................................11
Before you begin.....................................................................................................................................................................................................................................11
Logging in.................................................................................................................................................................................................................................................. 11
Login URI................................................................................................................................................................................................................................................... 12
Login request headers.................................................................................................................................................................................................................13
Login response header................................................................................................................................................................................................................13
Logging out............................................................................................................................................................................................................................................... 13
Logout request header................................................................................................................................................................................................................ 13
Python client..............................................................................................................................................................................................................................................13
Python code example for fabric discovery..........................................................................................................................................................................20
Python code example to retrieve FC ports......................................................................................................................................................................... 23
Python code example to get the list of the last 15 Syslog events from a specic switch.............................................................................. 33
Python code example to get the last 15 trap events......................................................................................................................................................38
Python code example to list the current contents of the Zoning DB.......................................................................................................................43
Python code example for adding zoning objects to CFG (zoneset).........................................................................................................................46
Python code example for deleting zoning objects...........................................................................................................................................................56
Python code example for performance statistics and other metrics........................................................................................................................66
Using the Management Application REST API..........................................................................................................................................................71
Retrieving resource groups................................................................................................................................................................................................................. 71
Retrieving FC fabrics............................................................................................................................................................................................................................. 72
Retrieving a specic FC fabric...........................................................................................................................................................................................................73
Retrieving switches in the context of a fabric...............................................................................................................................................................................74
Retrieving switches and ports............................................................................................................................................................................................................ 76
Specifying the content type................................................................................................................................................................................................................ 77
Accept HTTP request header...................................................................................................................................................................................................77
Content-type HTTP request header......................................................................................................................................................................................78
Enabling or disabling FC switch ports............................................................................................................................................................................................78
Port persistent enable or persistent disable operation............................................................................................................................................................ 81
Setting switch port names...................................................................................................................................................................................................................83
Setting switch port speed.................................................................................................................................................................................................................... 85
Read Diagnostics Parameters (RDP) metrics support............................................................................................................................................................ 88
Versioning (backward compatibility)................................................................................................................................................................................................ 97
Using the Topology API....................................................................................................................................................................................................................... 97
Using the SAN Fabric Discovery API............................................................................................................................................................................................. 98
Notes About the SAN Fabric Discovery API URIs.......................................................................................................................................................... 98
Limitations for the SAN Fabric Discovery API.................................................................................................................................................................. 99
Using the Traî„»c Flow API...................................................................................................................................................................................................................99
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 3
Using the Summary Data API........................................................................................................................................................................................................... 99
Using the Events API..........................................................................................................................................................................................................................100
Using the Zoning API.........................................................................................................................................................................................................................100
Zoning URIs..................................................................................................................................................................................................................................101
Zoning operations...................................................................................................................................................................................................................... 101
Using the Historical Performance Data API..............................................................................................................................................................................101
Using the Real Time Performance Statistics API................................................................................................................................................................... 101
Using the Search API......................................................................................................................................................................................................................... 102
Search responses....................................................................................................................................................................................................................... 103
Search rules and regulations..................................................................................................................................................................................................104
FC fabric search rules............................................................................................................................................................................................................... 106
FC switch search rules..............................................................................................................................................................................................................106
Physical switch search rules...................................................................................................................................................................................................107
FC port search rules.................................................................................................................................................................................................................. 108
End device search rules........................................................................................................................................................................................................... 109
F_Port trunking and connected ports.................................................................................................................................................................................110
MAPS........................................................................................................................................................................................................................................................111
MAPS policies..............................................................................................................................................................................................................................111
MAPS rules................................................................................................................................................................................................................................... 112
MAPS groups...............................................................................................................................................................................................................................114
MAPS error codes......................................................................................................................................................................................................................115
Fibre Channel Routing....................................................................................................................................................................................................................... 115
Handling errors......................................................................................................................................................................................................................................116
URI error return behavior.................................................................................................................................................................................................................. 121
Use Cases........................................................................................................................................................................................................................123
Login and logout.................................................................................................................................................................................................................................. 123
Login request Java code sample......................................................................................................................................................................................... 123
Login response JSON code sample.................................................................................................................................................................................. 124
Login response XML code sample.....................................................................................................................................................................................124
Login error response sample.................................................................................................................................................................................................124
Logout request Python code sample.................................................................................................................................................................................125
Logout request Java code sample...................................................................................................................................................................................... 125
Zoning.......................................................................................................................................................................................................................................................126
Sample request payload.......................................................................................................................................................................................................... 126
Sample Java code for performing the attach operation............................................................................................................................................. 126
Sample JSON responses........................................................................................................................................................................................................127
Getting trac ow performance data.......................................................................................................................................................................................... 128
Sample Java code for retrieving ow information.........................................................................................................................................................128
Sample JSON response..........................................................................................................................................................................................................129
Retrieving performance data for the Transmit Frame Rate measure....................................................................................................................130
Sample Java code...................................................................................................................................................................................................................... 130
Sample JSON response..........................................................................................................................................................................................................130
Getting the top N CRC errors port summary...........................................................................................................................................................................131
SAN fabric discovery..........................................................................................................................................................................................................................132
Discovering an FC fabric.........................................................................................................................................................................................................132
Deleting an FC fabric................................................................................................................................................................................................................ 134
Binding the schema............................................................................................................................................................................................................................135
API Reference.................................................................................................................................................................................................................137
Topology..................................................................................................................................................................................................................................................137
Brocade Network Advisor REST API Guide, 14.4.2
4 53-1005402-01
ResourceGroups......................................................................................................................................................................................................................... 138
Fabrics.............................................................................................................................................................................................................................................140
FC Switch.......................................................................................................................................................................................................................................143
PhysicalSwitch............................................................................................................................................................................................................................. 145
Access Gateway.......................................................................................................................................................................................................................... 149
Blades..............................................................................................................................................................................................................................................151
FCPorts...........................................................................................................................................................................................................................................154
GigEPorts.......................................................................................................................................................................................................................................161
Connected-switch ports...........................................................................................................................................................................................................163
End-device ports........................................................................................................................................................................................................................ 165
Trunks.............................................................................................................................................................................................................................................. 167
ISL Connections..........................................................................................................................................................................................................................169
IFL Connections..........................................................................................................................................................................................................................171
EndDeviceConnection..............................................................................................................................................................................................................173
Access Gateway connection.................................................................................................................................................................................................. 175
End devices...................................................................................................................................................................................................................................177
SAN fabric discovery..........................................................................................................................................................................................................................179
Fabric discovery.......................................................................................................................................................................................................................... 180
Fabric deletion..............................................................................................................................................................................................................................184
Switch credentials update........................................................................................................................................................................................................185
Summary data.......................................................................................................................................................................................................................................187
Status summary..........................................................................................................................................................................................................................188
Asset classication summary................................................................................................................................................................................................190
Network object count summary........................................................................................................................................................................................... 194
Events summary.........................................................................................................................................................................................................................195
Bottleneck violations summary............................................................................................................................................................................................ 197
Port health violations summary............................................................................................................................................................................................200
VM violations summary...........................................................................................................................................................................................................202
Port summaries...........................................................................................................................................................................................................................204
Product summaries................................................................................................................................................................................................................... 217
Trac ow summaries..............................................................................................................................................................................................................223
SummaryResponse................................................................................................................................................................................................................... 228
Events....................................................................................................................................................................................................................................................... 228
Event retrieval............................................................................................................................................................................................................................... 229
Event count....................................................................................................................................................................................................................................231
Event acknowledgement......................................................................................................................................................................................................... 232
EventsResponse......................................................................................................................................................................................................................... 233
Syslog and Traps forwarding..................................................................................................................................................................................................235
Zoning.......................................................................................................................................................................................................................................................237
Zone DBs.......................................................................................................................................................................................................................................238
Zones ..............................................................................................................................................................................................................................................240
Zone aliases .................................................................................................................................................................................................................................242
Renaming alias using REST API .........................................................................................................................................................................................244
Zone sets ...................................................................................................................................................................................................................................... 245
Zone transactions....................................................................................................................................................................................................................... 247
Zone transaction management ............................................................................................................................................................................................248
Zoning object creation .............................................................................................................................................................................................................250
Zoning object deletion..............................................................................................................................................................................................................252
Zoning object updating ........................................................................................................................................................................................................... 253
Zone set activation ....................................................................................................................................................................................................................255
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 5
Initiator target zoning ................................................................................................................................................................................................................256
Peer Zones.................................................................................................................................................................................................................................... 257
Target Driven Zone support................................................................................................................................................................................................... 263
Historical performance data............................................................................................................................................................................................................ 267
Port-related performance data URIs.................................................................................................................................................................................. 267
Product-related performance data URIs...........................................................................................................................................................................272
Trac ow-related performance data URIs.....................................................................................................................................................................273
PerformanceDataResponse...................................................................................................................................................................................................276
Authentication and session management................................................................................................................................................................................. 277
Login................................................................................................................................................................................................................................................ 278
Logout............................................................................................................................................................................................................................................. 279
LoginResponse............................................................................................................................................................................................................................279
Brocade Network Advisor REST API Guide, 14.4.2
6 53-1005402-01
Overview of the Brocade Network Advisor
REST API
• Introduction to the Management application REST API...................................................................................................................... 7
• Management application URIs........................................................................................................................................................................8
• Protocol and edition support............................................................................................................................................................................8
Introduction to the Management application REST
API
The Management application REST API provides you with a web-services interface for conguring and monitoring Brocade switches.
The REST APIs are organized into various services such as Topology, Authentication, and Zoning.
You can use the Management application REST API to build your own Management application clients. You can also use third-party
REST API clients to interact with the Management application.
FIGURE 1 Architectural overview
The Management application REST API provides GET and POST uniform resource identiers (URIs) that you can use to retrieve
information and perform certain management and conguration tasks.
NOTE
This release of the Management application REST API supports only SAN fabrics.
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 7
Management application URIs
Management application URIs consists of two parts:
• Base URI: The base URI is specic to the Management application server. All URIs accessing the same server use the same
base URI.
• Request URI: The request URI is the URI that you use to perform a GET or POST request. This part of the URI is the same
across all Management application servers.
All REST operations are provided at the following base context path.
http://<Network Advisor Server IP>/rest/
The following are examples of Management application URIs (the text in bold is the base URI part, and the remainder is the request part):
• POST URI examples:
– http://10.24.48.103/rest/resourcegroups/All/fcfabrics/10:00:00:05:1E:90:52:07/createzoningobject
– http://10.24.48.103/rest/resourcegroups/All/fcfabrics/10:00:00:05:1E:90:52:07/deletezoningobject
– http://10.24.48.103/rest/resourcegroups/All/fcfabrics/10:00:00:05:1E:90:52:07/updatezoningobject
– http://10.24.48.103/rest/resourcegroups/All/fcfabrics/10:00:00:05:1E:90:52:07/activatezoneset
• GET URI examples:
– http://10.24.48.103/rest/resourcegroups
– http://10.24.48.103/rest/resourcegroups/All/fcfabrics
NOTE
URIs are case-sensitive.
Protocol and edition support
All REST HTTP requests are redirected to the HTTPS port. By default, the HTTPS port number is 443. However, this port can be
changed during the installation of Management application or after installation through the server management console.
Default HTTPS port (443)
If the HTTPS port is 443 (default), you can use the HTTP and HTTPS protocols as shown in the following two example URIs. In the
HTTP case, the request is redirected to HTTPS.
http://<Network Advisor Server IP>/rest/resourcegroups
https://<Network Advisor Server IP>/rest/resourcegroups
Non-default HTTPS port
If the HTTPS port is changed to a non-default value, the REST URI must specify HTTPS as the protocol and must also specify the port
number to send the requests to, as shown in the following example. If not, Management application refuses connection requests.
https://<Network Advisor Server IP>:<non-default_port_number>/rest/resourcegroups
Edition support
The following table lists the REST API support for the Management application editions.
Management application URIs
Brocade Network Advisor REST API Guide, 14.4.2
8 53-1005402-01
Management application edition REST API availability
Enterprise Yes
Professional Plus Yes
Professional No
Headless Yes
Protocol and edition support
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 9
Brocade Network Advisor REST API Guide, 14.4.2
10 53-1005402-01
Getting Started
• Introduction.......................................................................................................................................................................................................... 11
• Before you begin................................................................................................................................................................................................11
• Logging in.............................................................................................................................................................................................................11
• Login URI..............................................................................................................................................................................................................12
• Logging out..........................................................................................................................................................................................................13
• Python client........................................................................................................................................................................................................ 13
Introduction
This chapter describes how to use the Management application REST API by logging in and performing a few basic information retrieval
operations. In addition, this chapter shows you how to build a sample client application using the Python programming language.
Before you begin
This chapter assumes that you are familiar with the concept of REST APIs.
Before you can use the Management application REST API:
• Make sure that version 14.0.1 or later is installed on your network.
• Obtain a user name and password for accessing Management application through the REST API.
• Make sure that you have a tool for interacting with REST APIs.
The Advanced REST Console application is used in this chapter, but you can use any other REST API tool.
Logging in
The Management application REST API provides URIs for logging in and out.
To log in to Management application, complete the following steps.
1. Enter the following URI in the URL
eld of your REST client tool.
http://<ip_address>/rest/login
2. Dene the following HTTP request headers.
Header name Value
WSUsername
The user name supplied by your management application administrator.
WSPassword
The password supplied by your Management application administrator.
Accept
The content type of the returned data.
Specify the following content type to receive the response data in JSON format:
application/vnd.brocade.networkadvisor+json;version=v1
If you prefer XML format, enter the following value:
application/vnd.brocade.networkadvisor+xml;version=v1
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 11
3. Set the HTTP request method to POST.
4. Send the request. The following is an example of login request headers sent to Management application:
Request headers
Accept: application/vnd.brocade.networkadvisor+json;version=v1
WSUsername: Administrator
Origin: chrome-extension://hgmloofddffdnphfgcellkdfbfbjeloo
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,
like Gecko) Chrome/32.0.1700.102 Safari/537.36
WSPassword: password
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
NOTE
If the request is successful, Management application creates a new client session and returns, in the response headers,
the token WStoken, which identies the session.
The following is an example of the output of a successful request:
Status
200 OK Show explanation Loading time: 5592
Response headers
Via: 1.1 Secure Proxy
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Transfer-Encoding: chunked
Date: Mon, 03 Feb 2014 06:01:39 GMT
Content-Type: application/vnd.brocade.networkadvisor+json;version="v1"
Server: Apache-Coyote/1.1
WStoken: ghe/4Q//I0EJcxD6UPdO9/fvI94=
Raw
JSON
The JSON content of the response should look like the following:
{
serverName: "DCM-x3650-103"
serverIp: "10.24.48.103"
}
This response returns the name of the Management application and its IP address.
NOTE
Dierent tools may display the JSON or XML responses
dierently.
5. Record the value of the WStoken response header.
In this example, the value of the WStoken eld is ghe/4Q//I0EJcxD6UPdO9/fvI94=. You need this token for all subsequent
Management application REST API requests.
NOTE
A client session has a default idle timeout of 10 minutes, after which the token is no longer valid. If you try to use an
invalid token, an error message is returned: errorCode=4009, errorMsg=Invalid token in header.
Login URI
Use the /login POST URI to log in. This URI returns the Management application server credentials in a LoginResponse.
Login URI
Brocade Network Advisor REST API Guide, 14.4.2
12 53-1005402-01
<BASE_URI>/login
Login request headers
A valid user name and password are required for login, and this information is sent through the HTTP request headers. You must add the
headers while forming the HTTP POST request.
The following are the header names and values. The password must be passed in as cleartext.
TABLE 1 Login request headers
Request header name Request header value
Accept
The content type.
WSusername
The valid Management application user name.
WSpassword
The password.
Login response header
Upon successful authentication, a new client session is created and a token is returned through the HTTP response header. The token
identies the client’s Management application session and must be used for all subsequent web service requests. The token expires after
10 minutes of no activity.
TABLE 2 Login response header
Response header name Response header value
WStoken
The token.
Logging out
Use the /logout POST URI to log out. Successful completion of the request results in the deletion of the client session. The logout
request does not require any request payload except for the session token, which must be passed in an HTTP header parameter.
Because there is no return value to this request, an HTTP status code of 204 (No Content) is returned upon success.
<BASE_URI>/logout
Logout request header
A valid token is required for logout, and this information is sent through the HTTP request header. You must add the header while
forming the HTTP POST request.
TABLE 3 Logout request header
Request header name Request header value
WStoken
The token obtained from login.
Python client
Python client explains how to create a sample Management application REST API Python client. Python version 3.3.3 for Windows
(MSC v.1600 64 bit (AMD64)) is used for creating the client.
Python client
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 13
This sample client logs in to Management application and uses the returned session token to retrieve a list of all FC fabrics.
To create a sample client using the Python programming language, complete the following steps.
1. Create a new le using your favorite Python editor.
Python client
Brocade Network Advisor REST API Guide, 14.4.2
14 53-1005402-01
2. Add the following code to the le, and replace the example IP address 10.24.41.138 with the IP address of your Management
application server.
import http.client
import json
# Create HTTPConnection object and connect to the server.
connection = http.client.HTTPConnection("10.24.41.138")
###########################
# Log in to Network Advisor
###########################
# Send login requrest
connection.request('POST', 'http://10.24.41.138/rest/login',
headers={"WSUsername":"Administrator",
"WSPassword":"password",
"Accept":"application/vnd.brocade.networkadvisor+json;version=v1"})
print()
print("Sending login request to Network Advisor...")
# Get the response
response = connection.getresponse()
# Display the response status
print()
print ("Status= ", response.status)
# If successful (status = 200), display the returned Network Advisor session
token
if response.status == 200:
WStoken = response.getheader('WStoken')
print()
print("Login successful!")
print("WStoken: ", WStoken)
else:
print()
print (response.status, response.reason)
connection.close()
###########################
# Retrieve fabrics
###########################
# Send GET requrest
connection.connect()
connection.request('GET',
'http://10.24.41.138/rest/resourcegroups/All/fcfabrics',
headers={"WStoken":WStoken,
"Accept":"application/vnd.brocade.networkadvisor+json;version=v1"})
print()
print("--------------------------------------------------------------------")
print("Getting list of all fabrics...")
# Get the response
response = connection.getresponse()
# Display the response status
print()
print ("Status= ", response.status)
# If successful (status = 200), display the returned list in JSON format
if response.status == 200:
print()
print("List of fabrics:")
json_response_bytes = response.read()
json_response_string = str(json_response_bytes, encoding='utf8')
list_of_fabrics_dict=json.loads(json_response_string)
print(json.dumps(list_of_fabrics_dict, indent=4))
print("Number of FC fabrics: ", len(list_of_fabrics_dict["fcFabrics"]))
else:
print()
print (response.status, response.reason)
connection.close()
##############################
# Retrieve details of a fabric
##############################
# Get the key of the first fabric in the list
fabric_key = list_of_fabrics_dict["fcFabrics"][0]["key"]
# Send GET requrest
connection.connect()
connection.request('GET',
Python client
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 15
'http://10.24.41.138/rest/resourcegroups/All/fcfabrics/'+fabric_key,
headers={"WStoken":WStoken,
"Accept":"application/vnd.brocade.networkadvisor+json;version=v1"})
print()
print("--------------------------------------------------------------------")
print("Get fabric '+fabric_key+'details...")
# Get the response
response = connection.getresponse()
# Display the response status
print()
print ("Status= ", response.status)
# If successful (status = 200), display the returned list in JSON format
if response.status == 200:
print()
print("Fabric details:")
json_response_bytes = response.read()
json_response_string = str(json_response_bytes, encoding='utf8')
fabric_details_dict=json.loads(json_response_string)
print(json.dumps(fabric_details_dict, indent=4))
else:
print()
print (response.status, response.reason)
connection.close()
######################################################
# Retrieve list of switches in the context of a fabric
######################################################
# Send GET requrest
connection.connect()
connection.request('GET',
'http://10.24.41.138/rest/resourcegroups/All/fcfabrics/'+fabric_key+'/fcswitc
hes',
headers={"WStoken":WStoken,
"Accept":"application/vnd.brocade.networkadvisor+json;version=v1"})
print()
print("--------------------------------------------------------------------")
print("Get the list of switches under fabric "+fabric_key+" ...")
# Get the response
response = connection.getresponse()
# Display the response status
print()
print ("Status= ", response.status)
# If successful (status = 200), display the returned list in JSON format
if response.status == 200:
print()
print("List of switches:")
json_response_bytes = response.read()
json_response_string = str(json_response_bytes, encoding='utf8')
list_of_fabric_switches_dict=json.loads(json_response_string)
print(json.dumps(list_of_fabric_switches_dict, indent=4))
else:
print()
print (response.status, response.reason)
connection.close()
3. Save the
le as my_na_client.py.
Python client
Brocade Network Advisor REST API Guide, 14.4.2
16 53-1005402-01
4. Run the program by entering the C:\Python33>python my_na_client.py command at the command prompt.
If successful, you should see output similar to the following:
Sending login request to Network Advisor...
Status= 200
Login successful!
WStoken: RPTZz0z5ayVkvqIuy7quIEbjap8=
-----------------------------------------------------------------------------
Getting list of all fabrics...
Status= 200
List of fabrics:
{
"fcFabrics": [
{
"seedSwitchWwn": "10:00:00:05:33:A6:B6:17",
"name": "10:00:00:05:33:A6:B6:17",
"secure": false,
"principalSwitchWwn": "10:00:00:05:33:A6:B6:17",
"fabricName": "****8G FABRIC FOR REST******",
"seedSwitchIpAddress": "10.24.33.191",
"virtualFabricId": -1,
"contact": null,
"key": "10:00:00:05:33:A6:B6:17",
"adEnvironment": false,
"description": null,
"location": null
},
{
"seedSwitchWwn": "10:00:00:05:1E:A7:1F:EB",
"name": "10:00:00:05:1E:A7:1F:EB",
"secure": false,
"principalSwitchWwn": "10:00:00:05:1E:A7:1F:EB",
"fabricName": "",
"seedSwitchIpAddress": "10.24.33.195",
"virtualFabricId": -1,
"contact": null,
"key": "10:00:00:05:1E:A7:1F:EB",
"adEnvironment": false,
"description": null,
"location": null
},
{
"seedSwitchWwn": "10:00:00:05:1E:DB:1E:1E",
"name": "10:00:00:05:1E:DB:1E:1E",
"secure": false,
"principalSwitchWwn": "10:00:00:05:1E:DB:1E:1E",
"fabricName": "",
"seedSwitchIpAddress": "10.24.33.193",
"virtualFabricId": -1,
"contact": null,
"key": "10:00:00:05:1E:DB:1E:1E",
"adEnvironment": false,
"description": null,
"location": null
}
]
}
Number of FC fabrics: 3
-----------------------------------------------------------------------------
Get fabric '+fabric_key+'details...
Status= 200
Fabric details:
{
"fcFabrics": [
{
"seedSwitchWwn": "10:00:00:05:33:A6:B6:17",
"name": "10:00:00:05:33:A6:B6:17",
"secure": false,
"principalSwitchWwn": "10:00:00:05:33:A6:B6:17",
"fabricName": "****8G FABRIC FOR REST******",
Python client
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 17
"seedSwitchIpAddress": "10.24.33.191",
"virtualFabricId": -1,
"contact": null,
"key": "10:00:00:05:33:A6:B6:17",
"adEnvironment": false,
"description": null,
"location": null
}
]
}
-----------------------------------------------------------------------------
Get the list of switches under fabric 10:00:00:05:33:A6:B6:17...
Status= 200
List of switches:
{
"fcSwitches": [
{
"statusReason": null,
"fcipLicensed": false,
"autoSnmpEnabled": true,
"state": "UNKNOWN",
"persistentDidEnabled": false,
"lfEnabled": false,
"fcipCapable": false,
"fcsRole": "None",
"maxFcipTunnels": -1,
"maxFcipCircuits": -1,
"wwn": "50:00:51:ED:B1:E5:EF:04",
"type": 41,
"fcrCapable": false,
"portBasedRoutingPresent": false,
"cryptoCapable": false,
"fmsMode": false,
"name": "fcr_xd_1_30",
"defaultLogicalSwitch": false,
"fcipCircuitCapable": false,
"baseSwitch": false,
"virtualFabricId": -1,
"adCapable": false,
"key": "50:00:51:ED:B1:E5:EF:04",
"operationalStatus": "UNKNOWN",
"role": "SUBORDINATE",
"domainId": 1,
"inOrderDeliveryCapable": false,
"dynamicLoadSharingCapable": false
},
{
"statusReason": null,
"fcipLicensed": false,
"autoSnmpEnabled": true,
"state": "UNKNOWN",
"persistentDidEnabled": false,
"lfEnabled": false,
"fcipCapable": false,
"fcsRole": "None",
"maxFcipTunnels": -1,
"maxFcipCircuits": -1,
"wwn": "50:00:51:ED:B1:E1:EE:14",
"type": 40,
"fcrCapable": false,
"portBasedRoutingPresent": false,
"cryptoCapable": false,
"fmsMode": false,
"name": "fcr_fd_160",
"defaultLogicalSwitch": false,
"fcipCircuitCapable": false,
"baseSwitch": false,
"virtualFabricId": -1,
"adCapable": false,
"key": "50:00:51:ED:B1:E1:EE:14",
"operationalStatus": "UNKNOWN",
"role": "SUBORDINATE",
Python client
Brocade Network Advisor REST API Guide, 14.4.2
18 53-1005402-01
"domainId": 160,
"inOrderDeliveryCapable": false,
"dynamicLoadSharingCapable": false
},
{
"statusReason": null,
"fcipLicensed": false,
"autoSnmpEnabled": true,
"state": "UNKNOWN",
"persistentDidEnabled": false,
"lfEnabled": false,
"fcipCapable": false,
"fcsRole": "None",
"maxFcipTunnels": -1,
"maxFcipCircuits": -1,
"wwn": "50:00:51:ED:B1:E5:EF:06",
"type": 41,
"fcrCapable": false,
"portBasedRoutingPresent": false,
"cryptoCapable": false,
"fmsMode": false,
"name": "fcr_xd_1_30",
"defaultLogicalSwitch": false,
"fcipCircuitCapable": false,
"baseSwitch": false,
"virtualFabricId": -1,
"adCapable": false,
"key": "50:00:51:ED:B1:E5:EF:06",
"operationalStatus": "UNKNOWN",
"role": "SUBORDINATE",
"domainId": 1,
"inOrderDeliveryCapable": false,
"dynamicLoadSharingCapable": false
},
{
"statusReason": "Switch Status is MARGINAL. Contributors:\n* Power
Supply: 1 bad. (MARGINAL).\n* Fan: 1 bad (MARGINAL).",
"fcipLicensed": false,
"autoSnmpEnabled": true,
"state": "ONLINE",
"persistentDidEnabled": false,
"lfEnabled": false,
"fcipCapable": false,
"fcsRole": "None",
"maxFcipTunnels": 0,
"maxFcipCircuits": 0,
"wwn": "10:00:00:14:C9:E5:56:AB",
"type": 133,
"fcrCapable": false,
"portBasedRoutingPresent": false,
"cryptoCapable": false,
"fmsMode": false,
"name": "REST_6520_33_189",
"defaultLogicalSwitch": true,
"fcipCircuitCapable": false,
"baseSwitch": false,
"virtualFabricId": -1,
"adCapable": true,
"key": "10:00:00:14:C9:E5:56:AB",
"operationalStatus": "MARGINAL",
"role": "SUBORDINATE",
"domainId": 2,
"inOrderDeliveryCapable": false,
"dynamicLoadSharingCapable": true
},
{
"statusReason": "Switch Status is HEALTHY.",
"fcipLicensed": false,
"autoSnmpEnabled": true,
"state": "ONLINE",
"persistentDidEnabled": false,
"lfEnabled": false,
Python client
Brocade Network Advisor REST API Guide, 14.4.2
53-1005402-01 19
"fcipCapable": false,
"fcsRole": "None",
"maxFcipTunnels": 0,
"maxFcipCircuits": 0,
"wwn": "10:00:00:05:33:A6:B6:17",
"type": 118,
"fcrCapable": false,"portBasedRoutingPresent": false,
"cryptoCapable": false,
"fmsMode": false,
"name": "REST_6505_33_191",
"defaultLogicalSwitch": true,
"fcipCircuitCapable": false,
"baseSwitch": false,
"virtualFabricId": -1,
"adCapable": true,
"key": "10:00:00:05:33:A6:B6:17",
"operationalStatus": "UNKNOWN",
"role": "PRINCIPAL",
"domainId": 191,
"inOrderDeliveryCapable": false,
"dynamicLoadSharingCapable": true
}
]
}
Python code example for fabric discovery
Following is the Python code example for fabric discovery and its output.
import http.client
import json
# Create HTTPConnection object and connect to the server.
connection = http.client.HTTPConnection(<BNA SERVER IP ADDRESS>)
###########################
# Log in to Network Advisor
###########################
# Send login request
connection.request('POST', 'http://<bnaserver>/rest/login',
headers={"WSUsername":"Administrator",
"WSPassword":"password",
"Accept":"application/vnd.brocade.networkadvisor+json;version=v1"})
print()
print("Sending login request to Network Advisor...")
# Get the response
response = connection.getresponse()
# Display the response status
print()
print ("Status= ", response.status)
# If successful (status = 200), display the returned Network Advisor session
token
if response.status == 200:
WStoken = response.getheader('WStoken')
print()
print("Login successful!")
print("WStoken: ", WStoken)
else:
print()
print (response.status, response.reason)
connection.close()
###########################
# Send Fabric Discovery request
###########################
# Send Fabric Discovery request
print()
print("--------------------------------------------------------------------")
print("Sending Fabric Discovery request with the following values:")
print(" IP Addres: <SWITCH IP ADDRESS>")
print(" Username: <SWITCH USERNAME>")
Python client
Brocade Network Advisor REST API Guide, 14.4.2
20 53-1005402-01
  • Page 1 1
  • Page 2 2
  • Page 3 3
  • Page 4 4
  • Page 5 5
  • Page 6 6
  • Page 7 7
  • Page 8 8
  • Page 9 9
  • Page 10 10
  • Page 11 11
  • Page 12 12
  • Page 13 13
  • Page 14 14
  • Page 15 15
  • Page 16 16
  • Page 17 17
  • Page 18 18
  • Page 19 19
  • Page 20 20
  • Page 21 21
  • Page 22 22
  • Page 23 23
  • Page 24 24
  • Page 25 25
  • Page 26 26
  • Page 27 27
  • Page 28 28
  • Page 29 29
  • Page 30 30
  • Page 31 31
  • Page 32 32
  • Page 33 33
  • Page 34 34
  • Page 35 35
  • Page 36 36
  • Page 37 37
  • Page 38 38
  • Page 39 39
  • Page 40 40
  • Page 41 41
  • Page 42 42
  • Page 43 43
  • Page 44 44
  • Page 45 45
  • Page 46 46
  • Page 47 47
  • Page 48 48
  • Page 49 49
  • Page 50 50
  • Page 51 51
  • Page 52 52
  • Page 53 53
  • Page 54 54
  • Page 55 55
  • Page 56 56
  • Page 57 57
  • Page 58 58
  • Page 59 59
  • Page 60 60
  • Page 61 61
  • Page 62 62
  • Page 63 63
  • Page 64 64
  • Page 65 65
  • Page 66 66
  • Page 67 67
  • Page 68 68
  • Page 69 69
  • Page 70 70
  • Page 71 71
  • Page 72 72
  • Page 73 73
  • Page 74 74
  • Page 75 75
  • Page 76 76
  • Page 77 77
  • Page 78 78
  • Page 79 79
  • Page 80 80
  • Page 81 81
  • Page 82 82
  • Page 83 83
  • Page 84 84
  • Page 85 85
  • Page 86 86
  • Page 87 87
  • Page 88 88
  • Page 89 89
  • Page 90 90
  • Page 91 91
  • Page 92 92
  • Page 93 93
  • Page 94 94
  • Page 95 95
  • Page 96 96
  • Page 97 97
  • Page 98 98
  • Page 99 99
  • Page 100 100
  • Page 101 101
  • Page 102 102
  • Page 103 103
  • Page 104 104
  • Page 105 105
  • Page 106 106
  • Page 107 107
  • Page 108 108
  • Page 109 109
  • Page 110 110
  • Page 111 111
  • Page 112 112
  • Page 113 113
  • Page 114 114
  • Page 115 115
  • Page 116 116
  • Page 117 117
  • Page 118 118
  • Page 119 119
  • Page 120 120
  • Page 121 121
  • Page 122 122
  • Page 123 123
  • Page 124 124
  • Page 125 125
  • Page 126 126
  • Page 127 127
  • Page 128 128
  • Page 129 129
  • Page 130 130
  • Page 131 131
  • Page 132 132
  • Page 133 133
  • Page 134 134
  • Page 135 135
  • Page 136 136
  • Page 137 137
  • Page 138 138
  • Page 139 139
  • Page 140 140
  • Page 141 141
  • Page 142 142
  • Page 143 143
  • Page 144 144
  • Page 145 145
  • Page 146 146
  • Page 147 147
  • Page 148 148
  • Page 149 149
  • Page 150 150
  • Page 151 151
  • Page 152 152
  • Page 153 153
  • Page 154 154
  • Page 155 155
  • Page 156 156
  • Page 157 157
  • Page 158 158
  • Page 159 159
  • Page 160 160
  • Page 161 161
  • Page 162 162
  • Page 163 163
  • Page 164 164
  • Page 165 165
  • Page 166 166
  • Page 167 167
  • Page 168 168
  • Page 169 169
  • Page 170 170
  • Page 171 171
  • Page 172 172
  • Page 173 173
  • Page 174 174
  • Page 175 175
  • Page 176 176
  • Page 177 177
  • Page 178 178
  • Page 179 179
  • Page 180 180
  • Page 181 181
  • Page 182 182
  • Page 183 183
  • Page 184 184
  • Page 185 185
  • Page 186 186
  • Page 187 187
  • Page 188 188
  • Page 189 189
  • Page 190 190
  • Page 191 191
  • Page 192 192
  • Page 193 193
  • Page 194 194
  • Page 195 195
  • Page 196 196
  • Page 197 197
  • Page 198 198
  • Page 199 199
  • Page 200 200
  • Page 201 201
  • Page 202 202
  • Page 203 203
  • Page 204 204
  • Page 205 205
  • Page 206 206
  • Page 207 207
  • Page 208 208
  • Page 209 209
  • Page 210 210
  • Page 211 211
  • Page 212 212
  • Page 213 213
  • Page 214 214
  • Page 215 215
  • Page 216 216
  • Page 217 217
  • Page 218 218
  • Page 219 219
  • Page 220 220
  • Page 221 221
  • Page 222 222
  • Page 223 223
  • Page 224 224
  • Page 225 225
  • Page 226 226
  • Page 227 227
  • Page 228 228
  • Page 229 229
  • Page 230 230
  • Page 231 231
  • Page 232 232
  • Page 233 233
  • Page 234 234
  • Page 235 235
  • Page 236 236
  • Page 237 237
  • Page 238 238
  • Page 239 239
  • Page 240 240
  • Page 241 241
  • Page 242 242
  • Page 243 243
  • Page 244 244
  • Page 245 245
  • Page 246 246
  • Page 247 247
  • Page 248 248
  • Page 249 249
  • Page 250 250
  • Page 251 251
  • Page 252 252
  • Page 253 253
  • Page 254 254
  • Page 255 255
  • Page 256 256
  • Page 257 257
  • Page 258 258
  • Page 259 259
  • Page 260 260
  • Page 261 261
  • Page 262 262
  • Page 263 263
  • Page 264 264
  • Page 265 265
  • Page 266 266
  • Page 267 267
  • Page 268 268
  • Page 269 269
  • Page 270 270
  • Page 271 271
  • Page 272 272
  • Page 273 273
  • Page 274 274
  • Page 275 275
  • Page 276 276
  • Page 277 277
  • Page 278 278
  • Page 279 279

Broadcom Brocade Network Advisor REST API, 14.4.2 User guide

Category
Software
Type
User guide

Ask a question and I''ll find the answer in the document

Finding information in a document is now easier with AI