API Command: set_failover_role

The set_failover_role command sets the failover role of an appliance to either primary or backup.

In order to issue the set_failover_role command, you will need to supply the username and password for a Bomgar user account. That account must have the permission Allowed to Use Command API along with the permission Administrator.

Required Parameter for set_failover_role


The role to assign to this appliance. Can be either primary or backup.

Optional Parameters for set_failover_role


To perform a data sync with the peer appliance before failing over, set this to 1. All users on the existing primary appliance will be disconnected during the data sync, and no other operations will be available until the swap is complete.

To fail over without a final data sync, set this to 0.


This option is only applicable when contacting the primary appliance and attempting to set its role to backup.

If this is set to 1, then this appliance will become the backup even if the peer appliance cannot be contacted.

XML Response for set_failover_role Query


If a data sync is being performed first, returns a message of Successfully started data sync. Role change will occur upon successful completion.

Otherwise, returns a message of Successfully changed role.

<error> Returns an error message if the role was not set successfully.

Query Examples: set_failover_role

Set failover role to primary https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=primary
Set failover role to backup https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=backup
Set failover role to primary and perform a data sync https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=primary&data_sync_first=1
Set failover role to backup and perform a data sync https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=backup&data_sync_first=1
Set failover role to backup even if the primary appliance cannot be contacted https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=backup&force=1
Set failover role to backup even if the primary appliance cannot be contacted, and perform a data sync https://support.example.com/api/command?username=test&password=test&action=set_failover_role&role=backup&data_sync_first=1&force=1