Cisco IOS XML-PI Command Reference
A through Z Commands
Downloads: This chapterpdf (PDF - 144.0KB) The complete bookPDF (PDF - 233.0KB) | The complete bookePub (ePub - 533.0KB) | Feedback

format globalnetconf formatshow formatshow odm-formatshow xsd-formatspec-file install add-entryspec-file install built-inspec-file install filespec-file install remove-entryspec-file install restore

A through Z Commands

format global

To specify a default Operational Data Model (ODM) specification file other than the built-in specification file for XML-formatted requests, use the format global command in global configuration mode. To remove the default file, use the no form of this command.

format global location : local-filename
no format global

Syntax Description

location:local-filename

Command ODM file location and filename. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

ODM spec files have a .odm suffix.

Command Default

The built-in spec file is used.

Command Modes


Global configuration (config)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the format global command to specify an ODM spec file as the default for all XML-formatted requests coming from NETCONF operations. The NETCONF file search precedence is to look first for the file associated by the netconf format command, then for the file defined by the format global command, and finally for the built-in spec file.

The ODM spec file must exist on the files ystem before NETCONF can be configured to use it. If the file does not exist, the format global command is rejected.

Examples

The following example shows how to define a default ODM file to be used for all requests, then associates that file with NETCONF for all XML-formatted requests. If no file is specified, the built-in spec file is used for all requests:

Router(config)# format global disk0:spec3.3.odm
Router(config)# netconf format disk2:spec3.3.odm

Related Commands

Command

Description

netconf format

Associates NETCONF with an ODM spec file for XML-formatted requests.

spec-file install built-in

Replaces the current spec file with the built-in spec file.

spec-file install file

Replaces a local spec file with a remote spec file.

netconf format

To associate Network Configuration Protocol (NETCONF) with an Operational Data Model (ODM) specification file for XML-formatted requests, use the netconf format command in global configuration mode. To remove the association, use the no form of this command.

netconf format location : local-filename
no netconf format

Syntax Description

location:local-filename

Command ODM file location and filename. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

ODM spec files have a .odm suffix.

Command Default

The spec file defined by the format global command is used.

Command Modes


Global configuration (config)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the netconf format command to make an association with NETCONF to use the specified ODM spec file for all XML-formatted requests coming from NETCONF operations.

The ODM spec file must exist on the files ystem before NETCONF can be configured to use it. If the file does not exist, the netconf format command is rejected.

Examples

The following example shows how to associate a file named spec3.3.odm with NETCONF:

Router(config)# netconf format disk0:spec3.3.odm

Related Commands

Command

Description

netconf lock-time

Limits the amount of time NETCONF can lock a configuration.

netconf max-sessions

Limits the total number of NETCONF sessions.

netconf ssh

Enables NETCONF over SSHv2.

show format

To display a fully expanded list of commands that have a spec file entry (SFE), display the SFE of a specific command, or validate a specific spec file, use the show format command in privileged EXEC mode.

show format [ built-in | location : local-filename ] [ cli command | validate ]

Syntax Description

built-in

(Optional) Displays the commands with SFEs in the built-in spec file, and validates the built-in spec file when used with the validate keyword. Displays the SFE for a specific command when used with the cli keyword and command argument.

location:local-filename

(Optional) Command Operational Data Model (ODM) spec file location and filename. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

ODM spec files have a .odm suffix. The pipe (|) output modifier can be used in the command.

Note    These arguments are not required if you want to use a default ODM file defined with the format global command.

cli command

(Optional) Displays only the SFE for the specified command. Enter a fully expanded command name.

validate

(Optional) Validates the built-in spec file or a specific spec file.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was modified. The built-in and validate keywords were added.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the show format command to display an index of commands that have an SFE in the spec file, display the SFE of a specific command, or validate a spec file. The SFE of any command is in XML format.

Use the show format command to display an index of commands with an SFE in the current spec file. Some commands have an SFE in the built-in spec file of the image. Use the show format built-in command to display an index of the commands with an SFE in the built-in spec file.

To display the SFE for a specific command in the built-in spec file, use the show format built-in cli command command. For example, if show inventory is present in the built-in spec file, then the show format built-in cli show inventory command will display the spec entry for this CLI. To display the SFE for a specific command in a specific spec file, use the show format location:local-filename clicommand command.

To validate the built-in spec file use the show format built-in validate command. To validate a specific spec file use the show formatlocation:local-filename validate command.

Examples

The following example displays the list of commands that have SFEs in the built-in spec file of the image:

Router# show format built-in

The following CLI are supported in built-in
show inventory
show ip interface brief

The following example shows a list of fully expanded command names that have spec files in the spec3.3.odm file. A message is attached that lists an incorrectly defined command.

Router# show format slot0:spec3.3.odm

The following CLI are supported in slot0:spec3.3.odm
show arp
show bootvar
show cdp neighbors detail
show context
show flash:
show interfaces*
show interfaces
show inventory
show ip interface*
show ip interface brief
show ip nat translations
show line value
show line
show processes memory
show region
show spanning-tree
show stacks
The following CLI are IGNORED (incorrectly entered) in slot0:spec3.3.odm
show async status

The following example shows the output when the spec entry for a particular command is requested from the default ODM file:

Router# show format cli show inventory

<?xml version='1.0' encoding='utf-8'?>
<ODMSpec>
<Command>
<Name>show inventory</Name>
</Command>
<OS>ios</OS>
<DataModel>
<Container name="ShowInventory">
<Container name="NAME:" alias = "InventoryEntry" dynamic = "true">
<Property name="NAME:" alias = "ChassisName" distance = "1" length = "1" end-de>
<Property name="DESCR:" alias = "Description" distance = "1" length = "-1" type>
<Property name="PID:" alias="PID" distance = "1" length = "5" end-delimiter = ">
<Property name="VID:" alias="VID" distance = "1" length = "1" end-delimiter = ">
<Property name="SN:" alias="SN" distance = "1" length = "1" end-delimiter = ",">
</Container>
</Container>
</DataModel>
</ODMSpec> 

The following example shows the output when the spec entry for a particular command is requested from a specific ODM file:

Router# show format slot0:spec3.3.odm cli show ip interface brief

<?xml version="1.0" encoding="UTF-8"?> 
<ODMSpec>
        <Command>
                <Name>show ip interface brief</Name>
        </Command>
        <OS>ios</OS>
        <DataModel>
                <Container name="ShowIpInterfaceBrief">
                        <Table name="IPInterfaces">
                                <Header name="Interface" type="String" start="0" end="23"/>
                                <Header name="IP-Address" type="IpAddress" start="24" end="41"/>
                                <Header name="OK" type="String" start="42" end="46"/>
                                <Header name="Method" type="String" start="47" end="53"/>
                                <Header name="Status" type="String" start="54" end="75"/>
                                <Header name="Protocol" type="String" start="76" end="-1"/>
                        </Table>
                </Container>
</DataModel>
</ODMSpec>

The following example validates the built-in spec file:

Router# show format built-in validate 

The file built-in has been validated
The following example shows the output when a spec file fails to validate:
Router# show format disk2:/spec3.4.odm validate
The following problem was detected in disk2:/spec3.4.odm bad format in the spec file, show line value   
The following example shows the output when a specific spec file is validated:
Router# show format disk2:/spec3.user1.odm validate
The file disk2:/spec3.user1.odm has been validated

The following example specifies the spec file named spec3.user2.odm as the default spec file instead of the built-in spec file, replaces the current spec file with it, and ensures that it is validated as the current spec file:

Router(config)# format global disk2:/spec3.user2.odm
Router(config)# exit
Router# spec-file install disk2:/spec3.user2.odm built-in
Replace existing file? [yes]: Enter
Router#
Router# show format validate

The file disk2:/spec3.user2.odm has been validated

Each display from the show format command is self-explanatory; see the "Usage Guidelines" section for more information.

Related Commands

Command

Description

format global

Specifies a default ODM spec file other than the built-in spec file.

show odm-format

Displays the schema of the spec file.

show xsd-format

Generates XSD output for a command.

spec-file install built-in

Replaces the current spec file with the built-in spec file.

show odm-format

To display the schema of the spec file, use the show odm-format command in privileged EXEC mode.

show odm-format

Syntax Description

This command has no arguments or keywords.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

The show odm-format command displays the spec file structure in a fixed output that you can refer to in order to understand the spec file tag hierarchy.

Examples

The following example shows the fixed output from the show odm-format command:

Router# show odm-format

New Name Space ''
<NotARealTag> Either 0 or 1 allowed
  <ODMSpec> Exactly 1 required
    <Command> Exactly 1 required
      <Name> Exactly 1 required
      <AliasSet> Either 0 or 1 allowed
        <Alias> At least 1 required
    <OS> Either 0 or 1 allowed
    <DataModel> Exactly 1 required
      <Container> Exactly 1 required
        <Table> 0 or more is allowed
          <Header> At least 1 required
            <Option> 0 or more is allowed
          <EndOfTheTable> Either 0 or 1 allowed
        <Property> 0 or more is allowed
          <Option> 0 or more is allowed
        <Container> 0 or more is allowed
          <Table> 0 or more is allowed
            <Header> At least 1 required
              <Option> 0 or more is allowed
            <EndOfTheTable> Either 0 or 1 allowed
          <Property> 0 or more is allowed
            <Option> 0 or more is allowed 
             <Container> 0 or more is allowed
          <Legends> 0 or more is allowed
            <Legend> At least 1 required
          <IgnorableLinesList> 0 or more is allowed
            <Line> At least 1 required
        <Legends> 0 or more is allowed
          <Legend> At least 1 required
        <IgnorableLinesList> 0 or more is allowed
          <Line> At least 1 required

The output from the show odm-format command is self-explanatory; see the "Usage Guidelines" section for more information.

Related Commands

Command

Description

show xsd-format

Generates XSD output for a command.

show xsd-format

To generate XML Schema Definition (XSD) output for a command, use the show xsd-format command in privileged EXEC mode.

show xsd-format [ location : local-filename ] cli command

Syntax Description

location:local-filename

(Optional) Command Operational Data Model (ODM) file location and filename. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

ODM spec files have a .odm suffix. The pipe (|) output modifier can be used in the command.

Note    These arguments are not required if you want to use a default ODM file defined with the format global command.

cli command

Displays the XSD output for the specific command. Enter a fully expanded command name.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

The show xsd-format command searches through the ODM spec file to find a match for the specified command name and generates XSD format. The spec file must exist on the local file system. If no spec entry is found, an error is returned.


Note


The show running-config command output is generated natively in XML, so the spec filename could be an empty file or, if a default spec file has been defined with the format global command, no filename is required.

Examples

The following example displays the XSD generated for the show arp command:

Router# show xsd-format disk2:spec3.3.odm cli show arp

<?xml version="1.0"?>
  <xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:complexType name="ShowArp_def">
      <xsd:sequence>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
          <xsd:element ref="Info"/>
          <xsd:element name="ARPTable" minOccurs="0">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="entry" minOccurs="0" maxOccurs="unbounded">
                  <xsd:complexType>
                    <xsd:sequence>
                      <xsd:element name="Protocol" minOccurs="0" type="string" />
                      <xsd:element name="Address" minOccurs="0" type="string" />
                      <xsd:element name="Age" minOccurs="0" type="integer" />
                      <xsd:element name="MAC" minOccurs="0" type="string" />
                      <xsd:element name="Type" minOccurs="0" type="string" />
                      <xsd:element name="Interface" minOccurs="0" type="string" />
                    </xsd:sequence>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:complexType>
          </xsd:element>
        </xsd:choice>
      </xsd:sequence>
    </xsd:complexType>
    <xsd:element name="Info" type="xsd:string"/>
    <xsd:element name="ShowArp" type="ShowArp_def"/>
  </xsd:schema>

The output from the show xsd-format command is self-explanatory; see the "Usage Guidelines" section for more information.

Related Commands

Command

Description

format global

Specifies a default ODM spec file other than the built-in spec file for XML-formatted requests coming from NETCONF operations.

show odm-format

Displays the schema of the spec file.

spec-file install add-entry

To copy a spec file entry (SFE) from a remote location and add it to the local spec file, use the spec-file install add-entry command in privileged EXEC mode.

spec-file install [ force] location : local-filename add-entry url : remote-filename command

Syntax Description

force

(Optional) Performs the action without prompting.

location:local-filename

Spec filename, which must be on a local file system. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

Spec files have a .odm suffix.

You will be prompted to confirm adding the SFE, unless the optional force keyword is used.

url:remote-filename

Location (URL) and filename of the remote spec file. Valid URLs are archive:, bootflash:, cns:, flash:, ftp:, http:, null:, nvram:, pram:, rcp:, scp:, system:, tar:, tftp:, tmpsys:, and any valid disk or slot number (such as disk0: or slot1:).

command

Command SFE to be added to the spec file.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the spec-file install add-entry command to add an SFE to a spec file. A check is performed on the loaded SFE to ensure that the command is not already present in the spec file, and that the SFE can be parsed correctly in XML.

If the spec file does not exist, you will be prompted before the file is created. If the command SFE already exists in the spec file, you will be prompted before the command SFE is replaced. A backup copy of the local spec file is created before the remote SFE is added.

Examples

The following example adds the show arp command SFE from the remote show_arp.odm file at location "tftp://system1/user1" to the local file:

Router# spec-file install slot0:spec_file.odm
 add-entry tftp://system1/user1/show_arp.odm show arp

Unless you add the force keyword to the command string, you will be prompted as follows:

create new spec file? [yes]:
CLI exists, delete it? [yes]:

Pressing the Enter key is the same as typing yes. Type no and press Enter to stop either process.

Related Commands

Command

Description

spec-file install built-in

Replaces the current spec file with the built-in spec file.

spec-file install file

Replaces a local spec file with a remote spec file.

spec-file install remove-entry

Removes an SFE from a spec file.

spec-file install restore

Restores a spec file to its previous contents using a backup file.

spec-file install built-in

To replace the current spec file with the built-in spec file, use the spec-file install built-in command in privileged EXEC mode.

spec-file install [ force] location : local-filename built-in

Syntax Description

force

(Optional) Performs the action without prompting.

location:local-filename

Spec filename, which must be on a local file system. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

Spec files have a .odm suffix.

If local-filename exists, you will be prompted for a yes or no response before the file is replaced, unless the optional force keyword is used.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the spec-file install built-in to replace the current spec file with the built-in spec file. You will be prompted before the current file is replaced and filename.bak will be created.

Examples

The following example shows how to start the process to replace the current spec file with the built-in spec file:

Router# spec-file install slot0:spec_file.odm built-in

Unless you add the force keyword to the command string, you will be prompted as follows:

Replace existing file? [yes]:

Press the Enter key to make a backup copy of the current file and then replace it with the built-in spec file. Type no and press Enter to stop the process.

Related Commands

Command

Description

spec-file install add-entry

Copies an SFE from a remote location and adds it to a local spec file.

spec-file install file

Replaces a local spec file with a remote spec file.

spec-file install remove-entry

Removes an SFE from a spec file.

spec-file install restore

Restores a spec file to its previous contents using a backup file.

spec-file install file

To replace a local spec file with a remote spec file, use the spec-file install file command in privileged EXEC mode.

spec-file install [ force] location : local-filename file url : remote-filename

Syntax Description

force

(Optional) Performs the action without prompting.

location:local-filename

Spec filename, which must be on a local file system. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

Spec files have a .odm suffix.

When local-filename exists, you will be prompted for a yes or no response before the file is copied, unless the optional force keyword is used.

url:remote-filename

Location (URL) and filename of the remote spec file. Valid URLs are archive:, bootflash:, cns:, flash:, ftp:, http:, null:, nvram:, pram:, rcp:, scp:, system:, tar:, tftp:, tmpsys:, and any valid disk or slot number (such as disk0: or slot1:).

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the spec-file install file command to copy a remote spec file to a local spec file. A check of the loaded file is performed to ensure that each specified command is included only once, and that the spec file entry (SFE) can be parsed correctly in XML.

Examples

The following example shows how to copy a remote spec file on "tftp://system1/user1" to the local file:

Router# spec-file
 install slot0:spec_file.odm file tftp://system1/user1/spec_file.odm

Unless you add the force keyword to the command string, you will be prompted as follows:

Replace existing file? [yes]:

Press the Enter key to complete the command. Type no and press Enter to stop the process.

Related Commands

Command

Description

spec-file install add-entry

Copies an SFE from a remote location and adds it to a local spec file.

spec-file install built-in

Replaces the current spec file with the built-in spec file.

spec-file install remove-entry

Removes an SFE from a spec file.

spec-file install restore

Restores a spec file to its previous contents using a backup file.

spec-file install remove-entry

To remove a spec file entry (SFE) from a spec file, use the spec-file install remove-entry command in privileged EXEC mode.

spec-file install [ force] location : local-filename remove-entry command

Syntax Description

force

(Optional) Performs the action without prompting.

location:local-filename

Spec filename, which must be on a local file system. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

Spec files have a .odm suffix.

command

Command SFE to be removed from the spec file.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the spec-file install remove-entry command to remove a command SFE from a spec file. A check is performed to ensure that the command SFE is present in the spec file. If the spec file does not exist, this command fails. A backup copy of the spec file is created before the SFE is removed.

Examples

The following example shows how to remove the show arp command SFE from the remote show_arp.odm file to the local spec_file.odm file:

Router# spec-file install slot0:spec_file.odm remove-entry show arp

Related Commands

Command

Description

spec-file install add-entry

Copies an SFE from a remote location and adds it to a local spec file.

spec-file install built-in

Replaces the current spec file with the built-in spec file.

spec-file install file

Replaces a local spec file with a remote spec file.

spec-file install restore

Restores a spec file to its previous contents using a backup file.

spec-file install restore

To restore a spec file to its previous contents using a backup file, use the spec-file install restore command in privileged EXEC mode.

spec-file install [ force] location : local-filename restore

Syntax Description

force

(Optional) Performs the action without prompting.

location:local-filename

Spec filename, which must be on a local file system. Valid locations are bootflash:, flash:, nvram:, and any valid disk or slot number (such as disk0: or slot1:).

Spec files have a .odm suffix.

Command Modes


Privileged EXEC (#)

Command History

Release

Modification

12.4(20)T

This command was introduced.

12.2(33)SRE

This command was integrated into Cisco IOS Release 12.2(33)SRE.

12.2(54)SG

This command was integrated into Cisco IOS Release 12.2(54)SG.

12.2(50)SY

This command was integrated into Cisco IOS Release 12.2(50)SY.

15.1(1)SY

This command was integrated into Cisco IOS Release 15.1(1)SY.

Usage Guidelines

Use the spec-file install restore command to revert a spec file to its original contents using a backup (.bak) file. If the .bak file does not exist, this command fails.

Examples

The following example shows how to restore the spec file using the backup file:

Router# spec-file install slot0:spec_file.odm restore

Related Commands

Command

Description

spec-file install add-entry

Copies an SFE from a remote location and adds it to a local spec file.

spec-file install built-in

Replaces the current spec file with the built-in spec file.

spec-file install file

Replaces a local spec file with a remote spec file.

spec-file install remove-entry

Removes an SFE from a spec file.

© 2012 Cisco Systems, Inc. All rights reserved.