Freeze/Unfreeze of Node-red Flow

It can also be called locking and unlocking of node-red flows. In production environment, there could be possibility that user can unintentionally modify node-red flow. He may wants to play around with flow or create new flow which might not be right to do.

For that matter, oeCloud framework provides two APIs for Node-red. One API will allow to lock the node-red. Once Node-red flows locked, noone would able to change/redeploy the flows again.

To allow to change flows again, user has to unlock the flows.

Locking Node-red

Admin user can issue(calls) lock node-red flow API as below. This is REST API with POST http method.

URL : http://localhost:3000/red/lock?access_token=actual access token

body

{ 
    locked: true, 
    rev: _version 
}

There are two parameters.

  • locked : Value of this is either true or false depending on if you want to lock flows or not.
  • rev : this is actually version number you want to issue. Version you will receive by making call /red/flows end point.
http://localhost:3000/red/flows?access_token=<actual access token>
_version = resp.body.rev; 
  • version is implemented so that more than one user wouldn’t interfere in the operation

Unlocking Node-red

When user has locked the flow, noone can change node-red flows till it is unlocked. Unlock API is exactly same as Lock API except for the locked flag you need to pass with valuse false.

http://localhost:3000/red/lock?access_token=

body

{ 
    locked: false, 
    rev: _version 
}

Note : oeCloud will take care of multi tenancy. Meaning if tenant t1 has locked the flows - that would not mean node-red is locked for another tenant t2. t2 tenant can still work/modify flows.