REST API  14
REST API for Luna Network HSMs
POST /api/lunasa/network/devices/{deviceid}/actions/{actionid}

POST /api/lunasa/network/devices/{deviceid}/actions/{actionid}

Performs the specified action on a bond device. The actions available are "enable" and "disable".

It is strongly recommended to perform these actions through the serial connection to the appliance in order to avoid any loss of connection with the appliance.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

deviceid

The identifier of a network device. The deviceid can be the bond device created on the appliance, i.e. bond0 , bond1.

Use: Required

JSON Schema:

    Object
    type: string

actionid

This parameter specifies the id of the action to be performed. Could be action "enable" or "disable".

Use: Required

JSON Schema:

    Object
    type:string

keepRoutes

Indicates whether to preserve or delete all non-default routes configured to the bond device which is being disabled. This request parameter is sent with action 'disable'.

Use: Required

JSON Schema:

    Object
    type:boolean
         false = do not keep routes
         true = do keep routes

Responses

200

Success

400

Unexpected error occured.

404

No action matched

400

FRAMEWORK_BAD_REQUEST

Failed to execute due to malformed request.

400

BOND_DEVICE_IS_NOT_CONFIGURED

Bond device specified is not configured.

400

BOND_DEVICE_IS_ALREADY_ENABLED

Bond device specified is already enabled.

400

BOND_DEVICE_IS_ALREADY_DISABLED

Bond device specified is already disabled.

400

APPLIANCE_FAILED_TO_ENABLE_BOND_DEVICE

Failed to enable the bond device.

400

APPLIANCE_FAILED_TO_DISABLE_BOND_DEVICE

Failed to disable the bond device.

400

APPLIANCE_INVALID_DEVICE_TYPE

Device type specified is invalid.

Example Request

For 'enable':

    POST
    https://1.2.3.4:8443/api/lunasa/network/devices/bond0/actions/enable
    {}

For 'disable':

    POST
    https://1.2.3.4:8443/api/lunasa/network/devices/bond0/actions/disable
    {
      "keepRoutes" : false
    }

Example Response

    {}

Notes

  • It is strongly recommended to have the webserver service bind to 'all'.
  • Please ensure the bond device is configured with valid network configurations.
  • This resource will return a waiting task.