Example usage for com.amazonaws.services.ec2.model GetConsoleOutputResult getOutput

List of usage examples for com.amazonaws.services.ec2.model GetConsoleOutputResult getOutput

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model GetConsoleOutputResult getOutput.

Prototype


public String getOutput() 

Source Link

Document

The console output, base64-encoded.

Usage

From source file:com.axemblr.provisionr.amazon.activities.DumpConsoleOutput.java

License:Apache License

@Override
public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws Exception {
    Machine machine = (Machine) execution.getVariable("machine");
    checkNotNull(machine, "expecting 'machine' as a process variable");

    LOG.info(">> Requesting console output for instance {}", machine.getExternalId());
    GetConsoleOutputResult result = client
            .getConsoleOutput(new GetConsoleOutputRequest().withInstanceId(machine.getExternalId()));
    String content = new String(Base64.decode(result.getOutput()), Charsets.UTF_8);

    LOG.info("<< Console output for instance {}: {}", machine.getExternalId(), content);
}

From source file:com.zotoh.cloudapi.aws.EC2Instance.java

License:Open Source License

@Override
public String getConsoleOutput(String server) throws InternalException, CloudException {
    tstEStrArg("instance-id", server);
    GetConsoleOutputResult res = _svc.getCloud().getEC2()
            .getConsoleOutput(new GetConsoleOutputRequest().withInstanceId(server));
    return res == null ? null : res.getOutput();
}

From source file:org.apache.provisionr.amazon.activities.DumpConsoleOutput.java

License:Apache License

@Override
public void execute(AmazonEC2 client, Pool pool, DelegateExecution execution) throws IOException {
    Machine machine = (Machine) execution.getVariable("machine");
    checkNotNull(machine, "expecting 'machine' as a process variable");

    LOG.info(">> Requesting console output for instance {}", machine.getExternalId());
    GetConsoleOutputResult result = client
            .getConsoleOutput(new GetConsoleOutputRequest().withInstanceId(machine.getExternalId()));
    if (result.getOutput() != null) {
        String content = new String(Base64.decode(result.getOutput()), Charsets.UTF_8);
        LOG.info("<< Console output for instance {}: {}", machine.getExternalId(), content);
    } else {//from  w  w  w. j a v  a  2  s.c  om
        LOG.warn("<< Console output was null for instance {}", machine.getExternalId());
    }
}