if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getKernelId() != null) sb.append("KernelId: ").append(getKernelId()).append(",");
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
instance.getInstanceId(), instance.getImageId(), instance.getInstanceType(), instance.getState().getName(), instance.getMonitoring().getState());
/** * Constructs and returns an BasicInstance object, using information from <code>ec2</code> * * @param ec2 * @return */ protected static Instance toInstance( com.amazonaws.services.ec2.model.Instance ec2 ) { Instance instance; BasicInstanceSpec spec; spec = new BasicInstanceSpec(); spec.setImageId( ec2.getImageId() ); spec.setKeyName( ec2.getKeyName() ); spec.setType( ec2.getInstanceType() ); instance = new BasicInstance( ec2.getInstanceId(), spec, InstanceState.fromValue( ec2.getState().getName() ), ec2.getPrivateDnsName(), ec2.getPublicDnsName(), ec2.getPrivateIpAddress(), ec2.getPublicIpAddress() ); return instance; }
if (other.getInstanceId() != null && other.getInstanceId().equals(this.getInstanceId()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getKernelId() == null ^ this.getKernelId() == null)
if (getAmiLaunchIndex() != null) sb.append("AmiLaunchIndex: " + getAmiLaunchIndex() + ","); if (getProductCodes() != null) sb.append("ProductCodes: " + getProductCodes() + ","); if (getInstanceType() != null) sb.append("InstanceType: " + getInstanceType() + ","); if (getLaunchTime() != null) sb.append("LaunchTime: " + getLaunchTime() + ","); if (getPlacement() != null) sb.append("Placement: " + getPlacement() + ",");
hashCode = prime * hashCode + ((getAmiLaunchIndex() == null) ? 0 : getAmiLaunchIndex().hashCode()); hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getLaunchTime() == null) ? 0 : getLaunchTime().hashCode()); hashCode = prime * hashCode + ((getPlacement() == null) ? 0 : getPlacement().hashCode());
private boolean verifySize(Instance instance) { boolean result = false; String size = sizeType; if (instance.getInstanceType() != null && size != null) { if (instance.getInstanceType().equals(size)) { result = true; } } return result; }
HazelcastInstance hzInstance = Hazelcast.newHazelcastInstance(null); Collection<Instance> instances = hzInstance.getInstances(); Set<Instance> locks = new HashSet<Instance>(); for (Instance inst : instances) { if(inst.getInstanceType().equals(Instance.InstanceType.LOCK)) locks.add(inst); }
if (other.getProductCodes() == null ^ this.getProductCodes() == null) return false; if (other.getProductCodes() != null && other.getProductCodes().equals(this.getProductCodes()) == false) return false; if (other.getInstanceType() == null ^ this.getInstanceType() == null) return false; if (other.getInstanceType() != null && other.getInstanceType().equals(this.getInstanceType()) == false) return false; if (other.getLaunchTime() == null ^ this.getLaunchTime() == null) return false; if (other.getLaunchTime() != null && other.getLaunchTime().equals(this.getLaunchTime()) == false) return false;
public static Instance toInstance(com.amazonaws.services.ec2.model.Instance instance, URI internalUri, URI externalUri, String role) { return new Instance(instance.getInstanceId(), instance.getInstanceType(), getLocation(instance, role), internalUri, externalUri); }
public static Instance toInstance(com.amazonaws.services.ec2.model.Instance instance, URI internalUri, URI externalUri, String role) { return new Instance(instance.getInstanceId(), instance.getInstanceType(), getLocation(instance, role), internalUri, externalUri); }
String instanceType = instance.getInstanceType(); boolean isSpotInstance = StringUtils.equalsIgnoreCase( instance.getInstanceLifecycle(), InstanceLifecycleType.Spot.toString());
@Override public InstanceType getInstanceType(String providerInstanceId) throws DuracloudInstanceNotAvailableException { DescribeInstancesResult result = describeInstance(providerInstanceId); try { // Allowed Values: pending, running, shutting-down, terminated String instanceType = result.getReservations().iterator().next().getInstances() .iterator().next().getInstanceType(); for (InstanceType it : InstanceType.values()) { if (convertDuracloudInstanceTypeToNative(it).equals(instanceType)) { return it; } } String message = "Unable to get instance type for EC2 instance with ID " + providerInstanceId + ": amazon instance type '" + instanceType + "' unknown to DuraCloud MC."; throw new DuraCloudRuntimeException(message); } catch(Exception e) { String message = "Unable to get instance type for EC2 instance with ID " + providerInstanceId + " due to error: " + e.getMessage(); log.error(message, e); throw new DuraCloudRuntimeException(message, e); } }
if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(","); if (getInstanceType() != null) sb.append("InstanceType: ").append(getInstanceType()).append(","); if (getKernelId() != null) sb.append("KernelId: ").append(getKernelId()).append(",");
privateDNS = i.getPrivateIpAddress(); createdTime = i.getLaunchTime().getTime(); instanceType = i.getInstanceType();
.machineSize(instance.getInstanceType()).membershipStatus(membershipStatus).serviceState(serviceState) .launchTime(launchtime).publicIps(publicIps).privateIps(privateIps).metadata(metadata).build();
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode()); hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode()); hashCode = prime * hashCode + ((getKeyName() == null) ? 0 : getKeyName().hashCode());
/** * @see org.apache.airavata.xbaya.ui.widgets.TableRenderable#getValue(int) */ @Override public Object getValue(int index) { switch (index) { case 0: return this.instance.getInstanceId(); case 1: return this.instance.getImageId(); case 2: return this.instance.getRootDeviceType(); case 3: return this.instance.getInstanceType(); case 4: return this.instance.getState().getName(); case 5: return this.instance.getKeyName(); case 6: return this.instance.getMonitoring().getState(); case 7: return this.instance.getVirtualizationType(); case 8: return this.instance.getPlacement().getGroupName(); default: return null; } }
public EC2Instance(Instance instance) { this.id = instance.getInstanceId(); this.type = instance.getInstanceType(); this.lifecycle = instance.getInstanceLifecycle(); this.hypervisor = instance.getHypervisor();