我正在尝试使用 Amazon AWS SDK 来开发 Eucalyptus,但我总是被拒绝访问:public class App {
public static AmazonEC2 ec2;
public static AmazonS3 s3;
public static AmazonIdentityManagement identityManagement;
private static String ACCESS_KEY;
private static String SECRET_KEY;
private static String IDENTITY_END_POINT;
public static void init(){
ACCESS_KEY="myaccesskey";
SECRET_KEY="mysecretkey";
IDENTITY_END_POINT="http://192.168.1.101:8773/services/Euare";
AWSCredentials myCredential = new BasicAWSCredentials(ACCESS_KEY,SECRET_KEY);
//ec2 = new AmazonEC2Client(myCredential);
s3 = new AmazonS3Client(myCredential);
//ec2.setEndpoint(EC2_END_POINT);
s3.setEndpoint(Walrus_END_POINT);
identityManagement=new AmazonIdentityManagementClient(myCredential);
identityManagement.setEndpoint(IDENTITY_END_POINT);
}
public static void main(String[] args) {
// TODO Auto-generated method stub
init();
List<Bucket> buckets = s3.listBuckets();
System.out.println("List of all buckets in your cloud:\n");
for (Bucket bucket : buckets) {
System.out.println(bucket.getName()+"\n");
}
CreateUserRequest createUserRequest=new CreateUserRequest().withPath("/").withUserName("summer");
CreateUserResult createUserResult=identityManagement.createUser(createUserRequest);
这是我得到的错误:
线程“主”状态代码中的异常:404,AWS 服务:AmazonIdentityManagement,AWS 请求 ID:null,AWS 错误代码:null,AWS 错误消息:com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:614) 处为 null在 com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:312) 在 com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:165) 在 com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient.invoke(AmazonIdentityManagementClient.java :3130) com.amazonaws.services.identitymanagement.AmazonIdentityManagementClient.getUser(AmazonIdentityManagementClient.java:1201) com.test2.Group.main(Group.java:107)