From Fedora Project Wiki

(Created page with 'For the xmlrpc part: The server.py defines the [1]class XmlRpcInterface() ----- 1) def _setpu_handlers 2) def list_modules 3) def list_methods 4) def inventory 5) def get_...')
 
No edit summary
Line 1: Line 1:
For the xmlrpc part:
An AMQP message body may contain 1 or more QMF messages


The server.py defines the
[1]class XmlRpcInterface()
-----
1) def  _setpu_handlers
2) def  list_modules
3) def  list_methods
4) def  inventory
5) def get_dispatch_method


The Request-Response Pattern


[2]FuncApiMethod
In the request-response pattern, a requestor sends a request message to one of its peers. The peer then does one of two things: If the request can be successfully processed, a single response message is sent back to the requestor. This response contains the requested results and serves as the positive acknowledgement that the request was successfully completed.
1) def __log_exc (Log an exception)
2) def __call__ ()
3) def serve() (code for starting the XMLRPC service)


If the request cannot be successfully completed, the peer sends a command complete message back to the requestor with an error code and error text describing what went wrong.


[3]FuncXMLRPCServer
The sequence number in the response or command complete message is the same as the sequence number in the request.


[4]FuncSSLXMLRPCServer *
    Requestor                                                          Peer
1)def __init__
        |                                                              |
2)def _dispatch(self,method,params):
        | --- Request (seq) ------------------------------------------> |
3)def auth_cb
        |                                                              |
4)def excepthook
        | <----------------------------------------- Response (seq) --- |
5)def main(argv)
        |                                                              |


    Requestor                                                          Peer
        |                                                              |
        | --- Request (seq) ------------------------------------------> |
        |                                                              |
        | <-------------------------- Command Complete (seq, error) --- |
        |                                                              |




The AuthedXMLRPCServer.py defines


[1]class AuthedSimpleXMLRPCRequestHandler
protocol_version = "HTTP/1.1"


1)def setup(self)
Broker Request Message
2)def do_POST(self)


[2]class BaseAuthedXMLRPCServer
When a management console first establishes contact with the broker, it sends a Broker Request message to initiate the exchange.
1)def __init__
2)def get_authinfo


[3]class AuthedSSLXMLRPCServer
        routing_key: broker
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'B' |          0          |
        +-----+-----+-----+-----+-----------------------+


[4]class AuthedXMLRPCServer
The Broker Request message has no payload.
Broker Response Message
 
When the broker receives a Broker Request message, it responds with a Broker Response message. This message contains an identifier unique to the broker.
 
        routing_key: <reply_to from request>
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'b' |          0          |
        +-----+-----+-----+-----+-----------------------+----------------------------+
        | brokerId (uuid)                                                            |
        +----------------------------------------------------------------------------+
 
Command Completion Message
 
        routing_key: <reply_to from request>
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'z' |          seq          |
        +-----+-----+-----+-----+----+------------------+
        |  Completion Code (uint32)  |
        +----------------------------+------------------------------------+
        |  Completion Text (str8)                                        |
        +-----------------------------------------------------------------+
 
Class Query
 
        routing_key: broker
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'Q' |          seq          |
        +-----+-----+-----+-----+-----------------------+----------+
        |  package name (str8)                                    |
        +----------------------------------------------------------+
 
Class Indication
 
        routing_key: <reply_to from request> (if in reply to a request)
                    schema.package          (if unsolicited)
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'q' |          seq          |
        +-----+-----+-----+-----+---------------+-------+
        | class kind (uint8) 1=Object, 2=Event  |
        +---------------------------------------+------------------+
        | package name (str8)                                      |
        +----------------------------------------------------------+
        | class name (str8)                                        |
        +----------------------------------------------------------+
        | schema hash (bin128)                                    |
        +----------------------------------------------------------+
 
Schema Request
 
        routing_key: broker
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 'S' |          seq          |
        +-----+-----+-----+-----+-----------------------+----------+
        | packageName (str8)                                      |
        +----------------------------------------------------------+
        | className (str8)                                        |
        +----------------------------------------------------------+
        | schema-hash (bin128)                                    |
        +----------------------------------------------------------+
 
Schema Response
 
        routing_key: <reply_to from request> (if in reply to a request)
                    schema.package          (if unsolicited)
        +-----+-----+-----+-----+-----------------------+
        | 'A' | 'M' | '2' | 's' |          seq          |
        +-----+-----+-----+-----+------------+----------+
        | kind (uint8) 1=Object, 2=Event    |
        +------------------------------------+---------------------+
        | packageName (str8)                                      |
        +----------------------------------------------------------+
        | className (str8)                                        |
        +----------------------------------------------------------+
        | schema-hash (bin128)                                    |
        +-----------------------------------------------+----------+
        | propCount (uint16)                            |
        +-----------------------------------------------+
        | statCount (uint16)                            |
        +-----------------------------------------------+
        | methodCount (uint16)                          |
        +-----------------------------------------------+----------------------------+
        | propCount property records                                                |
        +----------------------------------------------------------------------------+
        | statCount statistic records                                                |
        +----------------------------------------------------------------------------+
        | methodCount method records                                                |
        +----------------------------------------------------------------------------+
 
Each property record is an AMQP map with the following fields. Optional fields may optionally be omitted from the map.

Revision as of 02:58, 21 May 2010

An AMQP message body may contain 1 or more QMF messages


The Request-Response Pattern

In the request-response pattern, a requestor sends a request message to one of its peers. The peer then does one of two things: If the request can be successfully processed, a single response message is sent back to the requestor. This response contains the requested results and serves as the positive acknowledgement that the request was successfully completed.

If the request cannot be successfully completed, the peer sends a command complete message back to the requestor with an error code and error text describing what went wrong.

The sequence number in the response or command complete message is the same as the sequence number in the request.

   Requestor                                                          Peer
       |                                                               |
       | --- Request (seq) ------------------------------------------> |
       |                                                               |
       | <----------------------------------------- Response (seq) --- |
       |                                                               |
   Requestor                                                          Peer
       |                                                               |
       | --- Request (seq) ------------------------------------------> |
       |                                                               |
       | <-------------------------- Command Complete (seq, error) --- |
       |                                                               |



Broker Request Message

When a management console first establishes contact with the broker, it sends a Broker Request message to initiate the exchange.

       routing_key: broker
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'B' |           0           |
       +-----+-----+-----+-----+-----------------------+

The Broker Request message has no payload. Broker Response Message

When the broker receives a Broker Request message, it responds with a Broker Response message. This message contains an identifier unique to the broker.

       routing_key: <reply_to from request>
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'b' |           0           |
       +-----+-----+-----+-----+-----------------------+----------------------------+
       | brokerId (uuid)                                                            |
       +----------------------------------------------------------------------------+

Command Completion Message

       routing_key: <reply_to from request>
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'z' |          seq          |
       +-----+-----+-----+-----+----+------------------+
       |  Completion Code (uint32)  |
       +----------------------------+------------------------------------+
       |  Completion Text (str8)                                         |
       +-----------------------------------------------------------------+

Class Query

       routing_key: broker
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'Q' |          seq          |
       +-----+-----+-----+-----+-----------------------+----------+
       |  package name (str8)                                     |
       +----------------------------------------------------------+

Class Indication

       routing_key: <reply_to from request> (if in reply to a request)
                    schema.package          (if unsolicited)
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'q' |          seq          |
       +-----+-----+-----+-----+---------------+-------+
       | class kind (uint8) 1=Object, 2=Event  |
       +---------------------------------------+------------------+
       | package name (str8)                                      |
       +----------------------------------------------------------+
       | class name (str8)                                        |
       +----------------------------------------------------------+
       | schema hash (bin128)                                     |
       +----------------------------------------------------------+

Schema Request

       routing_key: broker
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 'S' |          seq          |
       +-----+-----+-----+-----+-----------------------+----------+
       | packageName (str8)                                       |
       +----------------------------------------------------------+
       | className (str8)                                         |
       +----------------------------------------------------------+
       | schema-hash (bin128)                                     |
       +----------------------------------------------------------+

Schema Response

       routing_key: <reply_to from request> (if in reply to a request)
                    schema.package          (if unsolicited)
       +-----+-----+-----+-----+-----------------------+
       | 'A' | 'M' | '2' | 's' |          seq          |
       +-----+-----+-----+-----+------------+----------+
       | kind (uint8) 1=Object, 2=Event     |
       +------------------------------------+---------------------+
       | packageName (str8)                                       |
       +----------------------------------------------------------+
       | className (str8)                                         |
       +----------------------------------------------------------+
       | schema-hash (bin128)                                     |
       +-----------------------------------------------+----------+
       | propCount (uint16)                            |
       +-----------------------------------------------+
       | statCount (uint16)                            |
       +-----------------------------------------------+
       | methodCount (uint16)                          |
       +-----------------------------------------------+----------------------------+
       | propCount property records                                                 |
       +----------------------------------------------------------------------------+
       | statCount statistic records                                                |
       +----------------------------------------------------------------------------+
       | methodCount method records                                                 |
       +----------------------------------------------------------------------------+

Each property record is an AMQP map with the following fields. Optional fields may optionally be omitted from the map.