Example usage for com.amazonaws.services.ec2.model Monitoring setState

List of usage examples for com.amazonaws.services.ec2.model Monitoring setState

Introduction

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

Prototype


public void setState(MonitoringState state) 

Source Link

Document

Indicates whether detailed monitoring is enabled.

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   www. j a  va  2  s . c o  m

    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;
}