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.

If the node does not have active status, this endpoint does nothing. 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()