Product Documentation

FairCom Replication JSON RPC API

Previous Topic

Next Topic

ctMemphisPersistHardware

int ctMemphisPersistHardware( pRCESJson request, ppRCESJson result )

Description:

Persist a Hardware 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>/ctMemphisPersistHardware/

HTTP Verb: POST

Constraints:

  • "site" must be an existing Site ID.
  • "name" is not NULL, not EMPTY and Unique per Site.
  • "macList" must have at least one MAC address to be searched later.

Parameters:

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

{

"hardware": {

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

existing ID for update

"site": 0, // required

"name": "hardware3", // required

"macList": [ // required

{

"mac": "22-22-22-22-22-22",

"type": "ethernet"

},

{

"mac": "22-22-22-22-22-23",

"type": "ethernet"

}

],

"description": "hardware 3 description", // optional

"memory": 16, // optional

"diskSpace": 1000, // optional

"cpu": 8 // optional

}

}

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

{

"success": true,

"error":

{

"errorCode": 0,

"message": "Success"

},

"id": 2

}

Return:

Error code

TOCIndex