Uploading and applying a pre-shared key file by using REST Administration APIs

System administrators can upload a pre-shared key file to Eclipse Amlen by using the Eclipse Amlen REST API FILE method. System administrators can then apply the pre-shared key file by using the Eclipse Amlen REST API POST method.

You can upload a pre-shared key file by using the Eclipse Amlen REST API FILE method. You can then apply the pre-shared key file by using the Eclipse Amlen REST API POST method. If you apply a new pre-shared key file, the existing pre-shared key file is overwritten without warning.

  1. Upload a pre-shared key file to Eclipse Amlen by using the following Eclipse Amlen REST API PUT method:

    curl -X PUT -T <PreSharedKeyFilePath and FileName> http://<admin-endpoint-IP:Port>/ima/v1/file/<PreSharedKeyFileName>

    Note: The supported file format of a pre-shared key file is CSV.
  2. Use the REST API POST method to apply the pre-shared key file and provide pre-shared key object configuration data in the payload:
    1. Apply the pre-shared key file, by using the Eclipse Amlen REST API POST method with the following Eclipse Amlen configuration URI:

      http://<admin-endpoint-IP:Port>/ima/v1/configuration/

    2. Provide pre-shared key object configuration data in the payload of the POST method by using the following schema. Content-type is set to application/json. Ensure that capitalization and double quotation marks are used as shown.
      
      {  
        "PreSharedKey":"<PreSharedKeyFileName>"
      }
      Where:
      PreSharedKeyFileName
      Required.
      Specifies the name of the pre-shared key file.
The following example shows uploading a pre-shared key file by using cURL:

curl -X PUT -T /var/tmp/MyPreSharedKeyFile.csv http://127.0.0.1:9089/ima/v1/file/myPSKfile_201603016.csv
The following example shows applying a pre-shared key file called "myPSKfile_201603016.csv" by using cURL:

curl -X POST \
   -H 'Content-Type: application/json'  \
   -d  '{
         "PreSharedKey": "myPSKfile_201603016.csv"  
        }
      '  \
http://127.0.0.1:9089/ima/v1/configuration/
The following shows an example response to the POST method.

{        
  "Version": "v1",
  "Code": "CWLNA6011",
  "Message": "The requested configuration change has completed successfully."
}