Skip to main content

Vault | Java SDK | General Endpoints

General Endpoints

List

getBulk(GetBulkRequest request)

Retrieve a list of secrets, keys and folders.

required parameters

GetBulkRequest

Request parameters.

Response Object

ListResponse

A list of items.

 final var filter = new HashMap<String, String>();
 filter.put("folder", "/tmp");
 final var response = client.getBulk(GetBulkRequest.builder().filter(filter).build());

State change

stateChange(String id, ItemVersionState state, int version, String destroyPeriod)

Change the state of a specific version of a secret or key.

required parameters

String

Item id to change.

ItemVersionState

State to set to item version.

int

Item version to change.

String

Response Object

StateChangeResponse

StateChangeResponse

 final var stateChangeResponse = client.stateChange("id", ItemVersionState.DEACTIVATED);

Delete

delete(String id)

Delete a secret or key.

required parameters

String
  • item id to delete

Response Object

DeleteResponse

DeleteResponse

 DeleteResponse deleteResponse = client.delele("id");

Retrieve

get(GetRequest request)

Retrieve a secret or key, and any associated information.

required parameters

GetRequest
  • request to /get endpoint

Response Object

GetResponse

GetResponse

 GetResponse getResponse = client.get(
 	new GetRequest.GetRequestBuilder("id").build()
 );

List

list(ListRequest request)

Retrieve a list of secrets, keys and folders, and their associated information.

required parameters

ListRequest
  • request parameters to send to list endpoint

Response Object

ListResponse

ListResponse

 ListResponse listResponse = client.list(
 	new ListRequest.ListRequestBuilder().build()
 );

Update

update(UpdateRequest request)

Update information associated with a secret or key.

required parameters

UpdateRequest
  • request parameters to send to update endpoint

Response Object

UpdateResponse

UpdateResponse

 UpdateResponse updateResponse = client.update(
 	new UpdateRequest.UpdateRequestBuilder("id")
 	.setFolder("updated")
 	.build()
 );