Exposing the Agent API to Python Scripts

TIBCO Enterprise Administrator includes a Python module that has the ability to expose any agent as a collection of objects in Python, by generating Python classes that mimic the object types defined by your agent, and constructing Python objects as necessary to reflect your agent's object instances. This exposure to Python is not automatic. Your agent must specifically request the exposure.

To expose the agent API over Python binding use the following in your agent code:

TeaAgentServer.setExposePythonAPI(true) - in server mode agent. The product will be accessible from EnterpriseAdministrator.products dictionary

or

TeaAgentServlet.setExposePythonAPI(true) - in servlet mode agent. The product will be accessible from EnterpriseAdministrator.products dictionary.

The default value for setExposePythonAPI() is false in which case you will not need to call the method at all. When set to false, the product will be accessible from EnterpriseAdministrator.products_with_provisional_apis dictionary. TIBCO Enterprise Administrator will still provide access to the "provisional" APIs, but you will see a message saying that the API is provisional when you try to access it using EnterpriseAdministrator.products_with_provisional_apis function.

For more details, refer to the TIBCO Enterprise Administrator User's Guide.

If agent's developed with TEA Agent Library version prior to 2.0.0 are registered with TIBCO Enterprise Administrator server having version above or equal to 2.0.0, the product will be considered as "provisional product" and will be accessible from EnterpriseAdministrator.products_with_provisional_apis dictionary. This is because the setExposePythonAPI is not available in the pre-2.0.0 agents library.