REST API  17
REST API for Luna Network HSMs
POST /api/lunasa/actions/{actionid}

POST /api/lunasa/actions/{actionid}

Performs the specified action.

Reboot: Reboot will restart the appliance, this will cause downtime in the server and the loss of all sessions. If the webServer service is not set to run on boot, the server will not run when the appliance starts back up. PowerOff: PowerOff will shutdown the appliance, this will cause downtime in the server and the loss of all sessions. RegenerateCertificate: RegenerateCertificate will generate a new appliance certificate with default arguments unless otherwise specified.


User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

actionid

The identifier of the action to be performed.

Use: Required

JSON Schema:

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

address

The address to be assigned to the CN of the certificate. The default of the attribute is the hostname of the appliance. This is used only for RegenerateCertificate.

Use: Optional

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 64
   pattern: ^((?:(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9]))|((?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4})|([a-zA-Z0-9]([a-zA-Z0-9.-]{0,62}[a-zA-Z0-9])?)$

days

The number of days for the certificate to be valid. The default value of the attribute is 365. This is used only for RegenerateCertificate.

Use: Optional

JSON Schema:

   Object
   type: int

startDate

The date on which this certificate will be valid. The default of the attribute is now. This is used only for RegenerateCertificate.

Use: Optional

JSON Schema:

   Object
   type: string
   format: date
   minLength: 10
   maxLength: 10
   pattern: ^[0-9]{4}-[0-1]{1}[0-9]{1}-[0-3]{1}[0-9]{1}$

Responses

204

Success

400

FRAMEWORK_BAD_REQUEST

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

403

FRAMEWORK_CRITICAL_OPERATION_RUNNING

Critical Operation currently in Progress.

404

Invalid action.

Example Request

   POST
   https://1.2.3.4:8443/api/lunasa/actions/reboot
   {}

   POST
   https://1.2.3.4:8443/api/lunasa/actions/powerOff
   {}

   POST
   https://1.2.3.4:8443/api/lunasa/actions/regenerateCertificate
   {
       "startDate" : "2018-2-30",
       "days" : 300,
       "address" : "123.43.23.1"
   }

Example Result

{}

Notes

Reboot and Power Off action will create a waiting task.

RegenerateCertificate will require SO authentication when the forceSoLogin flag is enabled. (See GET /api/lunasa)