如何检查amazon Web服务中存在多少桶 [英] How to check how many buckets are present in amazon web services

查看:104
本文介绍了如何检查amazon Web服务中存在多少桶的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello Guys如何使用javascript或c#从亚马逊网络服务获取存储桶列表..我有accessid和安全ID ..我需要显示存在于aws中的存储桶名称





请帮忙??



我尝试过:



var s3 =新的AWS.S3({

accessKeyId:'',

secretAccessKey:''

});



帮助??

解决方案

使用(IAmazonS3 client =新的AmazonS3Client(awsAccessID,awsSecretAccessKey,Amazon.RegionEndpoint.USWest2))

{





ListBucketsResponse response = client.ListBuckets();

List< s3bucket> buckets = response.Buckets;

foreach(桶中的S3Bucket桶)

{

Console.WriteLine(创建的存储桶名称{0}已创建在{1},bucket.BucketName,bucket.CreationDate);

}





}



这将返回aws中的桶列表..

希望它有所帮助..

谢谢..

Hello Guys how do i get the buckets list from amazon web services using javascript or c#..i have accessid and security id..i need to display the bucket names which are present in aws


please help??

What I have tried:

var s3 = new AWS.S3({
accessKeyId: '',
secretAccessKey: ''
});

help??

解决方案

using (IAmazonS3 client = new AmazonS3Client(awsAccessID,awsSecretAccessKey , Amazon.RegionEndpoint.USWest2))
{


ListBucketsResponse response = client.ListBuckets();
List<s3bucket> buckets = response.Buckets;
foreach (S3Bucket bucket in buckets)
{
Console.WriteLine("Found bucket name {0} created at {1}", bucket.BucketName, bucket.CreationDate);
}


}

This returns the List of buckets in aws..
hope it helps..
Thanks..


这篇关于如何检查amazon Web服务中存在多少桶的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆