Example usage for com.amazonaws.services.ec2.model Instance setMonitoring

List of usage examples for com.amazonaws.services.ec2.model Instance setMonitoring

Introduction

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

Prototype


public void setMonitoring(Monitoring monitoring) 

Source Link

Document

The monitoring for the instance.

Usage

From source file:jp.primecloud.auto.aws.typica.converter.InstanceConverter.java

License:Open Source License

@Override
protected Instance convertObject(com.xerox.amazonws.ec2.ReservationDescription.Instance from) {
    Instance to = new Instance();

    to.setInstanceId(from.getInstanceId());
    to.setImageId(from.getImageId());/*from   w  w w.ja va 2s. c om*/

    InstanceState state = new InstanceState();
    state.setCode(from.getStateCode());
    state.setName(from.getState());
    to.setState(state);

    to.setPrivateDnsName(from.getPrivateDnsName());
    to.setPublicDnsName(from.getDnsName());
    to.setStateTransitionReason(from.getReason());
    to.setKeyName(from.getKeyName());
    to.setAmiLaunchIndex(null);
    to.setProductCodes(null);
    to.setInstanceType(from.getInstanceType().name());
    to.setLaunchTime(from.getLaunchTime().getTime());

    Placement placement = new Placement();
    placement.setAvailabilityZone(from.getAvailabilityZone());
    placement.setGroupName(null); // 
    to.setPlacement(placement);

    to.setKernelId(from.getKernelId());
    to.setRamdiskId(from.getRamdiskId());
    to.setPlatform(from.getPlatform());

    Monitoring monitoring = new Monitoring();
    monitoring.setState(Boolean.toString(from.isMonitoring()));
    to.setMonitoring(monitoring);

    // 
    to.setSubnetId(null);
    to.setVpcId(null);
    to.setPrivateIpAddress(null);
    to.setPublicIpAddress(null);
    to.setStateReason(null);
    //to.setArchitecture(null);
    to.setRootDeviceName(null);
    to.setRootDeviceName(null);
    to.setBlockDeviceMappings(null);
    //to.setVirtualizationType(null);
    //to.setInstanceLifecycle(null);
    to.setSpotInstanceRequestId(null);
    //to.setLicense(null);
    to.setClientToken(null);
    to.setTags(null);

    return to;
}