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

项目:cloudbreak    文件:AwsInstanceConnector.java   
@Override
public String getConsoleOutput(AuthenticatedContext authenticatedContext, CloudInstance vm) {
    if (!verifyHostKey) {
        throw new CloudOperationNotSupportedException("Host key verification is disabled on AWS");
    }
    AmazonEC2Client amazonEC2Client = awsClient.createAccess(new AwsCredentialView(authenticatedContext.getCloudCredential()),
            authenticatedContext.getCloudContext().getLocation().getRegion().value());
    GetConsoleOutputRequest getConsoleOutputRequest = new GetConsoleOutputRequest().withInstanceId(vm.getInstanceId());
    GetConsoleOutputResult getConsoleOutputResult = amazonEC2Client.getConsoleOutput(getConsoleOutputRequest);
    try {
        if (getConsoleOutputResult.getOutput() == null) {
            return "";
        } else {
            return getConsoleOutputResult.getDecodedOutput();
        }
    } catch (Exception ex) {
        LOGGER.debug(ex.getMessage(), ex);
        return "";
    }
}
项目:aws-sdk-java-resources    文件:InstanceImpl.java   
@Override
public GetConsoleOutputResult consoleOutput(GetConsoleOutputRequest request,
        ResultCapture<GetConsoleOutputResult> extractor) {

    ActionResult result = resource.performAction("ConsoleOutput", request,
            extractor);

    if (result == null) return null;
    return (GetConsoleOutputResult) result.getData();
}
项目:aws-sdk-java-resources    文件:InstanceImpl.java   
@Override
public GetConsoleOutputResult consoleOutput(
        ResultCapture<GetConsoleOutputResult> extractor) {

    GetConsoleOutputRequest request = new GetConsoleOutputRequest();
    return consoleOutput(request, extractor);
}
项目:incubator-provisionr    文件:DumpConsoleOutput.java   
@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 {
        LOG.warn("<< Console output was null for instance {}", machine.getExternalId());
    }
}
项目:elasticsearch_my    文件:AmazonEC2Mock.java   
@Override
public GetConsoleOutputResult getConsoleOutput(GetConsoleOutputRequest getConsoleOutputRequest) throws AmazonServiceException, AmazonClientException {
    throw new UnsupportedOperationException("Not supported in mock");
}
项目:aws-sdk-java-resources    文件:InstanceImpl.java   
@Override
public GetConsoleOutputResult consoleOutput(GetConsoleOutputRequest request)
        {

    return consoleOutput(request, null);
}
项目:aws-sdk-java-resources    文件:InstanceImpl.java   
@Override
public GetConsoleOutputResult consoleOutput() {
    return consoleOutput((ResultCapture<GetConsoleOutputResult>)null);
}
项目:aws-sdk-java-resources    文件:Instance.java   
/**
 * Performs the <code>ConsoleOutput</code> action.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Instance</code> resource, and any conflicting parameter value set
 * in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>InstanceId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The response of the low-level client operation associated with
 *         this resource action.
 * @see GetConsoleOutputRequest
 */
GetConsoleOutputResult consoleOutput(GetConsoleOutputRequest request);
项目:aws-sdk-java-resources    文件:Instance.java   
/**
 * Performs the <code>ConsoleOutput</code> action and use a ResultCapture to
 * retrieve the low-level client response.
 *
 * <p>
 * The following request parameters will be populated from the data of this
 * <code>Instance</code> resource, and any conflicting parameter value set
 * in the request will be overridden:
 * <ul>
 *   <li>
 *     <b><code>InstanceId</code></b>
 *         - mapped from the <code>Id</code> identifier.
 *   </li>
 * </ul>
 *
 * <p>
 *
 * @return The response of the low-level client operation associated with
 *         this resource action.
 * @see GetConsoleOutputRequest
 */
GetConsoleOutputResult consoleOutput(GetConsoleOutputRequest request,
        ResultCapture<GetConsoleOutputResult> extractor);
项目:aws-sdk-java-resources    文件:Instance.java   
/**
 * The convenient method form for the <code>ConsoleOutput</code> action.
 *
 * @see #consoleOutput(GetConsoleOutputRequest)
 */
GetConsoleOutputResult consoleOutput();
项目:aws-sdk-java-resources    文件:Instance.java   
/**
 * The convenient method form for the <code>ConsoleOutput</code> action.
 *
 * @see #consoleOutput(GetConsoleOutputRequest, ResultCapture)
 */
GetConsoleOutputResult consoleOutput(ResultCapture<GetConsoleOutputResult>
        extractor);