Back to Redis

Upgrade

content/operate/rs/7.4/references/rest-api/requests/bdbs/upgrade.md

latest3.1 KB
Original Source
MethodPathDescription
POST/v1/bdbs/{uid}/upgradeUpgrade database

Upgrade database {#post-bdbs-upgrade}

POST /v1/bdbs/{int: uid}/upgrade

Upgrade a database.

Required permissions

Permission name
[update_bdb_with_action]({{< relref "/operate/rs/7.4/references/rest-api/permissions#update_bdb_with_action" >}})

Request {#post-request}

Example HTTP request

POST /v1/bdbs/1/upgrade 

Example JSON body

json
{
    "swap_roles": true,
    "may_discard_data": false
}

Request headers

KeyValueDescription
Hostcnm.cluster.fqdnDomain name
Acceptapplication/jsonAccepted media type

Request body

FieldTypeDescription
force_restartbooleanRestart shards even if no version change (default: false)
keep_redis_versionbooleanKeep current Redis version (default: false)
keep_crdt_protocol_versionbooleanKeep current crdt protocol version (default: false)
may_discard_databooleanDiscard data in a non-replicated, non-persistent bdb (default: false)
force_discardbooleanDiscard data even if the bdb is replicated and/or persistent (default: false)
preserve_rolesbooleanPreserve shards' master/replica roles (requires an extra failover) (default: false)
parallel_shards_upgradeintegerMax number of shards to upgrade in parallel (default: all)
moduleslist of modulesList of dicts representing the modules that will be upgraded.
</br>Each dict includes:
</br>current_module: uid of a module to upgrade
</br>new_module: uid of the module we want to upgrade to
</br>new_module_args: args list for the new module (no defaults for the three module-related parameters).
redis_versionversion numberUpgrades the database to the specified Redis version instead of the latest version
latest_with_modulesbooleanUpgrades the database to the latest Redis version and latest supported versions of modules available in the cluster

Response {#post-response}

Returns the upgraded [BDB object]({{< relref "/operate/rs/7.4/references/rest-api/objects/bdb" >}}).

Example JSON body

json
{
    "uid": 1,
    "replication": true,
    "data_persistence": "aof",
    "// additional fields..."
}

Status codes {#post-status-codes}

CodeDescription
200 OKSuccess, bdb upgrade initiated (action_uid can be used to track progress)
400 Bad RequestMalformed or bad command
404 Not Foundbdb not found
406 Not AcceptableNew module version capabilities don't comply with the database configuration
500 Internal Server ErrorInternal error