Management Methods

Introduction

The core management methods provide direct access to the !MANAGE-… messages which are used to directly query (and modify) the status and/or configuration of other running applications in the n2svcd framework.

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

    local n2svcd = require "n2.n2svcd"

.management_summary [Asynchronous]

The management_summary method sends a !MANAGEMENT-SUMMARY-REQUEST message to the named (real) application, and returns the complete contents of the received !MANAGEMENT-SUMMARY-RESPONSE message.

The management_summary method takes one input parameter.

Parameter Type Description
app_name String [Required] The name of the application whose management summary we are requesting.
This must be a real application name, it cannot be a virtual (load-share/failover) app name.

The management_summary method returns an extended structure which is an exact mapping of the !MANAGEMENT-SUMMARY-RESPONSE message.

Example:

    local db_summary = n2svcd.management_summary ("db")
    for i, v in ipairs (db_summary.configuration.scalars) do
        print ("Configuration %s = %s", v.name, v.value)
    end

.management_resource_drilldown [Asynchronous]

The management_resource_drilldown method sends a !MANAGEMENT-RESOURCE-DRILLDOWN-REQUEST message to the named (real) application, and returns the complete contents of the received !MANAGEMENT-RESOURCE-DRILLDOWN-RESPONSE message.

The management_resource_drilldown method takes two or three input parameters.

Parameter Type Description
app_name String [Required] The name of the application whose management summary we are requesting.
This must be a real application name, it cannot be a virtual (load-share/failover) app name.
resource_key String [Required] A value which matches the key of a resource vector.
resource_row_key String An optional identifier which requests that only a single resource row is returned, along with the full content of any columns of type "extended". When this attribute is not present, then all rows of the resource vector are returned, but "extended" resource vector content is not included.

The management_resource_drilldown method returns an extended structure which is an exact mapping of the !MANAGEMENT-RESOURCE-DRILLDOWN-RESPONSE message.

Example:

    local connections = n2svcd.management_resource_drilldown ("db", "connections", "Primary-1")
    if (connections[1].status ~= "Active") then
        error ("Primary connection not active")
    end

.management_resource_operation [Asynchronous]

The management_resource_operation method sends a !MANAGEMENT-RESOURCE-OPERATION-REQUEST message to the named (real) application, and returns the complete contents of the received !MANAGEMENT-RESOURCE-OPERATION-RESPONSE message.

The management_resource_operation method takes exactly four input parameters.

Parameter Type Description
app_name String [Required] The name of the application whose resource vector we are affecting.
This must be a real application name, it cannot be a virtual (load-share/failover) app name.
resource_name String [Required] The name of the resource vector value to modify.
resource_row_key String [Required] The key identifying the specific resource vector row to modify.
The resource vector key is always column[0] of the resource vector.
operation_key String [Required] The column key for the operation to perform against that resource vector row.

The management_resource_operation method returns an extended structure which is an exact mapping of the !MANAGEMENT-RESOURCE-OPERATION-RESPONSE message.

Example:

    management.management_resource_operation ('EDR', 'streams', 'n2logic', 'flush')

Example:

    management.management_resource_operation ('Logic', 'SVC-0-LD-script_index', 'check', 'invalidate')