beautypg.com

Creating a sample python client – Brocade Network Advisor REST API Guide (Supporting Network Advisor 12.3.0) User Manual

Page 26

background image

12

Brocade Network Advisor REST API Guide

53-1003160-01

Creating a sample Python client

2

portIndex: 34

areaId: 34

type: "U_PORT"

status: "DISABLED"

statusMessage: ""

lockedPortType: "U_PORT"

speed: "8"

speedsSupported: "1,2,4,8"

maxPortSpeed: 8

desiredCredits: 0

bufferAllocated: 0

estimatedDistance: 0

actualDistance: 0

longDistanceSetting: 0

remoteNodeWwn: ""

remotePortWwn: ""

licensed: false

swapped: false

trunked: false

trunkMaster: false

persistentlyDisabled: false

ficonSupported: true

blocked: false

prohibitPortNumbers: null

prohibitPortCount: 0

npivCapable: true

npivEnabled: true

fcFastWriteEnabled: false

islRrdyEnabled: false

rateLimitCapable: false

rateLimited: false

qosCapable: false

qosEnabled: false

fcrFabricId: 0

state: "OFFLINE"

occupied: false

masterPortNumber: -1

}

...

Creating a sample Python client

This section shows you how to create a sample Network Advisor REST API Python client. Python
version 3.3.3 for Windows (MSC v.1600 64 bit (AMD64)) is used for creating the client.

This sample client logs in to Network Advisor 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 file using you favorite Python editor.

2. Add the following code to the file and replace the example IP address 10.24.41.138 with the IP

address of your Network Advisor server.

import http.client

import json

# Create HTTPConnection object and connect to the server.