REST API  16
REST API for Luna Network HSMs
PUT /api/lunasa/network/devices/{deviceid}/ip4

PUT /api/lunasa/network/devices/{deviceid}/ip4

Sets all ip4 configurations for a specific device.

It is strongly recommended to perform this operation 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.

Use: Required

JSON Schema:

   Object
   type: string
   pattern: ^(eth0|eth1|eth2|eth3|bond0|bond1)$

ip

The ip address to set for the device.

Use: Required

JSON Schema:

   Object
   type: string
   pattern: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$

mask

The subnet mask to set for the device.

Use: Required

JSON Schema:

   Object
   type: integer
   MinValue: 1
   MaxValue: 32

gateway

The default gateway to set for the device.

Use: Required

JSON Schema:

   Object
   type: string
   pattern: ^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$

mode

Mode to be set for the bonded interface only. Default mode for bonded is active-backup. Note: Configiguring LACP bonding mode requires interfaces to be configured with the same speed.

Use: Optional

JSON Schema:

   Object
   type: string
   Pattern: ^(active-backup|broadcast|lacp)$

Responses

204

Success

400

FRAMEWORK_BAD_REQUEST

We failed to parse your request.

401

FRAMEWORK_NO_SESSION_COOKIE

No session cookie was found.

403

OPERATION_RESTRICTED

This operation is forbidden.

404

APPLIANCE_INTERFACE_DOES_NOT_EXIST

Specified interface does not exist.

500

APPLIANCE_FAILED_TO_SET_INTERFACE

Unable to set interface with specified parameters.

Example Request for configuring a non-bonded device

   PUT
   https://1.2.3.4:8443/api/lunasa/network/devices/eth0/ip4
   {
         "ip" : "1.2.3.5",
         "mask" : 24,
         "gateway" : "1.2.3.7"
   }

Example Result

{

}

Example Request for configuring a bond device with default mode

   PUT
   https://1.2.3.4:8443/api/lunasa/network/devices/bond0/ip4
   {
         "ip" : "1.2.3.5",
         "mask" : 24,
         "gateway" : "1.2.3.7"
   }

Example Result

{

}

Example Request for configuring a bond device

   PUT
   https://1.2.3.4:8443/api/lunasa/network/devices/bond0/ip4
   {
         "ip" : "1.2.3.5",
         "mask" : 24,
         "gateway" : "1.2.3.7",
         "mode": "broadcast"
   }

Example Result

{

}

Notes

  • Please ensure the device is configured with valid network configurations.
  • This resource will return a waiting task if you are modifying the device that the web server is currently running on.