- Preface
- Cisco XML API Overview
- Cisco XML Router Configuration and Management
- Cisco XML Operational Requests and Fault Management
- Cisco XML and Native Data Operations
- Cisco XML and Native Data Access Techniques
- Cisco XML and Encapsulated CLI Operations
- Cisco XML and Large Data Retrieval
- Cisco XML Security
- Cisco XML Schema Versioning
- Alarms
- Error Reporting in Cisco XML Responses
- Summary of Cisco XML API Configuration Tags
- Cisco XML Transport and Event Notifications
- Cisco XML Schemas
- Network Configuration Protocol
- Cisco IOS XR Perl Scripting Toolkit
- Sample BGP Configuration
- Glossary
- Index
Cisco XML and Encapsulated CLI Operations
XML interface for the router provides support for XML encapsulated CLI commands and responses.
This chapter provides information on XML CLI command tags.
XML CLI Command Tags
A client application can request a CLI command by encoding the text for the command within a pair of <CLI> start and </CLI> end tags, <Configuration> tags, and <EXEC> tags. The router responds with the uninterpreted CLI text result.
Note XML encapsulated CLI commands use the same target configuration as the corresponding XML operations <Get>, <Set>, and <Delete>.
When used for CLI operations, the <Configuration> tag supports the optional Operation attribute, which can take one of the values listed in Table 6-1.
The following example uses the <CLI> operation tag:
Sample XML Client Request for CLI Command Using CLI Tags
<?xml version="1.0" encoding="UTF-8"?>
<Request MajorVersion="1" MinorVersion="0">
<CLI>
<Configuration>
router bgp 3
default-metric 10
timers bgp 80 160
exit
commit
</Configuration>
<Exec>
sh config commit changes last 1
</Exec>
</CLI>
</Request>
Sample XML Response from the Router
<?xml version="1.0" encoding="UTF-8"?>
<Response MajorVersion="1" MinorVersion="0">
<CLI>
<Configuration>
<EXEC>
Building configuration...
router bgp 3
timers bgp 80 160
default-metric 10
end
<EXEC>
</CLI>
<ResultSummary ErrorCount="0"/>
</Response>
CLI Command Limitations
The CLI commands, which are supported through XML, are limited to CLI configuration commands and EXEC mode show commands (and responses) that are wrapped in <CLI> tags.
The following commands and conditions are not supported:
•The do configuration mode command.
•EXEC mode commands other than show commands except for the following items:
–show history
–show user
–show users
–show terminal
•Administration EXEC mode commands
•Iterators for responses to <CLI> commands issued through XML. For example, iterators are not supported for the output of the show run and show configuration commands.
•Sending a request in <CLI> format and getting back an XML encoded response.
•Sending an XML encoded request and getting back a response in <CLI> format.
•Only one XML <CLI> request can be issued at a time across all client sessions on the router.