REST API  14
REST API for Luna Network HSMs
POST /api/lunasa/services/{serviceid}/actions/{actionid}

POST /api/lunasa/services/{serviceid}/actions/{actionid}

Performs the specified action on the service.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

serviceid

The identifier of the service of interest. Valid Values: cbs, lsta, network, ntls, ntp, syslog, snmp, ssh, stc, sysstat, webserver, cluster, ismigration, ctc, clusteradmin.

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 12
   pattern: '^[a-z]*$'

actionid

The identifier of the action of interest

Use: Required

JSON Schema:

   Object
   type: string
   minLength: 1
   maxLength: 10
   pattern: '^[a-z]*$'

force

Force option used for cluster service start

Use: Not Required

JSON Schema:

   type: boolean
   default: false

Responses

204

Success.

Location

JSON Schema:

    id: Object
        type: string

"Location" is the URL to the task spawned to perform the action on the service.

id

The identifier for the service actioned.

JSON Schema:

    id: Object
        type: string

400

APPLIANCE_SERVICE_ACTION_FAILED

Unexpected error

404

APPLIANCE_SERVICE_DOES_NOT_EXIST

Service does not exist

APPLIANCE_SERVICE_ACTION_INVALID

Action does not exist

Example Request

   POST
   https://1.2.3.4:8443/api/lunasa/services/stc/actions/restart

Example Result

{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': '/tasks/3', 'Content-Length': '2', 'Access-Control-Allow-Credentials': 'true'}

{}

Notes

  • Restarting the network service also restarts CTC service, if it was running.
  • If you restart the network service while connected to the appliance via the network (SSH) or a REST session, you will not lose your connection or the REST session will not be destroyed (assuming no changes were made that would cause a connection loss). However, if you were to stop the network service, you would immediately lose your connection, and you would need to log in via the local console(serial port connection) to start the service again. The same applies for the sshd service.
  • Stopping the network service stops all network traffic (SSH, NTLS, etc.), and any network commands issued thereafter will fail. If the CTC service was running, it also stops. You can start the network service using the service start network command from a serial port connection or by rebooting the appliance using the sysconf appliance reboot command.
  • For CTC service, it will start/stop/restart the service for the active interfaces.