if (getAmiLaunchIndex() != null) sb.append("AmiLaunchIndex: ").append(getAmiLaunchIndex()).append(","); if (getImageId() != null) sb.append("ImageId: ").append(getImageId()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).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());
"and monitoring state %s", instance.getInstanceId(), instance.getImageId(), instance.getInstanceType(), instance.getState().getName(),
/** * 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.getAmiLaunchIndex() != null && other.getAmiLaunchIndex().equals(this.getAmiLaunchIndex()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null)
sb.append("{"); if (getInstanceId() != null) sb.append("InstanceId: " + getInstanceId() + ","); if (getImageId() != null) sb.append("ImageId: " + getImageId() + ","); if (getState() != null) sb.append("State: " + getState() + ","); if (getPrivateDnsName() != null) sb.append("PrivateDnsName: " + getPrivateDnsName() + ",");
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode()); hashCode = prime * hashCode + ((getPrivateDnsName() == null) ? 0 : getPrivateDnsName().hashCode());
if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getState() == null ^ this.getState() == null) return false; if (other.getState() != null && other.getState().equals(this.getState()) == false) return false;
protected boolean isEc2ProvisionedSlave(Instance i, String ami) { // Check if the ami matches if (ami == null || StringUtils.equals(ami, i.getImageId())) { // Check if there is a ec2slave tag... for (Tag tag : i.getTags()) { if (StringUtils.equals(tag.getKey(), EC2Tag.TAG_NAME_JENKINS_SLAVE_TYPE)) { return true; } } return false; } return false; }
if (getAmiLaunchIndex() != null) sb.append("AmiLaunchIndex: ").append(getAmiLaunchIndex()).append(","); if (getImageId() != null) sb.append("ImageId: ").append(getImageId()).append(","); if (getInstanceId() != null) sb.append("InstanceId: ").append(getInstanceId()).append(",");
private void processInstance(String account, String region, Instance instance) { final Map<String, Object> metaData = newHashMap(); metaData.putAll(amiDetailsProvider.getAmiDetails(account, getRegion(fromName(region)), instance.getImageId())); final List<String> errorMessages = newArrayList(); final String instancePublicIpAddress = instance.getPublicIpAddress();
public boolean verify() { // will return false if the id is null boolean result = false; if (instanceId != null) { if (ec2Client == null) { ec2Client = context.fetchEC2Client(); } List<String> id = new ArrayList<String>(); id.add(instanceId); List<Instance> instances = helper.getInstances(id, ec2Client); if (instances != null && !instances.isEmpty()) { for (Instance instance : instances) { if (instance.getImageId().equals(amiId)) { String subId = ((EnvironmentTaskAWS)context.getEnvironment()).getVpc() .findSubnetForName(subnetName).getId(); if (instance.getSubnetId() != null && instance.getSubnetId().equals(subId) && verifyElasticIp(instance) && verifyKeyPair(instance) && verifySize(instance) && verifySecurityGroups(instance)) { result = true; } } } } } return result; }
final Optional<Image> optionalImage = getAmiFromEC2Api(ec2Client, instance.getImageId()); final Optional<Boolean> isTaupageAmi = optionalImage .filter(img -> img.getName().startsWith(taupageNamePrefix))
hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode()); hashCode = prime * hashCode + ((getInstanceId() == null) ? 0 : getInstanceId().hashCode()); hashCode = prime * hashCode + ((getInstanceType() == null) ? 0 : getInstanceType().hashCode());
if (isEc2ProvisionedAmiSlave(i.getTags(), description) && isEc2ProvisionedJenkinsSlave(i.getTags(), jenkinsServerUrl) && (template == null || template.getAmi().equals(i.getImageId()))) { InstanceStateName stateName = InstanceStateName.fromValue(i.getState().getName()); if (stateName != InstanceStateName.Terminated && stateName != InstanceStateName.ShuttingDown && stateName != InstanceStateName.Stopped ) { LOGGER.log(Level.FINE, "Existing instance found: " + i.getInstanceId() + " AMI: " + i.getImageId() + (template != null ? (" Template: " + description) : "") + " Jenkins Server: " + jenkinsServerUrl); n++;
/** * @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; } }
this.kernel = instance.getKernelId(); this.key = instance.getKeyName(); this.image = instance.getImageId(); this.privateIP = instance.getPrivateIpAddress(); this.publicIP = instance.getPublicIpAddress();
if (other.getAmiLaunchIndex() != null && other.getAmiLaunchIndex().equals(this.getAmiLaunchIndex()) == false) return false; if (other.getImageId() == null ^ this.getImageId() == null) return false; if (other.getImageId() != null && other.getImageId().equals(this.getImageId()) == false) return false; if (other.getInstanceId() == null ^ this.getInstanceId() == null)