REST API  4.0.0
REST API for SafeNet Network HSMs
POST /api/lunasa/ntls/clients

POST /api/lunasa/ntls/clients

Registers a client with the appliance.

Parameters

ip

The IP address of the client

Use: Required

JSON Schema:

   Object
   type: string

clientName

The human-friendly name used to reference the client

Use: Required

JSON Schema:

   Object
   type: string

certificate

The PEM-encoded certificate for the client

Use: Required

JSON Schema:

   Object
   type: string

Responses

200

The client identifier registered with the appliance. Response includes the URL to the client identifier to obtain additional information.

JSON Schema:

   Object
   client: Object
        type:  string
        description:  client is the name of the client registered with the appliance.

Location

JSON Schema:

    id: Object
        type: string

see GET /api/lunasa/ntls/clients/{clientid}

400

Unexpected error

Example Request

   POST 
   https://1.2.3.4:8443//api/lunasa/ntls/clients
   {"ip": "1.2.3.4", "certificate": "-----BEGIN CERTIFICATE-----\n...<certificate>...\n-----END CERTIFICATE-----", "clientName": "testClient3"}

Example Result

{'Access-Control-Allow-Origin': '*', 'Content-Type': 'application/json', 'Location': 'api/lunasa/ntls/clients/testClient3', 'Content-Length': '2', 'Access-Control-Allow-Credentials': 'true'}

{
    "client": "testClient3"
}

Notes

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


To form the "certificate" parameter, use "\n" to delimit end of lines. The following diagram highlights where the delimiter is needed.

Where to end lines with delimiter


Here is a partial "certificate" parameter to show the use of the delimiter.

"-----BEGIN CERTIFICATE-----\nMIIDJzCCAg+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBXMQswCQYDVQQGEwJDQTEQ\nMA4GA1UECAwHT250YXJpbzEPMA0GA1UEBwwGT3R0YXdhMRMwEQYDVQQKDApNeSBj\n
                             ^                                                                 ^                                                                 ^