if (getHypervisor() != null) sb.append("Hypervisor: ").append(getHypervisor()).append(","); if (getIamInstanceProfile() != null) sb.append("IamInstanceProfile: ").append(getIamInstanceProfile()).append(","); if (getInstanceLifecycle() != null) sb.append("InstanceLifecycle: ").append(getInstanceLifecycle()).append(",");
hashCode = prime * hashCode + ((getEnaSupport() == null) ? 0 : getEnaSupport().hashCode()); hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode()); hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); hashCode = prime * hashCode + ((getInstanceLifecycle() == null) ? 0 : getInstanceLifecycle().hashCode()); hashCode = prime * hashCode + ((getElasticGpuAssociations() == null) ? 0 : getElasticGpuAssociations().hashCode());
if (other.getHypervisor() != null && other.getHypervisor().equals(this.getHypervisor()) == false) return false; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getInstanceLifecycle() == null ^ this.getInstanceLifecycle() == null)
if (getHypervisor() != null) sb.append("Hypervisor: " + getHypervisor() + ","); if (getNetworkInterfaces() != null) sb.append("NetworkInterfaces: " + getNetworkInterfaces() + ","); if (getIamInstanceProfile() != null) sb.append("IamInstanceProfile: " + getIamInstanceProfile() + ","); if (isEbsOptimized() != null) sb.append("EbsOptimized: " + isEbsOptimized() + ","); if (getSriovNetSupport() != null) sb.append("SriovNetSupport: " + getSriovNetSupport() );
hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode()); hashCode = prime * hashCode + ((getNetworkInterfaces() == null) ? 0 : getNetworkInterfaces().hashCode()); hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); hashCode = prime * hashCode + ((isEbsOptimized() == null) ? 0 : isEbsOptimized().hashCode()); hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport().hashCode());
if (other.getNetworkInterfaces() == null ^ this.getNetworkInterfaces() == null) return false; if (other.getNetworkInterfaces() != null && other.getNetworkInterfaces().equals(this.getNetworkInterfaces()) == false) return false; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.isEbsOptimized() == null ^ this.isEbsOptimized() == null) return false; if (other.isEbsOptimized() != null && other.isEbsOptimized().equals(this.isEbsOptimized()) == false) return false;
private boolean isSameIamInstanceProfile(Instance instance) { return StringUtils.isBlank(getIamInstanceProfile()) || (instance.getIamInstanceProfile() != null && instance.getIamInstanceProfile().getArn().equals(getIamInstanceProfile())); }
if (getHypervisor() != null) sb.append("Hypervisor: ").append(getHypervisor()).append(","); if (getIamInstanceProfile() != null) sb.append("IamInstanceProfile: ").append(getIamInstanceProfile()).append(","); if (getInstanceLifecycle() != null) sb.append("InstanceLifecycle: ").append(getInstanceLifecycle()).append(",");
private List<Instance> findOrphansOrStopped(DescribeInstancesResult diResult, int number) { List<Instance> orphansOrStopped = new ArrayList<>(); int count = 0; for (Reservation reservation : diResult.getReservations()) { for (Instance instance : reservation.getInstances()) { if (!isSameIamInstanceProfile(instance)) { logInstanceCheck(instance, ". false - IAM Instance profile does not match: " + instance.getIamInstanceProfile()); continue; } if (isTerminatingOrShuttindDown(instance.getState().getName())) { logInstanceCheck(instance, ". false - Instance is terminated or shutting down"); continue; } if (checkInstance(instance)) { logProvisionInfo("Found existing instance: " + instance); orphansOrStopped.add(instance); count++; } if (count == number) { return orphansOrStopped; } } } return orphansOrStopped; }
hashCode = prime * hashCode + ((getEnaSupport() == null) ? 0 : getEnaSupport().hashCode()); hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode()); hashCode = prime * hashCode + ((getIamInstanceProfile() == null) ? 0 : getIamInstanceProfile().hashCode()); hashCode = prime * hashCode + ((getInstanceLifecycle() == null) ? 0 : getInstanceLifecycle().hashCode()); hashCode = prime * hashCode + ((getElasticGpuAssociations() == null) ? 0 : getElasticGpuAssociations().hashCode());
for (Reservation reservation : diResult.getReservations()) { for (Instance instance : reservation.getInstances()) { if (instance.getIamInstanceProfile() != null && instance.getIamInstanceProfile().getArn().equals(getIamInstanceProfile())) { existingInstance = instance; break reservationLoop;
this.launchTime = new DateTime(instance.getLaunchTime()); if (instance.getIamInstanceProfile() != null) { this.iamInstanceProfile = instance.getIamInstanceProfile().getArn().toString(); } else { this.iamInstanceProfile = null;
if (other.getHypervisor() != null && other.getHypervisor().equals(this.getHypervisor()) == false) return false; if (other.getIamInstanceProfile() == null ^ this.getIamInstanceProfile() == null) return false; if (other.getIamInstanceProfile() != null && other.getIamInstanceProfile().equals(this.getIamInstanceProfile()) == false) return false; if (other.getInstanceLifecycle() == null ^ this.getInstanceLifecycle() == null)