Leader

Read Leader Status

Leader.read_leader_status()[source]

Read the high availability status and current leader instance of Vault.

Supported methods:

GET: /sys/leader. Produces: 200 application/json

Returns:

The JSON response of the request.

Return type:

dict

Examples

import hvac
client = hvac.Client(url='https://127.0.0.1:8200')

status = client.sys.read_leader_status()
print('HA status is: %s' % status['ha_enabled'])

Example output:

HA status is: False

Step Down

Leader.step_down()[source]

Force the node to give up active status.

When executed against a non-active node, i.e. a standby or performance standby node, the request will be forwarded to the active node. Note that the node will sleep for ten seconds before attempting to grab the active lock again, but if no standby nodes grab the active lock in the interim, the same node may become the active node again. Requires a token with root policy or sudo capability on the path.

Returns:

The JSON response of the request.

Return type:

dict

Examples

import hvac

client = hvac.Client(url='https://127.0.0.1:8200')
client.sys.step_down()