REST API  17
REST API for Luna Network HSMs
DELETE /api/lunasa/network/devices/{deviceid}/routes/{routeid}

DELETE /api/lunasa/network/devices/{deviceid}/routes/{routeid}

Removes a specific route.

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

Specifies the id of the device.

Use: Required

JSON Schema:

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

routeid

Specifies the id of the route.

Use: Required

JSON Schema:

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

routeType

The parameter to determine the route to be set is a host route or network.

Use: Required

JSON Schema:

   Object
   type:string
   minLength: 4
   maxLength: 7
   pattern: ^(host|network)$

destination

The IP address or the hostname to route to. It must be calculated with the mask provided.

Use: Required

JSON Schema:

   Object
   type: string
    minLength: 7
    maxLength: 39
    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]?)|([a-fA-F0-9]{1,4}:){1,7}[a-fA-F0-9]{1,4})$

netmask

The subnet mask to set for the device.
Default value of network route is "255.255.255.0" .

Use: Not 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]?$)|([0-9]{1,2}|1[01][0-9]|12[0-8]))$

gateway

The default gateway to set for the device. Note: This parameter is mandatory to provide while deleting a route if the same has been provided while adding a route.

Use: Optional

JSON Schema:

   Object
   type: string
    minLength: 7
    maxLength: 39
    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]?)|([a-fA-F0-9]{1,4}:){1,7}[a-fA-F0-9]{1,4})$

metric

Specifies the path the router should take.

Use: Optional

JSON Schema:

   Object
   type: int
   minimum: 0
   maximum: 65535

isIPv6

The flag to determine the route to be added has IPv6 address. Flag is set to false by default.

Use: Optional

JSON Schema:

   Object
   type:boolean

Responses

204

Success

400

Unexpected error or device is slave of an active bond or bad request.

400

FRAMEWORK_BAD_REQUEST

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

404

APPLIANCE_INTERFACE_DOES_NOT_EXIST

Specified interface does not exist.

Example Request

    DELETE
    https://1.2.3.4:8443/api/lunasa/network/devices/eth0/routes/192.168.0.0_24_s_50
    {
        "routeType" : "network",
        "destination" : "192.168.0.0",
        "netmask" : "255.255.255.0",
        "gateway" : "192.168.0.1",
        "metric" : 105,
       "isIPv6": false
    }

Example Response

{}

Notes

  • Deleting the only default route present in the appliance routing table may cause remote connection to lose with the appliance.
  • This resource will return a waiting task.