File: raft.rst

package info (click to toggle)
python-hvac 2.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,800 kB
  • sloc: python: 29,360; makefile: 42; sh: 14
file content (119 lines) | stat: -rw-r--r-- 2,533 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
Raft
====

:py:meth:`hvac.api.system_backend.Raft`

.. contents::
   :local:
   :depth: 1

Join Raft Cluster
-----------------

:py:meth:`hvac.api.system_backend.Raft.join_raft_cluster`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.join_raft_cluster(
        leader_api_addr='https://some-vault-node',
    )

Read Raft Configuration
-----------------------

:py:meth:`hvac.api.system_backend.Raft.read_raft_config`

.. code:: python

    import hvac
    client = hvac.Client()

    raft_config = c.sys.read_raft_config()
    num_servers_in_cluster = len(raft_config['data']['config']['servers'])

Remove Raft Node
----------------

:py:meth:`hvac.api.system_backend.Raft.remove_raft_node`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.remove_raft_node(
        server_id='i-somenodeid',
    )

Read Raft Auto-Snapshot Status
------------------------------

:py:meth:`hvac.api.system_backend.Raft.read_raft_auto_snapshot_status`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.read_raft_auto_snapshot_status("my-local-auto-snapshot")

Read Raft Auto-Snapshot Configuration
-------------------------------------

:py:meth:`hvac.api.system_backend.Raft.read_raft_auto_snapshot_config`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.read_raft_auto_snapshot_config("my-local-auto-snapshot")

List Raft Auto-Snapshot Configurations
--------------------------------------

:py:meth:`hvac.api.system_backend.Raft.list_raft_auto_snapshot_configs`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.list_raft_auto_snapshot_configs()

Create or Update Raft Auto-Snapshot Configuration
-------------------------------------------------

:py:meth:`hvac.api.system_backend.Raft.create_or_update_raft_auto_snapshot_config`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.create_or_update_raft_auto_snapshot_config(
        name="my-local-auto-snapshot",
        interval="1d",
        storage_type="local",
        retain=5,
        local_max_space="100000",
        path_prefix="/opt/vault/backups",
        file_prefix="vault-raft-auto-snapshot"
    )

Delete Raft Auto-Snapshot Configuration
---------------------------------------

:py:meth:`hvac.api.system_backend.Raft.delete_raft_auto_snapshot_config`

.. code:: python

    import hvac
    client = hvac.Client()

    client.sys.delete_raft_auto_snapshot_config(
        name="my-local-auto-snapshot",
    )