AnsweredAssumed Answered

hs3 create bucket

Question asked by Ryan Lee Employee on Feb 27, 2017
Latest reply on Mar 6, 2017 by Michal Marek

I tried to create a bucket (namespace) by using AWS.S3, but I got the Bad Request exception as shown below.  I tried multiple older versions of AWS.S3 library but still no luck.  Any advice?

 

 

public HS3StorageClient(String username, String password, String tenant, String host)

{

MD5 md5 = System.Security.Cryptography.MD5.Create();

 

b64UserName = Convert.ToBase64String(Encoding.UTF8.GetBytes(username));

md5Password = BitConverter.ToString(md5.ComputeHash(Encoding.UTF8.GetBytes(password))).Replace("-", String.Empty).ToLower();

 

config = new AmazonS3Config();

config.ServiceURL = "http://" + tenant + "." + host;

config.UseHttp = true;

  

client = new AmazonS3Client(b64UserName, md5Password, config);

 

}

 

 

public void CreateBucket(String bucketName)

{

if(!AmazonS3Util.DoesS3BucketExist(client, bucketName))

{

PutBucketRequest req = new PutBucketRequest

{

BucketName = bucketName,

                  

};

PutBucketResponse res = client.PutBucket(req);

}

}

 

Outcomes