我曾尝试使用 AttachVolumeRequest 但作为响应我收到以下错误
Caught Exception: The request must contain the parameter volume
Reponse Status Code: 400
Error Code: MissingParameter
这是我的代码,在此代码中,ec2 是我的 amazonclient 对象,到目前为止它工作正常
AttachVolumeRequest attachRequest=new AttachVolumeRequest()
.withInstanceId("my instance id");
attachRequest.setRequestCredentials(credentials);
EbsBlockDevice ebs=new EbsBlockDevice();
ebs.setVolumeSize(2);
//attachRequest.withVolumeId(ebs.getSnapshotId());
AttachVolumeResult result=ec2.attachVolume(attachRequest);
非常感谢任何帮助。提前致谢