admin.databaseSetBackupEncryptionKey( config as element(configuration), database-id as (Number|String), backup-encryption-key as String ) as element(configuration)
This function sets which key encryption key to use for encryption of backup
for the database identified by database-id
. This can only be
set when an external KMS is configured.
Parameters | |
---|---|
config | A configuration specification, typically as returned from one of the Admin module functions. |
database-id |
The ID of the database to set (for example,
xdmp.database("myDatabase") ).
|
backup-encryption-key | A string represents the backup encryption key. It can be either cluster-key or database-key. |
//This configures the database to use the database key for backup encryption. const admin = require('/MarkLogic/admin.xqy'); const config = admin.getConfiguration(); admin.databaseSetBackupEncryptionKey(config, xdmp.database('myDatabase'), 'database-key'); // Returns the new configuration element -- use admin.saveConfiguration to save // the changes to the configuration or pass the configuration to other Admin API // functions to make other changes.