Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space EDITLWSERVER and version 1.0.7

...

The following example shows how to create a transaction, send a serverclass request enlisted in the transaction, and commit the transaction.

Begin the Transaction

Code Block
languagetext
titleRequest
POST http://lightwave.example.com/lightwave/api/v1/transaction HTTP/1.1
Content-Type: application/json
lw-transaction-timeout: 30
Code Block
languagetext
titleResponse
HTTP/1.1 200 OK
Content-Type: application/json
lw-transaction-id: 2c00031c9bb70000380b806a992f7c6e
lw-transaction-state: suspended

Send the Serverclass Request with the Transaction

Code Block
languagetext
titleRequest
POST http://lightwave.example.com/lightwave/api/v1/serverclass/=ne^pathmon/nesvr HTTP/1.1
Content-Type: application/json
lw-transaction-id: 2c00031c9bb70000380b806a992f7c6e
  
{
  "requestCode" : 1
}
Code Block
languagetext
titleResponse
HTTP/1.1 200 OK
Content-Type: application/json
lw-transaction-id: 2c00031c9bb70000380b806a992f7c6e
lw-transaction-state: suspended
  
{
  "resultCode": 0,
  "node": "\\ACT5",
  "systemInfo": {
    "nodeNumber": 43,
    "systemSubvol": "SYS03",
    "rvu": "G06"
  }
}

Commit the Transaction

Code Block
languagetext
titleRequest
POST http://lightwave.example.com/lightwave/api/v1/transaction/2c00031c9bb70000380b806a992f7c6e HTTP/1.1
Content-Length: 0
Code Block
languagetext
titleResponse
HTTP/1.1 200 OK
Content-Type: application/json
lw-transaction-id: 2c00031c9bb70000380b806a992f7c6e
lw-transaction-state: committed




LightWave Server 1.0.10