The Buffer File Control API

Using the Buffer File Control API, you can delete or move the buffer files. It is recommended to move the buffer files to a new folder within the same drive.
Note: Moving files to a network shared drive is not supported.
METHOD PUT
URI
https://<historianservername>/historian-rest-api/v1/collector/buffercontrol
SAMPLE URI Sample URI for moving buffer files:
https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Payload
{
  “interfaceName":"<source server>_<type of the collector>_<destination server>",
  “bufferMode”:2,
     "winUserName":"Administrator",
        "winPassword":"xxxxxxx",
  "bufferPath": "C:\\Users\\bufffiles"                      
}
Sample URI for deleting buffer files:

https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Payload
{
  “interfaceName":"<source server>_<type of the collector>_<destination server>",
  “bufferMode”:1   
 "winUserName":"Administrator",
        "winPassword":"xxxxxxx",                   
}
SAMPLE RESPONSE Sample response for moving buffer files:
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "BufferFiles Move Initiated. Collector is in the Stopped state."
}
Sample response for deleting buffer files:
{
    "ErrorCode": 0,
    "ErrorMessage": null,
    "Data": "BufferFiles Delete Initiated. Collector is in the Stopped state."
}
SAMPLE cURL COMMAND
curl -i -H "Accept: application/json" -i -H "Content-Type: application/json" 
-H "Authorization: Bearer <TOKEN>” -d 
“{ \”interfaceName\”:\”<source server>_<type of the collector>_<destination server>\”,
\”bufferMode \”:1,\”bufferPath \”:\” C:\\Users\\bufffiles\”}” -X PUT https://<historianservername>/historian-rest-api/v1/collector/buffercontrol

Query Parameters

Query parameters include the Payload parameter, which is a JSON file, which contains the following properties.

Parameter Description Required? Values
interfaceName The interface name of the collector. Yes String
bufferMode Indicates whether you want to move or delete the files. Yes
  • 1: Indicates that the buffer files will be deleted.
  • 2: Indicates that the buffer files will be moved to the location specified in the bufferPath parameter.
bufferPath The directory to which you want to move the buffer files. For example: C:\\Data\\NewBufferFilesLocation or C:/Data/NewBufferPathLocation
Note: The double slash (\\) is required in the JSON format.
Yes (only if you want to move the buffer files) String
winUserName The Windows username. Yes (only if you want to use the command-line mode) String
winPassword The Windows password Yes (only if you want to use the command-line mode) String

Response Parameters

Parameter Data Type Required? Description
ErrorCode Integer Yes For example, ErrorCode = 0 implies the operation was successful.
ErrorMessage String Yes For example, NULL.
Data String No Indicates if the task has been initiated (and if the collector is in the stopped state).