本文整理汇总了Java中com.amazonaws.services.glacier.AmazonGlacierClient类的典型用法代码示例。如果您正苦于以下问题:Java AmazonGlacierClient类的具体用法?Java AmazonGlacierClient怎么用?Java AmazonGlacierClient使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AmazonGlacierClient类属于com.amazonaws.services.glacier包,在下文中一共展示了AmazonGlacierClient类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: BaseAmazonGlacierClientAware
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
protected BaseAmazonGlacierClientAware(String region, String account, String vault) {
this.region = region;
this.account = account;
this.vault = vault;
//@TODO Need to move away from deprecated fashion of acquiring a client
//@TODO Also, consider supporting other ways of passing credentials (other than relying of local .aws profile)
// load the credentials from the .aws profile
this.credentialsProvider = new ProfileCredentialsProvider();
this.awsClient = new AmazonGlacierClient(this.credentialsProvider);
// Set Glacier end-point
this.awsClient.setEndpoint("https://glacier." + this.region + ".amazonaws.com/");
}
开发者ID:arjuan,项目名称:simple-glacier-client,代码行数:18,代码来源:BaseAmazonGlacierClientAware.java
示例2: describeVault
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
public String describeVault(String vaultName, AWSCredentials credentials){
DescribeVaultResult dvo;
AmazonGlacierClient client = new AmazonGlacierClient(credentials);
client.setEndpoint(getEndpoint());
DescribeVaultRequest dvr = new DescribeVaultRequest(vaultName);
dvo = client.describeVault(dvr);
StringBuilder sb = new StringBuilder();
sb.append("================================================================================\n");
sb.append("Found Vault: ").append(dvo.getVaultName()).append("\n");
sb.append(" getCreationDateString(): ").append(dvo.getCreationDate()).append("\n");
sb.append(" getLastInventoryDate(): ").append(dvo.getLastInventoryDate()).append("\n");
sb.append(" getNumberOfArchives(): ").append(dvo.getNumberOfArchives()).append("\n");
sb.append(" getSizeInBytes(): ").append(dvo.getSizeInBytes()).append("\n");
sb.append(" getVaultARN(): ").append(dvo.getVaultARN()).append("\n");
sb.append(" toString(): ").append(dvo.toString()).append("\n");
return sb.toString();
}
开发者ID:OPENDAP,项目名称:olfs,代码行数:23,代码来源:Vault.java
示例3: getGlacierClient
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
@Produces
@Omakase
public GlacierClient getGlacierClient() {
RuntimeCredentialsProvider provider = new RuntimeCredentialsProvider();
AmazonGlacier amazonGlacier = new AmazonGlacierClient(provider);
return new GlacierClient(httpClient, provider, amazonGlacier);
}
开发者ID:projectomakase,项目名称:omakase,代码行数:8,代码来源:GlacierClientProducer.java
示例4: scanGlacier
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
/**
* 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());
}
}
}
开发者ID:janloeffler,项目名称:aws-utilization-monitor,代码行数:39,代码来源:AwsScan.java
示例5: deleteArchive
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
public void deleteArchive(String archiveId){
_log.warn("deleteArchive() - Removing {}", archiveId);
AmazonGlacierClient client = new AmazonGlacierClient(getCredentials());
DeleteArchiveRequest dar = new DeleteArchiveRequest(getVaultName(),archiveId);
client.deleteArchive(dar);
}
开发者ID:OPENDAP,项目名称:olfs,代码行数:8,代码来源:Vault.java
示例6: getClient
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
/**
* Returns the AWS client in the specified region.
*
* @param region string such as 'us-west-1', 'eu-west-1'
* @return AWS client object
*/
public static AmazonGlacierClient getClient(final String region){
final AmazonGlacierClient client = new AmazonGlacierClient(Main.frame);
int current_api_call_count = P.getInt(NUMBER_OF_AWS_API_CALLS, 0);
final String endpointURL = "https://glacier.%s.amazonaws.com";
client.setEndpoint(String.format(endpointURL, region));
if (current_api_call_count == 0) {
P.putLong(LAST_AWS_API_CALL_RESET, System.currentTimeMillis());
}
P.putInt(NUMBER_OF_AWS_API_CALLS, 1 + current_api_call_count);
return client;
}
开发者ID:amherst-robots,项目名称:meta-glacier,代码行数:19,代码来源:GlacierFrame.java
示例7: GlacierClient
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
/**
* Creates a new Glacier Client configured with it's own pooled Http Client.
*/
public GlacierClient() {
this.httpClient = HttpClientFactory.pooledConnectionHttpClient(100, 30000, 600000);
this.runtimeCredentialsProvider = new RuntimeCredentialsProvider();
this.amazonGlacier = new AmazonGlacierClient(runtimeCredentialsProvider);
}
开发者ID:projectomakase,项目名称:omakase,代码行数:9,代码来源:GlacierClient.java
示例8: put
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
public String put(String resourceId, File uploadFile) throws FileNotFoundException {
AmazonGlacierClient client = new AmazonGlacierClient(getCredentials());
client.setEndpoint(getEndpoint());
ArchiveTransferManager atm = new ArchiveTransferManager(client, getCredentials());
_log.info("Transferring cache file content to Glacier. vault: " + getVaultName() + " description: " + resourceId);
UploadResult uploadResult = atm.upload(getVaultName(), resourceId, uploadFile);
String archiveId = uploadResult.getArchiveId();
_log.info("Upload Successful. archiveId: {} resourceId: {}",archiveId,resourceId);
return archiveId;
}
开发者ID:OPENDAP,项目名称:olfs,代码行数:17,代码来源:Vault.java
示例9: inspectVaults
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
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));
}
}
开发者ID:OPENDAP,项目名称:olfs,代码行数:16,代码来源:NoaaResourceIngester.java
示例10: deleteVault
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
public void deleteVault() throws IOException{
purgeVault();
AmazonGlacierClient client = new AmazonGlacierClient(getCredentials());
client.setEndpoint(getEndpoint());
DeleteVaultRequest request = new DeleteVaultRequest()
.withVaultName(getVaultName());
client.deleteVault(request);
System.out.println("Deleted vault: " + getVaultName());
}
开发者ID:OPENDAP,项目名称:olfs,代码行数:16,代码来源:Vault.java
示例11: GlacierImpl
import com.amazonaws.services.glacier.AmazonGlacierClient; //导入依赖的package包/类
/**
* Construct a service implementation that talks to the specified AWS
* region. The low-level client will be created via the default no-arg
* constructor, which means it will have all the default client
* configurations and it will use the default provider chain to retrieve AWS
* credentials. If you need more flexible control over the low-level client,
* use {@link #GlacierImpl(AmazonGlacier)} instead.
*
* @param region The AWS region where the service API calls will be sent to.
*/
public GlacierImpl(Regions region) {
this(new AmazonGlacierClient());
this.client().setRegion(Region.getRegion(region));
}
开发者ID:awslabs,项目名称:aws-sdk-java-resources,代码行数:15,代码来源:GlacierImpl.java
注:本文中的com.amazonaws.services.glacier.AmazonGlacierClient类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论