Eu fiz o download do Amazon AWS SDK para C #, não tenho nenhum problema em acessar a parte do EC2 da nossa nuvem privada que executa o Eucalyptus, posso listar, Imagens, Instâncias, Zonas ...
Isso está funcionando bem:
AmazonEC2 ec2 = AWSClientFactory.CreateAmazonEC2Client("abcdefghijklmnopqrstuvwxyz1234567890", "abcdefghijklmnopqrstuvwxyz1234567890", new AmazonEC2Config().WithServiceURL("http://10.140.54.12:8773/services/Eucalyptus"));
DescribeInstancesRequest ec2Request = new DescribeInstancesRequest();
try
{
DescribeInstancesResponse ec2Response = ec2.DescribeInstances(ec2Request);
int numInstances = 0;
numInstances = ec2Response.DescribeInstancesResult.Reservation.Count;
textBoxInstancesLog.AppendText("You have " + numInstances + " running instances");
textBoxInstancesLog.AppendText(ec2Response.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
Mas preciso acessar a parte do Walrus (S3) de nossa nuvem. É assim que eu tento acessar o Walrus, o código é quase idêntico, mas com essa chamada eu receberei uma exceção.
Isso não está funcionando:
AmazonS3 s3 = AWSClientFactory.CreateAmazonS3Client("abcdefghijklmnopqrstuvwxyz1234567890", "abcdefghijklmnopqrstuvwxyz1234567890", new AmazonS3Config().WithServiceURL("http://10.140.54.12:8773/services/Walrus"));
ListBucketsRequest s3Request = new ListBucketsRequest();
try
{
ListBucketsResponse s3Response = s3.ListBuckets(s3Request);
textBoxS3Log.AppendText(s3Response.ToString());
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
Eu receberei esta exceção:
System.Net.WebException: The remote name could not be resolved: 'http'
at Amazon.S3.AmazonS3Client.processRequestError(String actionName, HttpWebRequest request, WebException we, HttpWebResponse errorResponse, String requestAddr, WebHeaderCollection& respHdrs, Type t, Exception& cause)
at Amazon.S3.AmazonS3Client.handleHttpWebErrorResponse(S3Request userRequest, WebException we, HttpWebRequest request, HttpWebResponse httpResponse, Exception& cause, HttpStatusCode& statusCode)
at Amazon.S3.AmazonS3Client.getResponseCallback[T](IAsyncResult result)
at Amazon.S3.AmazonS3Client.endOperation[T](IAsyncResult result)
at Amazon.S3.AmazonS3Client.ListBuckets(ListBucketsRequest request)
at IAASClient.FormMain.buttonS3Test_Click(Object sender, EventArgs e) in X:\work\IAASClient\FormMain.cs:line 107
Do site de eucalipto:
Eucalyptus implements an IaaS
(Infrastructure as a Service) private
cloud that is accessible via an API
compatible with Amazon EC2 and Amazon
S3
O que estou perdendo?
Nota: O mesmo código funciona perfeitamente com o Amazon S3, o problema é acessar o Eucalyptus Walrus.