REST API  17
REST API for Luna Network HSMs
POST /api/lunasa/ntp/servers

POST /api/lunasa/ntp/servers

This resource adds an NTP server.

User Privileges

Users with the following role privileges can perform this command:

  • admin
  • operator

Parameters

address

Specifies the address of the NTP server, accepts an ip address or hostname.This parameter will be validated.

Use: Required

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])?)$

isBurstEnabled

Specifies flag controlling sending a burst of packets instead of usual single packet.

Use: Optional

JSON Schema:

    Object
    type:boolean

isInitialBurstEnabled

Specifies flag controlling sending a burst of packets when an initial connection cannot be established.

Use: Optional

JSON Schema:

    Object
    type:boolean

keyId

Specifies the key id used in communication with the NTP server.

Use: Optional

JSON Schema:

    Object
    type:integer
    minimum: 1
    maximum: 65535

nts

Specifies flag controlling enabling nts authentication.

Use: Optional

JSON Schema:

    Object
    type:boolean

isPreferredServer

Specifies flag designating this server as the preferred one.

Use: Optional

JSON Schema:

    Object
    type:boolean

protocolVersion

Specifies the protocol version used in communication with the NTP server. Note: NTS Authentication is supported with protocol version 4 only.

Use: Optional

JSON Schema:

    Object
    type:integer
    minimum: 3
    maximum: 4

port

Specifies the port used in communication with the NTP server. Default port is 4460. Note: This parameter can only be used with NTS Authentication.

Use: Optional

JSON Schema:

    Object
    type:integer
    minimum: 0
    maximum: 65535

Responses

204

Success.

Location

"Location" is the URL to the newly created NTP server.

see GET /api/lunasa/ntp/servers/{serverid}

400

FRAMEWORK_BAD_REQUEST

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

NTP_INVALID_AUTHENTICATION

Parameters used for ntp authentication are invalid.

NTP_INVALID_VERSION_WITH_NTS

Version used with nts authentication is not supported.

NTP_CANNOT_USE_PORT_WITHOUT_NTS

Cannot add an NTS-KE port without using NTS.

NTP_SERVER_INVALID

Specified server is invalid.

403

NTP_SERVER_DUPLICATE

Specified server already does exist.

500

NTP_OPERATION_FAILED

Unable to perform requested operation.

Example Request for KeyId Authentication

    POST
    https://1.2.3.4:8443/api/lunasa/ntp/servers
    {
       "isInitialBurstEnabled": true,
       "isBurstEnabled": false,
       "isPreferredServer": true,
       "nts": false,
       "keyId": 10,
       "protocolVersion": 3,
       "address": "example.com"
    }

Example Request for NTS Authentication

    POST
    https://1.2.3.4:8443/api/lunasa/ntp/servers
    {
       "isInitialBurstEnabled": true,
       "isBurstEnabled": false,
       "isPreferredServer": true,
       "nts": true,
       "port": 4430,
       "protocolVersion": 4,
       "address": "example.com"
    }

Example Response

    {
    }

Notes

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