REST API  17
REST API for Luna Network HSMs
POST /api/lunasa/snmp/traps/test

POST /api/lunasa/snmp/traps/test

Submits a test payload to allow administrator to create test logs to initiate trap notifications.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

logFacility

Specifies the log facility to use when generating the test message. Valid values: kern, user, daemon, auth, syslog, authpriv, cron, local0, local1, local2, local3, local4, local5, local6, local7

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 4
   maxLength: 8
   pattern: ^(kern|user|daemon|auth|syslog|authpriv|cron|local0|local1|local2|local3|local4|local5|local6|local7)$

logLevel

Specifies the severity level to assign to the test message. Valid values: emergency, alert, critical, crit, error, err, warning, warn, notice, info, debug

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 3
   maxLength: 9
   pattern: ^(emergency|alert|critical|crit|error|err|warning|warn|notice|info|debug)$

process

Specifies the system process to use when generating the test message. Valid values: Any process defined for the system. For example, NTLS, impievd, smartd, sysstatd.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 32
   pattern: ^[a-zA-Z0-9_]+$

message

A string that specifies the body text for the test message.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 128
   pattern: ^[a-zA-Z0-9_ $()[]{}*+./^!<>#%,:=@~?'-]*$

pid

Add a process identifier to the test message.

Use: Not Required

JSON Schema:

   Object
   type: Boolean

Responses

204

Success

400

FRAMEWORK_BAD_REQUEST

Returned when the input data does not conform to the required validation schema.

401

FRAMEWORK_NO_SESSION_COOKIE

No session cookie was found.

500

SNMP_OPERATION_FAILED

Failed to perform the specified operation.

Example Request

   POST
   https://1.2.3.4:8443/api/lunasa/snmp/traps/test
   {
      "logFacility": "local0",
      "logLevel": "info",
      "process": "snmpd",
      "message": "This is a test message",
      "pid": true
   }

Example Result

{
}