Java 类com.amazonaws.services.glacier.model.ListVaultsRequest 实例源码

项目:meta-glacier    文件:AllVaults.java   
/**
 * Returns a list of <b>DescribeVaultOutput</b> for the AWS account.
 * This always make a call to AWS.
 *
 * @return list of <code>DescribeVaultOutput>
 * @throws Exception
 */
public List<DescribeVaultOutput> list() throws Exception{
    String marker = null;
    ListVaultsResult listVaultsResult = null;

    do {
        LGR.fine("getting vaults up to 100");
        ListVaultsRequest listVaultsRequest
                = new ListVaultsRequest()
                    .withLimit("100").withMarker(marker);       
        listVaultsResult
                = GlacierFrame.getClient().listVaults(listVaultsRequest);
        LGR.fine("got list");
        List<DescribeVaultOutput> vaultList
                = listVaultsResult.getVaultList();
        marker = listVaultsResult.getMarker();
        if (allVaults == null) {
            allVaults = vaultList;
            continue;
        }
        allVaults.addAll(vaultList);
    } while (marker !=null);
    return allVaults;
}
项目:aws-doc-sdk-examples    文件:ListVaults.java   
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.");
    }
}
项目:aws-utilization-monitor    文件:AwsScan.java   
/**
 * Collect data for Glacier.
 *
 * @param stats
 *            current statistics object.
 * @param account
 *            currently used credentials object.
 * @param region
 *            currently used aws region.
 */
public static void scanGlacier(AwsStats stats, AwsAccount account, Regions region) {
    LOG.debug("Scan for Glacier in region " + region.getName() + " in account " + account.getAccountId());

    try {
        AmazonGlacier glacier = new AmazonGlacierClient(account.getCredentials());
        glacier.setRegion(Region.getRegion(region));

        // DescribeVaultRequest dvr = new DescribeVaultRequest();
        ListVaultsRequest lvr = new ListVaultsRequest();
        int totalItems = 0;
        for (DescribeVaultOutput dvo : glacier.listVaults(lvr).getVaultList()) {
            AwsResource res = new AwsResource(dvo.getVaultName(), account.getAccountId(), AwsResourceType.Glacier, region);
            res.addInfo("NumberOfArchives", dvo.getNumberOfArchives());
            res.addInfo("VaultARN", dvo.getVaultARN());
            res.addInfo(AwsTag.SizeInBytes, dvo.getSizeInBytes());
            stats.add(res);
            totalItems++;
        }

        LOG.info(totalItems + " Glacier in region " + region.getName() + " in account " + account.getAccountId());
    } catch (AmazonServiceException ase) {
        if (ase.getErrorCode().contains("AccessDenied")) {
            LOG.info("Access denied for Glacier in region " + region.getName() + " in account " + account.getAccountId());
        } else {
            LOG.error("Exception of Glacier: " + ase.getMessage());
        }
    }
}
项目:aws-sdk-java-resources    文件:AccountImpl.java   
@Override
public VaultCollection getVaults(ListVaultsRequest request) {
    ResourceCollectionImpl result = resource.getCollection("Vaults",
            request);

    if (result == null) return null;
    return new VaultCollectionImpl(result);
}
项目:aws-sdk-java-resources    文件:GlacierImpl.java   
@Override
public VaultCollection getVaults(ListVaultsRequest request) {
    ResourceCollectionImpl result = service.getCollection("Vaults",
            request);

    if (result == null) return null;
    return new VaultCollectionImpl(result);
}
项目:aws-sdk-java-resources    文件:GlacierImpl.java   
@Override
public VaultCollection getVaults() {
    return getVaults((ListVaultsRequest)null);
}
项目:olfs    文件:NoaaResourceIngester.java   
public void inspectVaults(AWSCredentials creds, String endPointUrl){


        AmazonGlacierClient client = new AmazonGlacierClient(creds);
        client.setEndpoint(endPointUrl);

        ListVaultsResult listVaultsResult =  client.listVaults(new ListVaultsRequest());
        for(DescribeVaultOutput dvo : listVaultsResult.getVaultList() ){
            System.out.println(describeVault(dvo));

        }



    }
项目:aws-sdk-java-resources    文件:Glacier.java   
/**
 * Retrieves the Vaults collection referenced by this resource.
 */
VaultCollection getVaults(ListVaultsRequest request);
项目:aws-sdk-java-resources    文件:Account.java   
/**
 * Retrieves the Vaults collection referenced by this resource.
 */
VaultCollection getVaults(ListVaultsRequest request);