Interface VaultClient
RestClient.
Use static factory methods create(), create(String), or
builder() to prepare an instance. To use the same
configuration as a RestClient, use builder(RestClient) or
builder(RestTemplate) respectively.
VaultClient is intended to be used with relative paths requiring a
VaultEndpoint to be configured. Without an endpoint, callers must provide the absolute URL for
each request.
For examples with a response body see:
For examples with a request body see:
- Since:
- 4.1
- Author:
- Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA mutable builder for creating aVaultClient.static interfaceVaultClient.PathSpec<S extends VaultClient.RequestHeadersSpec<?>>Contract for specifying the path for a request.static interfaceContract for specifying request headers and body leading up to the exchange.static interfaceContract for specifying request headers, body and path for a request.static interfaceContract for specifying request headers and path for a request.static interfaceContract for specifying request headers leading up to the exchange.static interfaceContract for specifying response operations following the exchange. -
Method Summary
Modifier and TypeMethodDescriptionstatic VaultClient.Builderbuilder()Obtain aVaultClientbuilder.static VaultClient.Builderbuilder(RestClient restClient) Obtain aVaultClientbuilder based on the configuration of the givenRestClient.static VaultClient.Builderbuilder(RestTemplate restTemplate) Obtain aVaultClientbuilder based on the configuration of the givenRestTemplate.static VaultClientcreate()Create a newVaultClient.static VaultClientVariant ofcreate()that accepts a default base URL.static VaultClientcreate(VaultEndpoint endpoint) Variant ofcreate()that accepts a defaultVaultEndpoint.static VaultClientcreate(VaultEndpointProvider endpointProvider) Variant ofcreate()that accepts a defaultVaultEndpointProvider.delete()Start building an HTTP DELETE request.get()Start building an HTTP GET request.method(HttpMethod method) Start building a request for the givenHttpMethod.mutate()Return a builder to create a newVaultClientwhose settings are replicated from thisVaultClient.post()Start building an HTTP POST request.put()Start building an HTTP PUT request.
-
Method Details
-
get
VaultClient.RequestHeadersPathSpec<?> get()Start building an HTTP GET request.- Returns:
- a spec for specifying the target path.
-
post
Start building an HTTP POST request.- Returns:
- a spec for specifying the target path.
-
put
Start building an HTTP PUT request.- Returns:
- a spec for specifying the target path.
-
delete
VaultClient.RequestHeadersPathSpec<?> delete()Start building an HTTP DELETE request.- Returns:
- a spec for specifying the target path.
-
method
Start building a request for the givenHttpMethod.- Returns:
- a spec for specifying the target path.
-
mutate
VaultClient.Builder mutate()Return a builder to create a newVaultClientwhose settings are replicated from thisVaultClient. -
create
Create a newVaultClient.- See Also:
-
create
Variant ofcreate()that accepts a default base URL. For more details seeVaultClient.Builder.endpoint(VaultEndpoint).- Parameters:
baseUrl- the base URI for all requests.- See Also:
-
create
Variant ofcreate()that accepts a defaultVaultEndpoint. For more details seeVaultClient.Builder.endpoint(VaultEndpoint).- Parameters:
endpoint- the Vault Endpoint for all relative path requests.- See Also:
-
create
Variant ofcreate()that accepts a defaultVaultEndpointProvider. For more details seeVaultClient.Builder.endpoint(VaultEndpointProvider).- Parameters:
endpointProvider- the endpoint provider for all relative path requests.- See Also:
-
builder
Obtain aVaultClientbuilder. -
builder
Obtain aVaultClientbuilder based on the configuration of the givenRestTemplate.The
RestTemplatemust be configured with appropriateHttpMessageConvertersto support String, byte[], and JSON conversion. Additionally, if the template is configured to use a base URL, the builtVaultClientcan be used with relative paths. The returned builder is configured with the following attributes of the template:- Parameters:
restTemplate- the rest template to base the returned builder's configuration on.- Returns:
- a
VaultClientbuilder initialized withrestTemplate's configuration. - See Also:
-
builder
Obtain aVaultClientbuilder based on the configuration of the givenRestClient.The
RestClientmust be configured with appropriateHttpMessageConvertersto support String, byte[], and JSON conversion. Additionally, if the client is configured to use a base URL, the builtVaultClientcan be used with relative paths.- Parameters:
restClient- theRestClientto base the returned builder's configuration on.- Returns:
- a
VaultClientbuilder initialized withrestClient's configuration.
-