Vault | C# SDK | General Endpoints
General Endpoints
Change state
VaultClient.StateChange(string, int, ItemVersionState)Change the state of a specific version of a secret or key.
var response = await client.StateChange(
"pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5",
1,
ItemVersionState.Deactivated
);
Delete
VaultClient.Delete(string)Delete a secret, key or folder.
await client.Delete("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5");
Retrieve
VaultClient.Get(GetRequest)Retrieve a secret, key or folder, and any associated information.
var request = new GetRequest
("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5")
;
var response = await client.Get(request);
Get Bulk
VaultClient.GetBulk(GetBulkRequest)Retrieve a list of secrets, keys and folders.
var response = await client.GetBulk(new()
{
Filter = new Dictionary<string, string>()
{
{ "id", "pvi_123" }
}
});
List
VaultClient.List(ListRequest)Retrieve a list of secrets, keys and folders, and their associated information.
var request = new ListRequest();
var response = await client.List(request);
Update
VaultClient.Update(UpdateRequest)Update information associated with a secret, key or folder.
var request = new UpdateRequest
("pvi_p6g5i3gtbvqvc3u6zugab6qs6r63tqf5")
.WithFolder("/personal")
;
var response = await client.Update(request);