use of com.amazonaws.services.glacier.model.ListVaultsRequest in project glacier-cli by carlossg.
the class Glacier method list.
public void list() {
String msg = "Listing ...";
System.out.println(msg);
try {
ListVaultsResult vaults = client.listVaults(new ListVaultsRequest());
for (DescribeVaultOutput vault : vaults.getVaultList()) {
System.out.println("----");
System.out.println("Vault : " + vault.getVaultName() + "\n\tCreation date : " + vault.getCreationDate() + "\n\tNumber of archives : " + vault.getNumberOfArchives() + "\n\tVault size : " + vault.getSizeInBytes() + "\n\tLast inventory date : " + vault.getLastInventoryDate());
}
} catch (Exception e) {
throw new RuntimeException("Error " + msg, e);
}
}
use of com.amazonaws.services.glacier.model.ListVaultsRequest in project aws-doc-sdk-examples by awsdocs.
the class ListVaults method main.
public static void main(String[] args) {
final AmazonGlacier glacier = AmazonGlacierClientBuilder.defaultClient();
ListVaultsRequest request = new ListVaultsRequest();
boolean list_complete = false;
int total_vaults = 0;
System.out.println("Your Amazon Glacier vaults:");
while (!list_complete) {
ListVaultsResult result = glacier.listVaults(request);
List<DescribeVaultOutput> vault_list = result.getVaultList();
for (DescribeVaultOutput v : vault_list) {
total_vaults += 1;
System.out.println("* " + v.getVaultName());
}
// check for further results.
String marker = result.getMarker();
if (marker != null) {
request.setMarker(marker);
} else {
list_complete = true;
}
}
if (total_vaults == 0) {
System.out.println(" no vaults found.");
}
}
use of com.amazonaws.services.glacier.model.ListVaultsRequest in project SAGU by brianmcmichael.
the class SAGU method repopulateVaults.
private void repopulateVaults(String accessString, String secretString) {
int newLoc = getServerRegion();
if (!(getAccessKey().equals("") || getSecretKey().equals(""))) {
AmazonGlacierClient newVaultCheckClient = makeClient(accessString, secretString, newLoc);
String marker = null;
vaultSelector.removeAllItems();
vaultSelector.addItem("Select Existing:");
do {
ListVaultsRequest lv = new ListVaultsRequest().withMarker(marker).withLimit("1000");
ListVaultsResult lvr = newVaultCheckClient.listVaults(lv);
ArrayList<DescribeVaultOutput> vList = new ArrayList<DescribeVaultOutput>(lvr.getVaultList());
marker = lvr.getMarker();
for (DescribeVaultOutput vault : vList) {
vaultSelector.addItem(vault.getVaultName());
}
} while (marker != null);
}
}
Aggregations