Module Expr Str ImportFrom alias Import alias Import alias Import alias Import alias ImportFrom alias Assign NameStore Call AttributeLoad NameLoad attr NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Str Call AttributeLoad NameLoad attr Str If CompareIs NameLoad NameLoad body Raise Call NameLoad Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call NameLoad Str NameLoad keyword NameLoad keyword Call AttributeLoad NameLoad attr Dict NameLoad NameLoad Return Call NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str Assign NameStore Call NameLoad Str NameLoad keyword NameLoad keyword NameLoad keyword Str Assign NameStore Call AttributeLoad SubscriptLoad NameLoad Index Str attr Str Dict If CompareIs NameLoad NameLoad body Return NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad kwarg body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Dict Str NameLoad Assign NameStore Call AttributeLoad Str attr Call AttributeLoad NameLoad attr Str Str Call AttributeLoad NameLoad attr Str Call AttributeLoad NameLoad attr Str NameLoad Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad NameLoad keyword NameLoad keyword NameLoad NameLoad If UnaryOpNot Call AttributeLoad Call NameLoad SubscriptLoad NameLoad Index Str attr Str body Assign NameStore Call AttributeLoad NameLoad attr Str Call AttributeLoad Str attr SubscriptLoad NameLoad Index Str Expr Call AttributeLoad NameLoad attr NameLoad Raise Call NameLoad NameLoad Return NameLoad decorator_list
N/A N/A 
Vault Connection Functions

:maintainer:    SaltStack
:maturity:      New
:platform:      all

.. versionadded:: Carbon

This module allows access to Hashicorp Vault using an ``sdb://`` URI.

Like all sdb modules, the vault module requires a configuration profile to
be configured in either the minion or master configuration file. This profile
requires very little. In the example:

.. code-block:: yaml

    myvault:
      driver: vault
      vault.host: 127.0.0.1
      vault.port: 8200
      vault.scheme: http  # Optional; default is https
      vault.token: 012356789abcdef  # Required, unless set in environment

The ``driver`` refers to the ``vault`` module, ``vault.host`` refers to the host
that is hosting vault and ``vault.port`` refers to the port on that host. A
vault token is also required. It may be set statically, as above, or as an
environment variable:

.. code-block:: bash

    $ export VAULT_TOKEN=0123456789abcdef

Once configured you can access data using a URL such as:

.. code-block:: yaml

    password: sdb://myvault/secret/passwords?mypassword

In this URL, ``myvault`` refers to the configuration profile,
``secret/passwords`` is the path where the data resides, and ``mypassword`` is
the key of the data to return.

The above URI is analogous to running the following vault command:

.. code-block:: bash

    $ vault read -field=mypassword secret/passwords
 __future__ absolute_import N/A os N/A logging N/A json N/A salt.utils.http salt.exceptions CommandExecutionError N/A log N/A N/A logging getLogger __name__ _get_token N/A N/A profile N/A N/A N/A 
    Get a token and raise an error if it can't be found
     N/A token N/A N/A N/A os environ get VAULT_TOKEN N/A N/A profile get vault.token N/A N/A token None N/A N/A N/A CommandExecutionError A token was not configured N/A token N/A write_ N/A N/A path key value profile N/A None N/A N/A 
    Set a key/value pair in the vault service
     N/A result N/A _query POST path profile profile data N/A N/A json dumps N/A key value N/A N/A read_ path key profile N/A read_ N/A N/A path key profile N/A None None N/A N/A 
    Get a value from the vault service
     N/A result N/A _query GET path profile profile decode True decode_type json N/A data N/A N/A N/A result N/A dict get data N/A N/A N/A key None N/A N/A data N/A value N/A N/A data get key N/A N/A value None N/A N/A N/A N/A log error The key was not found N/A value N/A _query N/A N/A method path profile N/A None kwargs N/A N/A 
    Perform a query to Vault
     N/A token N/A _get_token profile N/A headers N/A X-Vault-Token token N/A url N/A N/A {0}://{1}:{2}/v1/{3} format N/A N/A profile get vault.scheme https N/A N/A profile get vault.host N/A N/A profile get vault.port path N/A result N/A N/A N/A N/A salt utils http query url method header_dict headers status True kwargs N/A N/A N/A N/A N/A str N/A result N/A status startswith 2 N/A N/A error N/A N/A result get error N/A N/A There was an error: status {0} returned format N/A result N/A status N/A N/A N/A log error error N/A N/A CommandExecutionError error N/A result N/A