Cisco Cisco Configuration Engine 3.5 Entwickleranleitung

Seite von 344
2-8
Cisco Configuration Engine Software Development Kit API Reference and Programmer Guide 3.5
OL-17661-02
Chapter 2      Event Service and IMGW
Event Bus Interface
<!ELEMENT port-number (#PCDATA)>
<!ELEMENT url (#PCDATA)>
<!ELEMENT cli-exec (#PCDATA)>
While the generic exec-cmd-event element supports numerous modes of execution, including a 
customizable reply-subject and multiple methods of response. Following is an example of a request to 
read the configuration:
<exec-cmd-event>
<identifier-exec>ID_0001</identifier_exec>
<cli-exec>show running-config</cli-exec>
</exec-cmd-event>
The exec-cmd-event element contains the element identifier which is used to correlate the output event 
with the input event. The cli-exec element contains a single exec CLI command line. 
The XML DTD for the data for the output of the input exec CLI command request that is sent out on the 
cisco.mgmt.cns.exec.rsp.dev_id event is as follows:
<!ELEMENT exec-cmd-response (identifier-exec, status, (error-info|response))> 
<!ELEMENT identifier-exec (#PCDATA)> 
<!ELEMENT status (#PCDATA)> 
<!ELEMENT response (#PCDATA)>
The identifier-exec element is used to correlate the output event with the input event. The status element 
indicates whether the CLI exec command failed or succeeded. The value of the status element is set to 
fail or success. The response element contains the output from the exec CLI command. Note that the 
status element may contain the value success if a semantic, rather than a syntax, error occurred. 
Therefore, applications should always check the value of the response element to verify that it is in the 
expected format. The error-info element is in the same format as described earlier for the 
config-warning and config-failure tags.
Following is an example of a response element:
<exec-cmd-response>
<identifier-exec>ID_0001</identifier-exec>
<status>success</status>
<response>
Building configuration...
Current configuration : 985 bytes
!
version 12.2
no service single-slot-reload-enable
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname r1
!
logging rate-limit console 10 except errors
end
</response>
</exec-cmd-response>