Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved


Chapter 5 Managing System Operations Using SEMP : SEMP Request Over HTTP

SEMP Request Over HTTP
A management application uses the SEMP interface to communicate with the P-7500 system as follows:
1.
2.
The management application must wait for the reply to each command before issuing the next command.
3.
At this point, the management application can close the connection, or keep the connection open for future HTTP POST requests.
HTTP Request Format
The following is an example of an HTTP request from a management application to issue a SEMP command to the P-7500 system:
Where:
<usernameAndPassword> is the username and password for the user. The username and password must be encoded as described in RFC 2617: Section 2: Basic Authentication Scheme. Only basic HTTP authentication is supported.
<length> indicates the length (in bytes) of the SEMP command that follows the HTTP header
<SEMP command> is the contents of the SEMP command being sent (see “SEMP Command Format” on page  67). The application can only send one SEMP command for each HTTP POST request.
HTTP Response Format
The following is an example of a P-7500 system HTTP response to a management application’s SEMP command:
Where:
<length> indicates the length (in bytes) of the SEMP reply that follows the HTTP header
<SEMP reply> is the contents of the SEMP reply being returned from the router (see “SEMP Reply Format” on page  68)
An HTTP response of "200 OK" is returned if the command was accepted by the P-7500 (even if it was not successfully executed). If there is an authentication failure, the following response is returned:
Otherwise, a response of "400 ERROR" is returned.
SEMP Command Format
The format of SEMP commands within HTTP POST requests is modeled after the P-7500 system CLI. Each SEMP command is the equivalent of either a single CLI command, or, in some cases, the equivalent of a CLI command to enter into a mode and a single CLI command.
SEMP commands are formatted in XML, following the schema in the semp-rpc-tma.xsd file provided with the TIBCO software release bundle. White space (including line-end characters) is optional in the SEMP command. The top-level element is <rpc>, and the next-level element corresponds to the command being issued. Inside the <rpc> element are the keywords and parameters of the command.
For example:
<ip-and-port>*</ip-and-port>
SEMP does not provide a concept of command modes. All commands are issued at the top level of the command mode hierarchy. In particular, the enable and configure commands are not required or supported in SEMP.
SEMP Reply Format
The SEMP interface replies indicate the success or failure of a SEMP command, in addition to the reason code for any failure. SEMP replies are formatted in XML, following the schema in the semp-rpc-reply-tma.xsd file.
The following is an example of a successful reply of the command described in “SEMP Command Format” on page  67:
Client-Date: Thu, 24 Mar 2011 15:31:33 GMT
As shown in the example above, a successfully parsed SEMP command always generates <rpc-reply> and <execute-result> element tags. As shown in the example above, in the case of SEMP show commands, a number of element tags detailing the command name (without parameters) and output are also generated.
The format of <execute-result> element is:
The execute-result code has either a value of “ok”, or “fail”. In case of failure, the reason (represented by a string) and reason code (represented by an integer) are also provided.
 

Copyright © TIBCO Software Inc. All Rights Reserved
Copyright © TIBCO Software Inc. All Rights Reserved