Skip to main content

revertCodePackage

The "revertCodePackage" action reverts the code package to the specified version in the code package history. The purpose is to provide a fast way to revert back to a known good version when new code is not working well.

When you revert a code package to a previous version, the server copies the current version and puts it into version history as is. It then takes the requested version of code from version history, increments the version, replaces the current code with the code from version history, and starts executing the new code.

Request

{
  "authToken": "MyTokenHere",
  "api": "admin",
  "action": "revertCodePackage",
  "params": {
    "databaseName": "faircom",
    "ownerName": "admin",
    "codeName": "myCodeName1",
    "codeVersion": 13
  }
}

"codeVersion" is a required integer value that specifies the code's version stored in the version history.

Minimal example - Revert package
{
  "authToken": "MyTokenHere",
  "api": "admin",
  "action": "revertCodePackage",
  "params": {
    "codeName": "convertTemperature",
    "codeVersion": 1
  }
}