apamax.eplapplications.platform

CumulocityPlatform

class apamax.eplapplications.platform.CumulocityPlatform(parent)[source]

Bases: object

Class to create a connection to the Cumulocity IoT platform configured in pysysproject.xml and spool the logs from the platform locally.

Requires the following properties to be set in pysysproject.xml:
  • CUMULOCITY_SERVER_URL

  • CUMULOCITY_TENANT

  • CUMULOCITY_USERNAME

  • CUMULOCITY_PASSWORD

For use with the EPLApps class for uploading EPL applications:

self.platform = CumulocityPlatform(self) eplapps = EPLApps(self.platform.getC8YConnection()) eplapps.deploy(self.input+’/test.mon’, activate=True) self.waitForGrep(self.platform.getApamaLogFile(), expr=’Added monitor eplfiles.test’)

Parameters

parent – The PySys test object using this platform object.

getApamaLogFile()[source]

Return the path to the Apama log file within Cumulocity IoT.

getC8YConnection()[source]

Return the C8yConnection object for this platform.

getC8yConnectionDetails()[source]

Return the (url, tenantid, username, password) defined in the pysysproject.xml)

getMicroserviceName()[source]

Get the name of the Apama-ctrl microservice being tested.

getSubscribedTenants()[source]

Get list of Cumulocity IoT tenants subscribed to the Apama-ctrl microservice if testing against a multi-tenant Apama-ctrl microservice.

If the Apama-ctrl microservice is per-tenant, it returns a list only containing the configured tenant.

Returns

List of Cumulocity IoT tenants.

Return type

list[CumulocityTenant]

getTenant()[source]

Get the Cumulocity IoT tenant configured in the pysysproject.xml file. :return: The Cumulocity IoT tenant. :rtype: CumulocityTenant

shutdown()[source]

Stop spooling the log files when the test finishes.