Test Odoo & SQL ping using Curl command or python script

Hi,

Is there a way we can perform the odoo and sql ping test using a curl command or python script?

Regards,
Dilip

In web-admin, 99% of its core backend functionality is represented by Zato admin services. That is, web-admin is a mere client of Zato services, it does not modify configuration in a cluster’s SQL database directly.

This means that when you ping a connection, web-admin invokes a service to ping the connection and returns the response to you.

You can invoke any service from command line using zato service invoke.

The easiest way to discover what web-admin does is to open file admin.log, each server has it, and then to trigger the desired functionality in web-admin, e.g. SQL ping.

Below, you can note what admin.log says in my case when I did it:

INFO - name:[zato.outgoing.sql.ping], SIO request:[{u'id': 1}]
INFO - name:`zato.outgoing.sql.ping`, response:`{"zato_outgoing_sql_ping_response": {"response_time": "0.000918865203857"}}`

That is, web-admin invoked service zato.outgoing.sql.ping, giving it the connection ID (1) on input. The response corresponds to the request.

Now, you can use the same approach to invoke any service from command line with zato service invoke.

This is a parsing exception - the service you invoked expected an element called id on input but it was not provided.

Yes, that is correct. The easiest way really is to repeat the same what you find in admin.log.