public interface VaultOperations
VaultTemplate
. This is the main entry point to interact with Vault in an
authenticated and unauthenticated context.
VaultOperations
allows execution of callback methods. Callbacks can execute
requests within a session
context
and the without a
session
.
doWithSession(RestOperationsCallback)
,
doWithVault(RestOperationsCallback)
,
RestOperations
,
VaultTemplate
,
VaultTokenOperations
,
SessionManager
Modifier and Type | Method and Description |
---|---|
void |
delete(String path)
Delete a path.
|
<T> T |
doWithSession(RestOperationsCallback<T> sessionCallback)
Executes a Vault
RestOperationsCallback . |
<T> T |
doWithVault(RestOperationsCallback<T> clientCallback)
Executes a Vault
RestOperationsCallback . |
List<String> |
list(String path)
Enumerate keys from a Vault path.
|
VaultPkiOperations |
opsForPki() |
VaultPkiOperations |
opsForPki(String path)
Return
VaultPkiOperations if the PKI backend is mounted on a different path
than pki . |
VaultSysOperations |
opsForSys() |
VaultTokenOperations |
opsForToken() |
VaultTransitOperations |
opsForTransit() |
VaultTransitOperations |
opsForTransit(String path)
Return
VaultTransitOperations if the transit backend is mounted on a
different path than transit . |
VaultResponse |
read(String path)
Read from a Vault path.
|
<T> VaultResponseSupport<T> |
read(String path,
Class<T> responseType)
Read from a secret backend.
|
default VaultResponse |
write(String path)
Write to a Vault path.
|
VaultResponse |
write(String path,
Object body)
Write to a Vault path.
|
VaultSysOperations opsForSys()
VaultTokenOperations opsForToken()
VaultTransitOperations opsForTransit()
VaultTransitOperations opsForTransit(String path)
VaultTransitOperations
if the transit backend is mounted on a
different path than transit
.path
- the mount pathVaultPkiOperations opsForPki()
VaultPkiOperations opsForPki(String path)
VaultPkiOperations
if the PKI backend is mounted on a different path
than pki
.path
- the mount path@Nullable VaultResponse read(String path)
path
- must not be null.@Nullable <T> VaultResponseSupport<T> read(String path, Class<T> responseType)
path
- must not be null.responseType
- must not be null.@Nullable List<String> list(String path)
path
- must not be null.@Nullable default VaultResponse write(String path)
path
- must not be null.@Nullable VaultResponse write(String path, @Nullable Object body)
path
- must not be null.body
- the body, may be null if absent.void delete(String path)
path
- must not be null.@Nullable <T> T doWithVault(RestOperationsCallback<T> clientCallback) throws VaultException, RestClientException
RestOperationsCallback
. Allows to interact with Vault
using RestOperations
without requiring a
session.clientCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.RestClientException
- exceptions from
RestOperations
.@Nullable <T> T doWithSession(RestOperationsCallback<T> sessionCallback) throws VaultException, RestClientException
RestOperationsCallback
. Allows to interact with Vault in
an authenticated session.sessionCallback
- the request.RestOperationsCallback
return value.VaultException
- when a
HttpStatusCodeException
occurs.RestClientException
- exceptions from
RestOperations
.Copyright © 2016–2018 Pivotal Software, Inc.. All rights reserved.