Anda di halaman 1dari 19

BRKDEV-1221

14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 1

Cisco Nexus
Application Programmatic
Interfaces

BRKDEV-1221

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 2

© 2006, Cisco Systems, Inc. All rights reserved. 1


Presentation_ID.scr
Agenda

ƒ Why a Programmable Interface?


ƒ NX-OS API
ƒ DCNM API
ƒ When and How to Leverage

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 3

Why a Programmable
Interface?

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 4

© 2006, Cisco Systems, Inc. All rights reserved. 2


Presentation_ID.scr
Problem Statement
CLI SNMP

Interface Command line help and ASN.1 MIB description


Description tech pubs

Interface Type Proprietary Standard


Data Format Not structured Structured (flat)
Mgmt Protocol None SNMP Operations
Advantages Widely deployed • Deterministic
• Widely deployed
Drawback • Unpredictible (Cli cds • Tedious/cumbersome implementation;
can change between OS difficult to extend (binary protocol);
releases and cli parser SNMP write unpopular and most
must adapt) applications do read only
• Tedious parsing • RFC for MIBs delayed by years after
(screen scraping) protocol availability
• SNMP/UDP can loose packets
• 32 bit counter, ifIndex persistence

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 5

Programmable Interface
Need for a Mechanism That Allows Semantics
Third Parties to Gain Programmable
Access to Network Services in a
More Effective and Consistent Way My Application
Than CLI/SNMP
ƒ XML is a free open standard XML Client Application
ƒ XML opens up the functionality on
the device
ƒ XML is simple and extensible Libraries
new applications can be built with a
short turnaround time
Syntax

applications can be easily sustained


(device and application are decoupled)

ƒ XML tools and technologies exist


with support in market place
ƒ XML developer
community growing
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 6

© 2006, Cisco Systems, Inc. All rights reserved. 3


Presentation_ID.scr
Netconf Operations
ƒ NetConf: standartized and straightforward API for applications to send and receive
configuration data sets
ƒ Uses XML based encoding for all communications with the devices
ƒ Uses SSH/TCP as transport mechanism
ƒ RFC4741—RFC4744 see http://www.ops.ietf.org/netconf/
RFC 4741: NETCONF Configuration Protocol
RFC 4742: Using the NETCONF Configuration Protocol over Secure Shell (SSH)
RFC 4743: Using NETCONF over the Simple Object Access Protocol (SOAP)
RFC 4744: Using the NETCONF Protocol over Blocks Extensible Exchange Protocol (BEEP)
ƒ NetConf Operations
ƒ get-config: retrieves all or part of a specified configuration.
ƒ edit-config: loads all or part of a specified configuration to the specified target configuration.
ƒ get: retrieves running configuration and device state information.
ƒ copy-config: creates or replaces an entire configuration datastore with the contents of another complete
configuration datastore.
ƒ delete-config: deletes a configuration datastore; the running configuration datastore cannot be deleted.
ƒ lock: allows the client to lock the configuration system of a device.
ƒ unlock: releases a configuration lock, previously obtained with the lock operation.
ƒ close-session: requests graceful termination of a NETCONF session.
ƒ kill-session: forces the termination of a NETCONF session.
ƒ commit: moves a candidate configuration to operational state
ƒ validate: checks a candidate configuration for syntactical and semantic errors before applying
BRKDEV-1221 the configuration 7
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public

SOAP/NetConf/XML
<note>
Benefits
<to>John</to>
An XML Message Example <from>Mary</from>
<heading>Reminder</heading>
<body>Don't forget the dry cleaning pick up!</body>
</note>
Technology Characteristic Customer Benefit
XML XML tags are written in clear text. It is reasonably simple for a person (software
XML documents are human engineer) to look at an XML document and
readable and self-describing. understand its purpose.
XML XML is interoperable, there is Creating an XML document can be done with a a
nothing about XML that ties it to simple text editor.
any particular operating system or Open source XML parsers are available. Several
underlying technology. types of XML parsers exist for virtually every
operating system in use today.
XML Tags can be created as needed. Changes to a document will not break the parser.
Tags can be added to data structures without
XML documents are hierarchical: it
breaking backward compatibility with earlier
is easy to add related data to an
versions of your application.
XML document.
NetConf/XML Defines standard operations Consistent and repeatable access to the device
SOAP/XML SOAP allows applications to Applications already developed in C, C++, Java,
(aka Web interoperate by exchanging XML Perl, .Net, CORBA etc can be SOAP/XML
Serices) message. enabled to communicate instead of being kept
in silos.
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 8

© 2006, Cisco Systems, Inc. All rights reserved. 4


Presentation_ID.scr
Cisco Nexus 7000

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 9

Nexus 7000 Platform Overview


Industry’s First Data Center Class Platform

Nexus 7000 and NX-OS


• 10 & 18 Slot versions
• 15+ Terabit System
Switch • Optimized for 10/40/100 Gbps
Family • Multi-protocol (E,FCoE and DCE)
• Modern, Modular OS
• Device Virtualization
• Continuous Operations
• Cisco TrustSec Enabled
• Operationally Focused Design

Supervisor 10G Ethernet 1G Ethernet 10G DCE


• 32 Port SFP+ 10G • 48 Port 1G-TX • 32 Port SFP+ 10G (future)
Linecard • 48 Port 1G-FX (future)
Modules
Cisco Data Center Network Manager

Cisco NX-OS Multi-protocol Operating System


Data Center Network Manager (DCNM)
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 10

© 2006, Cisco Systems, Inc. All rights reserved. 5


Presentation_ID.scr
NX-OS API

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 11

NX-OS NetConf/XML Capabilities


NMS
ƒ NetConf over SSH over TCP only
ƒ Needs to be explicitly enabled read
nx-os (config)# ssh server enable
Socket (rpc/ssh)

ƒ Maximum of 8 concurrent NetConf


sessions per Nexus Virtual
Device Context *.xsd
NX-
NX-OS
nx-os (config)# xml server
max-session 8 generate
nx-os (config)# show xml server status
Nexus
operational status is enabled
Command
maximum session configured is 8 Definition xmlAgt
(XML and cli) (Xml cmd parser)
ƒ All configuration-mode
commands supported
ƒ All exec-mode ‘show’
commands supported
CLI text output is not encapsulated in a
generic XML wrapper
XML is verbose … queries/second tbd
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 12

© 2006, Cisco Systems, Inc. All rights reserved. 6


Presentation_ID.scr
NetConf/XML Layers
<?xml version=”1.0”?>
<rpc message-id=”101” Å rpc layer
xmlns=”urn:ietf:params:xml:ns:netconf:base:1.0”>
<edit-config> Å operation layer
<target>
Content
<running/>
</target>
<config>
<xs:interface xmlns:xs=“http://www.cisco.com/SANOS/1.0/interface”>
<xs:mgmt> Operations
<xs:Naming> Å content layer
<xs:intf>0</intf>
</xs:Naming>
<xs:ip>
<xs:address> RPC
<xs:host>1.1.1.1</xs:host>
<xs:netmask>255.255.255.0</xs:netmask>
<xs:typeOfAddr>secondary</xs:typeOfAddr>
</xs:address>
</xs:ip> Application
</xs:mgmt> Protocol
</xs:interface>
</config>
</edit-config> Å operation layer
</rpc> Å rpc layer

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 13

NX-OS API Example

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 14

© 2006, Cisco Systems, Inc. All rights reserved. 7


Presentation_ID.scr
NX-OS API Example
ƒ Get Interface Configuration Request
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config>
<source>
<running/>
</source>
<filter type="subtree">
<xs:interface xmlns:xs=http://www.cisco.com/SANOS/1.0/int>
<xs:mgmt>
<xs:Naming>0</xs:Naming>
</xs:mgmt>
</interface>
</filter>
</get-config>
</rpc>
ƒ Get Interface Configuration Response
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<data>
<xs:interface xmlns:xs=http://www.cisco.com/SANOS/1.0/int>
<xs:mgmt>
<xs:Naming> 0 </ xs:Naming>
< xs:ip>
< xs:address>1.1.1.1</ xs:address>
< xs:netmask>255.0.0.0</ xs:netmask>
</ xs:ip>
< xs:mtu>222</ xs:mtu>

</xs:mgmt>
</xs:interface>
</data>
</rpc-reply>
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 15

DCNM API

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 16

© 2006, Cisco Systems, Inc. All rights reserved. 8


Presentation_ID.scr
Unlocking the Power of the
Nexus Network
ƒ Open application: bi-directional
Web Services API (SOAP/XML
and JMS)
ƒ Programmatic Interface Enterprise
Data Center Messaging
Mgmt
Extensibility Applications
Applications Middelware
Interoparability
Exception returns failure cause

ƒ Method descriptions are available XSD


WSDL
through Cisco.com and directly
from DCNM (XSD et WSDL)
ƒ Integration Opportunities
Web Services API
Automated provisioning
Configuration change management and
compliance management Data Center Network Manager
Cross-domain root cause analysis,
performance reporting, application flow
analysis, etc

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 17

DCNM Application
Programming Interface
ƒ Easy to use and extensive set of API published by server
ƒ Server supports Java RMI API and Web Services API
ƒ Single implementation for Java RMI and Web Services Interface.
The Web Services API is a reflection of the Java API
ƒ DCNM GUI uses published API; full functionality parity between
the GUI and the API
Web Services API Java API
SOA: Componentization of DCNM Services

Role Based Access Control & Licensing


Web Server
Physical Configuration Event
Discovery Engine Collection and
Correlation
Discovery for Transaction
L2/L3 Mgmt Traffic
Connectivity Network
Collection and
Model
Reporting
Service Auditing RDBMS
Topology Mgmt
Other System
Instrumentation Job Scheduler Mgmt Utilities

BRKDEV-1221
Transport Layer: XML, CLI over SSH
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 18

© 2006, Cisco Systems, Inc. All rights reserved. 9


Presentation_ID.scr
API—Life Cycle Operations (1/4)
ƒ Create Operation
This operation allows creating a new managed object in containment hierarchy
Example: createVlanInNetwork(OpContext opContext, List<InstanceNameId>
neInstanceNameIds, Integer vlanId, String vlanName)

ƒ Delete Operation
This operation allows deleting an existing managed object, it is the opposite of the create
operation
Example: deleteVlansInNetwork(OpContext opContext, IntegerRange vlanIds,
List<InstanceNameId> neInstanceNameIds)

ƒ Modify Operation
This operation allows modifying an existing managed object
Example: modifyVlans(OpContext opContext, List<VlanExternal> modifiedVlanCol)

ƒ Add Operation
This operation allows associating one or more managed objects to an existing
managed object
Example: addAllowedVlansOnTrunks(OpContext opContext, List<InstanceNameId>
portNameIds, IntegerRange vlanRange)
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 19

API—Life Cycle Operations (2/4)


ƒ Remove Operation
This operation allows disassociating one or more managed objects from an
existing managed object, it is the opposite of the add operation
Example: removeSourcesFromSpanSession(OpContext opContext,
InstanceNameId sessionNameId, List<InstanceNameId> srcNameIds)

ƒ Get Operation
This operation allows retrieving a single managed object or multiple managed
objects of the same type
Example: getVlans(OpContext opContext, List<InstanceNameId> vlanNameIds)

ƒ Get All Operation


This operation allows retrieving multiple managed objects of the
same type
Example: getAllInterfacesInNetworkElement(OpContext opContext,
InstanceNameId neInstanceNameId)

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 20

© 2006, Cisco Systems, Inc. All rights reserved. 10


Presentation_ID.scr
API—Life Cycle Operations (3/4)
ƒ Bind operation prefix
This operation allows binding one or more managed objects to an existing managed object.
Example: bindIpAclToNetworkInterfaces(OpContext opContext, InstanceNameId ipAclId,
List<InstanceNameId> networkInterfaceIds, AccessControlDirection direction)

ƒ Unbind operation prefix


This operation allows unbinding one or more managed objects from an existing
managed object
Example: unbindIpAclFromNetworkInterface(OpContext opContext, InstanceNameId
networkInterfaceId, AccessControlDirection direction)

ƒ Enable operation prefix


This operation allows enabling a service on one or more existing managed objects.
Example: enableDot1x(OpContext opContext, List<InstanceNameId>
neInstanceNameIdCol)

ƒ Disable operation prefix


This operation allows disabling a service on one or more existing managed objects.
Example: disableDot1x(OpContext opContext, List<InstanceNameId>
neInstanceNameIdCol)
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 21

API—Life Cycle Operations (4/4)


ƒ Start operation prefix
This operation allows starting/executing a service on one or more existing
managed objects
Example: startCollector(OpContext opContext, InstanceNameId collectionInfoId)

ƒ Stop operation prefix


This operation allows stopping/cancelling a service on one or more existing
managed objects
Example: stopCollector(OpContext opContext, InstanceNameId collectionInfoId)

ƒ Clear operation prefix


This operation allows clearing existing particular characteristics or statistics or
information of one or more existing managed objects
Example: clearRateLimitingConfigurationInInterface(OpContext opContext,
InstanceNameId interfaceName)

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 22

© 2006, Cisco Systems, Inc. All rights reserved. 11


Presentation_ID.scr
API Exceptions

ƒ Each operation may return exceptions to external


clients in case of improper usage of the API, error in the
server or device
ƒ Exception characteristics:
Contains an error code
Contains a message (cause of the problem)
Belongs to a class/type of exception
Maps to a corrective action

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 23

DCNM API Example

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 24

© 2006, Cisco Systems, Inc. All rights reserved. 12


Presentation_ID.scr
Client-Application Definition

ƒ Purpose: network performance monitoring


Program DCNM to collect traffic
Statistics collection starts on 07/02/2008 at 05:00:00 for 1 day
every minute:
input/output octets for interface 3/40 on device #1
all collision errors for interface 3/42 on device #2

ƒ Action: upload traffic statistics information


Collected data is uploaded as a CSV file

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 25

Collection Input

ƒ Collection Info
Name (Identifier)
Description
Collector Action (What to do with the collected data?)
Collector Status
Job Schedule (When to collect?)
Statistical Entries (What to collect?)

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 26

© 2006, Cisco Systems, Inc. All rights reserved. 13


Presentation_ID.scr
Job Schedule

ƒ 2 types of schedules
Periodical schedule: start time, end time, interval
StartTime = 07/02/2008 05:00:00
EndTime = 07/03/2008 05:00:00
Interval = 60 s
Cron schedule: complex expressions like
At 9:00am every Monday through Friday
At 2:30am every last Friday of the month
Interval

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 27

Statistical Entries

ƒ Statistical Entry
Config instance name
Statistical class

ƒ Example of Statistical Entries


Statistical Entry 1
configInstanceName =
networkInterface:neId=1,name=FastEthernet3/40
statisticalClass : InterfaceTrafficStatistics
Statistical Entry 2
configInstanceName :
networkInterface:neId=2,name=FastEthernet3/42
statisticalClass : PortErrorStatistics
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 28

© 2006, Cisco Systems, Inc. All rights reserved. 14


Presentation_ID.scr
When and How
to Leverage

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 29

Data Center Management (1)

IT Systems Device Aware Application

NetConf/XML Client

Device Level
Operations
NC/XML
NC/XML

SNMP
SNMP

CLI
CLI

Server
Storage
Nexus 7000 Nexus 7000
Network
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 30

© 2006, Cisco Systems, Inc. All rights reserved. 15


Presentation_ID.scr
Data Center Management—Integration Example (1)
Web Services API

IT Systems
NetConf/XML Client

Create PortChannel End Point A Create PortChannel End Point B


- create portchannel - create portchannel
- switch portchannel to trunk mode - switch portchannel to trunk mode
- add interface 1 to portchannel - add interface 1 to portchannel
- add interface 2 to portchannel - add interface 2 to portchannel
NC/XML

NC/XML
SNMP

SNMP
CLI
CLI

Server Storage
A B
Nexus 7000 Nexus 7000
Network
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 31

Data Center Management (2)

IT Systems Network Aware Application

Web Services Client

Network Level
Operations

Web Services API

DCNM
NetConf/XML Client
NC/XML
NC/XML

SNMP
SNMP

CLI
CLI

Server
Storage
Nexus 7000 Nexus 7000
Network
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 32

© 2006, Cisco Systems, Inc. All rights reserved. 16


Presentation_ID.scr
XML Requests to Create a PortChannel on the
Nexus 7000
1 - Create PortChannel
<configure> 2 - Switch PortChannel to Trunk Mode
<configure>
<__XML__MODE__exec_configure> 3 - Add Interface to PortChannel
<interface> <__XML__MODE__exec_configure>
<configure>
<port-channel> <interface> <__XML__MODE__exec_configure>
<interface>20</interface>
<port-channel> <interface>
<__XML__MODE_if-port-channel>
<interface>20</interface> <ethernet>
<switchport></switchport>
<__XML__MODE_if-port-channel><interface>9/6</interface>
</__XML__MODE_if-port-channel>
<switchport> <__XML__MODE_if-ethernet>
</port-channel> <mode> <__XML__MODE_if-ether-switch>
</interface> <__XML__BLK_Cmd_switchport_mode_ge_portchannel_port_mode>
<channel-group>
</__XML__MODE__exec_configure> <port_mode>trunk</port_mode> <channel-id>
</configure> </__XML__BLK_Cmd_switchport_mode_ge_portchannel_port_mode>
<__XML__PARAM_value>20</__XML__PARAM_value>
</mode> <__XML__OPT_Cmd_channel_group_id_mode_mode>
</switchport> <mode>
</__XML__MODE_if-port-channel> <__XML__BLK_Cmd_channel_group_id_mode_active>
</port-channel> <on></on>
</interface> </__XML__BLK_Cmd_channel_group_id_mode_active>
</__XML__MODE__exec_configure> </mode>
</configure> </__XML__OPT_Cmd_channel_group_id_mode_mode>
</channel-id>
</channel-group>
</__XML__MODE_if-ether-switch>
</__XML__MODE_if-ethernet>
</ethernet>
</interface>
</__XML__MODE__exec_configure>
</configure>
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 33

Data Center Management—Integration Example (2)


Web Services API

IT Systems
Web Services Client

Create PortChannel (Endpoints, Interfaces, Load-sharing algorithm, etc)

Web Services API

DCNM
DCNM generates the XML
requests on behalf of the NetConf/XML Client
upper layer application
NC/XML

NC/XML
SNMP

SNMP
CLI
CLI

Server Storage
A B
Nexus 7000 Nexus 7000
Network
BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 34

© 2006, Cisco Systems, Inc. All rights reserved. 17


Presentation_ID.scr
Q and A

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 35

Recommended Reading

ƒ Cisco NX-OS Home Page


www.cisco.com/go/nxos

ƒ Cisco Data Center Network Manager


www.cisco.com/go/dcnm

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 36

© 2006, Cisco Systems, Inc. All rights reserved. 18


Presentation_ID.scr
Complete Your Online
Session Evaluation
ƒ Give us your feedback and you could win Don’t forget to activate
fabulous prizes. Winners announced daily. your Cisco Live virtual
account for access to
ƒ Receive 20 Passport points for each session all session material
evaluation you complete. on-demand and return
for our live virtual event
ƒ Complete your session evaluation online now in October 2008.
(open a browser through our wireless network Go to the Collaboration
to access our portal) or visit one of the Internet Zone in World of
stations throughout the Convention Center. Solutions or visit
www.cisco-live.com.

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 37

BRKDEV-1221
14625_05_2008_X1 © 2008 Cisco Systems, Inc. All rights reserved. Cisco Public 38

© 2006, Cisco Systems, Inc. All rights reserved. 19


Presentation_ID.scr

Anda mungkin juga menyukai