X Commands

This chapter describes the Cisco NX-OS system management commands that begin with the letter X.

xml server max-session

To configure the number of allowed XML server sessions, use the xml server max-session command. To reset the number to the default, use the no form of this command.

xml server max-session max-sessions

no xml server max-session max-sessions

 
Syntax Description

max-sessions

Maximum number of allowed XML server sessions. The range is from 1 to 8. The default is 8.

 
Defaults

The XML server sessions allowed is 8.

 
Command Modes

Global configuration mode (config)

 
Supported User Roles

network-admin
vdc-admin

 
Command History

Release
Modification

4.0(1)

This command was introduced.

 
Usage Guidelines

This command does not require a license.

Examples

This example shows how to configure the number of allowed XML server sessions:

switch(config)# xml server max-session 4
 

This example shows how to reset the number of allowed XML server sessions to the default:

switch(config)# no xml server max-session 4
 

 
Related Commands

Command
Description

show xml server status

Displays information about the status of the XML server.

xml server terminate session

To terminate an XML server session, use the xml server terminate session command.

xml server terminate session session_id

 
Syntax Description

session_id

Session number. The range is from 0 to 2147483647.

 
Defaults

None

 
Command Modes

Any command mode

 
Supported User Roles

network-admin
network-operator
vdc-admin
vdc-operator

 
Command History

Release
Modification

4.0(1)

This command was introduced.

 
Usage Guidelines

This command does not require a license.

Examples

This example shows how to terminate an XML server session:

switch(config)# xml server terminate session 3
 

 
Related Commands

Command
Description

show xml server status

Displays information about the status of the XML server.

xml server timeout

To configure the XML server session timeout, use the xml server timeout command. To reset the timeout to the default, use the no form of this command.

xml server timeout timeout [ session_id ]

no xml server timeout timeout [ session_id ]

 
Syntax Description

timeout

Timeout in seconds. The range is from 0 to 1200. The default is 1200.

session_id

(Optional) XML server session number. The range is from 0 to 2147483647.

 
Defaults

The timeout is 1200 seconds.

 
Command Modes

Global configuration mode (config)

 
Supported User Roles

network-admin
vdc-admin

 
Command History

Release
Modification

4.0(1)

This command was introduced.

 
Usage Guidelines

You can apply the XML server timeout only to active sessions.

This command does not require a license.

Examples

This example shows how to configure the XML server timeout for active sessions:

switch(config)# xml server timeout 800
 

This example shows how to reset the timeout to the default:

switch(config)# no xml server timeout 800
 

xml server validate

To validate XML documents, use the xml server validate command. To disable XML document validation, use the no form of this command.

xml server validate { all | session_id }

no xml server validate { all | session_id }

 
Syntax Description

all

Validates all sessions.

session_id

Session number. The range is from 0 to 2147483647.

 
Defaults

Disabled

 
Command Modes

Any command mode

 
Supported User Roles

network-admin
network-operator
vdc-admin
vdc-operator

 
Command History

Release
Modification

4.0(1)

This command was introduced.

 
Usage Guidelines

You can validate XML documents only for active sessions.

This command does not require a license.

Examples

This example shows how to validate XML documents for all active sessions:

switch(config)# xml server validate all
 

This example shows how to disable validation of XML documents for all sessions:

switch(config)# no xml server validate all
 

xmlin

To install the XMLIN tool on the device and generate equivalent Network Configuration (NETCONF) formats of all CLI commands entered in this mode, use the xmlin command.

xml in

 
Syntax Description

This command has no arguments or keywords.

 
Defaults

None

 
Command Modes

EXEC mode

 
Supported User Roles

network-admin
network-operator
vdc-admin
vdc-operator

 
Command History

Release
Modification

6.2(2)

This command was introduced.

 
Usage Guidelines

The XMLIN tool converts CLI commands to the NETCONF protocol format. NETCONF is a network management protocol that provides mechanisms to install, manipulate, and delete the configuration of network devices. It uses XML-based encoding for configuration data and protocol messages. The Cisco NX-OS implementation of the NETCONF protocol supports the following protocol operations: <get>, <edit-config>, <close-session>, <kill-session>, and <exec-command>.

The XMLIN tool converts show, EXEC, and configuration commands to corresponding NETCONF <get>, <exec-command>, and <edit-config> requests. You can enter multiple configuration commands into a single NETCONF <edit-config> instance.

Note the following restrictions:

  • In NETCONF, <edit-config> requests cannot consist of any show commands.
  • In each <get-config> instance, only one show command is allowed.
note.gif

Noteblank.gif Although the XMLIN tool is usually capable of generating NETCONF instances of commands even if the corresponding feature sets or the required hardware capabilities are not available on the device, you might have to install some feature sets before entering the xmlin command.


The XMLIN tool also converts the output of show commands to XML format by using the show-command | xmlin command.

Ensure the XMLIN tool is installed before you use the show-command | xmlin command.

note.gif

Noteblank.gif XMLIN requires no license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the Cisco NX-OS licensing scheme, see the Cisco NX-OS Licensing Guide.


Examples

This example shows how the XMLIN tool is installed on the device and used to convert a set of configuration commands to an <edit-config> instance:

switch# xmlin
******************************************
Loading the xmlin tool. Please be patient.
******************************************
Cisco Nexus Operating System (NX-OS) Software
TAC support: http://www.cisco.com/tac
Copyright ©) 2002-2013, Cisco Systems, Inc. All rights reserved.
The copyrights to certain works contained in this software are
owned by other third parties and used and distributed under
license. Certain components of this software are licensed under
the GNU General Public License (GPL) version 2.0 or the GNU
Lesser General Public License (LGPL) Version 2.1. A copy of each
such license is available at
http://www.opensource.org/licenses/gpl-2.0.php and
http://www.opensource.org/licenses/lgpl-2.1.php
switch(xmlin)# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)(xmlin)# interface ethernet 2/1
% Success
switch(config-if-verify)(xmlin)# cdp enable
% Success
switch(config-if-verify)(xmlin)# end
<?xml version="1.0"?>
<nf:rpc xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="http://www.cisco.com/nxos:6.2.2.:configure_"
xmlns:m="http://www.cisco.com/nxos:6.2.2.:_exec"
xmlns:m1="http://www.cisco.com/nxos:6.2.2.:configure__if-eth-base" message-id="1">
<nf:edit-config>
<nf:target>
<nf:running/>
</nf:target>
<nf:config><nf:running/>
</nf:target>
<nf:config>
<m:configure>
<m:terminal>
<interface>
<__XML__PARAM__interface>
<__XML__value>Ethernet2/1</__XML__value>
<m1:cdp>
<m1:enable/>
</m1:cdp>
</__XML__PARAM__interface>
</interface>
</m:terminal>
</m:configure>
</nf:config>
</nf:edit-config>
</nf:rpc>
]]>]]>

 

This example shows how to convert the output of the show interface brief command to XML:

switch# show interface brief | xmlin
<?xml version="1.0"?>
<nf:rpc xmlns:nf="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="http://www.cisco.com/nxos:6.2.2.:if_manager"
 
message-id="1">
<nf:get>
<nf:filter type="subtree">
<show>
<interface>
<brief/>
</interface>
</show>
</nf:filter>
</nf:get>
</nf:rpc>
]]>]]>