Status Methods

Introduction

The status method queries the self-reported status of a Lua Agent.

This methods are accessed via the “n2.n2svcd” module:

    local n2svcd = require "n2.n2svcd"

.agent_status [Asynchronous]

The agent_status method checks the application status of a Lua Agent. The Agent will perform its own determination of availability. This will typically involve examing the Application Status of any application(s) which this agent uses to perform its function.

For example, a DB agent will use a DBApp to perform its function, and hence will consider the DBApp’s status when returning the agent status value.

The agent_status method takes the following parameters.

Parameter Type Description
action String The name of the action to check the status of.
route String The name of a specific named instance for an action to check the status of.

Example:

    local db_status = n2svcd.agent_status ("db")

The agent_status method returns an application status number between 0-8.