Java 类com.amazonaws.services.ec2.model.RebootInstancesResult 实例源码

项目:swordfish-service    文件:EC2RebootImpl.java   
@Override
public void process(Instance instance) {
    ec2UserClient.amazonEC2Async().rebootInstancesAsync(
            new RebootInstancesRequest().withInstanceIds(instance.getInstanceId()),
            new AsyncHandler<RebootInstancesRequest, RebootInstancesResult>() {
                @Override
                public void onError(Exception exception) {
                    log.warn("something went wrong starting the server {}",
                            exception.getLocalizedMessage());
                }

                @Override
                public void onSuccess(RebootInstancesRequest request,
                                      RebootInstancesResult result) {
                    ec2UserClient.amazonEC2Async().waiters()
                            .instanceRunning()
                            .runAsync(ec2Waiter.describeInstancesRequestWaiterParameters(instance.getInstanceId()), ec2Waiter.describeInstancesRequestWaiterHandler());

                }
            });
}
项目:aws-doc-sdk-examples    文件:RebootInstance.java   
public static void main(String[] args)
{
    final String USAGE =
        "To run this example, supply an instance id\n" +
        "Ex: RebootInstnace <instance_id>\n";

    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }

    String instance_id = args[0];

    final AmazonEC2 ec2 = AmazonEC2ClientBuilder.defaultClient();

    RebootInstancesRequest request = new RebootInstancesRequest()
        .withInstanceIds(instance_id);

    RebootInstancesResult response = ec2.rebootInstances(request);

    System.out.printf(
        "Successfully rebooted instance %s", instance_id);
}
项目:Camel    文件:AmazonEC2ClientMock.java   
@Override
public RebootInstancesResult rebootInstances(RebootInstancesRequest rebootInstancesRequest) {
    return new RebootInstancesResult();
}