update_app_status()
  • 1 Minute to read

update_app_status()


Article summary

Sents to the fleet manager a status and a message of the task that is being executed.

Reference

Arguments

ArgumentsTypeDefault valueDescription
task_idstrNoneTask id generated by the fleet manager
statusFLEET_UPDATE_STATUSNoneStatus of the task
messagestrMessage to show on the window

See the complete list of fleet enumerations

Return

None

Exceptions

  • RayaFleetMissingValue

See the complete list of fleet exceptions

Usage Example

from raya.application_base import RayaApplicationBase
from raya.controllers.fleet_controller import FleetController
from raya.enumerations import *


class RayaApplication(RayaApplicationBase):

    async def setup(self):
        self.fleet: FleetController = await self.enable_controller('fleet')
        self.log.info(f'Hello from setup()')


    async def loop(self):
        await self.fleet.update_app_status(
                status=FLEET_UPDATE_STATUS.INFO,
                message='checking fleet info'
            )
        await self.sleep(3.0)
        await self.fleet.update_app_status(
                status=FLEET_UPDATE_STATUS.WARNING,
                message='checking fleet Warning'
            )
        await self.sleep(3.0)
        await self.fleet.update_app_status(
                status=FLEET_UPDATE_STATUS.ERROR,
                message='checking fleet ERROR'
            )
        await self.sleep(3.0)
        await self.fleet.update_app_status(
                status=FLEET_UPDATE_STATUS.SUCCESS,
                message='checking fleet succsess'
            )
        await self.sleep(3.0)
        await self.fleet.finish_task(
                result=FLEET_FINISH_STATUS.SUCCESS,
                message='checking fleet finish succsess'
            )
        await self.sleep(3.0)
        await self.fleet.finish_task(
                result=FLEET_FINISH_STATUS.FAILED,
                message='checking fleet finish FAILED'
            )
        await self.sleep(3.0)
        self.finish_app()


    async def finish(self):
        self.log.warn(f'Hello from finish()')

Once the task is executed you should see this on the task details

image.png


Was this article helpful?