Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisPersistFile

int ctMemphisPersistFile( pRCESJson request, ppRCESJson result )

Description:

Persist a File into the Replication Manager Database. If it doesn't exist, create it, otherwise updated it. In order to create a new one, the id must be -1 or not passed. And the update will be done by the ID.

HTTP URL: <baseURL>/ctMemphisPersistFile/

HTTP Verb: POST

Constraints:

  • "volume" must be an existing Volume ID;
  • "filetype" must be an existing FileType ID;
  • "volume" + "path" + "name" must be unique;

Parameters:

  • request [IN] - Persist File request in JSON format. For example:

{

"file": {

"id": -1, // optional, must be an existing

// ID for update

"volume": 1, // required, must be an existing

Volume record ID

"path": "FairCom", // optional, see Note 3 - File Separators

"name": "data", // optional

"size": 11736, // optional

"createTime": "2014-04-07T13:18:09", // optional

"updateTime": "2014-04-07T14:16:39", // optional

"type": 6, // optional

"table": "", // optional

"database": 1, // optional, but if passed, must be

// an existing Database record ID

// (it means it is a table)

}

}

  • result [OUT] - Result in JSON format. For example:

{

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"id": 212

}

Return:

Error code

TOCIndex