The "revertCodePackage" action provides 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 example
Minimal
{
"action": "revertCodePackage",
"params": {
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 13
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Response example
Minimal
{
"debugInfo": {
"request": {
"api": "admin",
"action": "revertCodePackage",
"params": {
"databaseName": "faircom",
"ownerName": "admin",
"codeName": "convertTemperature",
"codeVersion": 1
},
"debug": "max",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
},
"errorCode": 0,
"errorMessage": "",
"authToken": "replaceWithAuthTokenFromCreateSession"
}
Properties
Request properties ("params")
| Property | Description | Default | Type | Limits (inclusive) |
|---|---|---|---|---|
codeName |
The It is an error to set The package's unique identifier is the combination of |
Required - No default value | string | 1 to 64 bytes |
codeVersion |
The "codeVersion" property specifies the code's version stored in the version history. |
Required - No default value | integer |
0 to 2147483647
|
databaseName |
The You specify this property when you want to use a different database instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in multiple databases. This feature allows you to create multiple environments in the same server and reuse the same JSON actions in each environment. For example, you can create It is an error to set If no default database is specified during |
Defaults to the session's "defaultDatabaseName" property |
string | 1 to 64 bytes |
ownerName |
The You specify this property when you want to use a different account instead of the default. Your session's account must have the appropriate privileges to access the code package. This property is useful because objects, such as tables and code packages, can have the same name in the same database as long as different accounts own each object. This feature allows you to create duplicate objects for different users on the same server and reuse the same JSON actions on those objects. For example, an administrator can copy objects from a production environment to her account so she can troubleshoot an issue using the same JSON actions, JavaScript, and SQL code. It is an error to set If no default owner is specified during |
Optional with default of the session's "defaultOwnerName" property |
string | 1 to 64 bytes |