if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()).append(",");
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
/** * Any block device mapping entries for the instance. * <p> * Returns a reference to this object so that method calls can be chained together. * * @param blockDeviceMappings Any block device mapping entries for the instance. * * @return A reference to this updated object so that method calls can be chained * together. */ public Instance withBlockDeviceMappings(InstanceBlockDeviceMapping... blockDeviceMappings) { if (getBlockDeviceMappings() == null) setBlockDeviceMappings(new java.util.ArrayList<InstanceBlockDeviceMapping>(blockDeviceMappings.length)); for (InstanceBlockDeviceMapping value : blockDeviceMappings) { getBlockDeviceMappings().add(value); } return this; }
if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null)
if (getRootDeviceType() != null) sb.append("RootDeviceType: " + getRootDeviceType() + ","); if (getRootDeviceName() != null) sb.append("RootDeviceName: " + getRootDeviceName() + ","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: " + getBlockDeviceMappings() + ","); if (getVirtualizationType() != null) sb.append("VirtualizationType: " + getVirtualizationType() + ","); if (getInstanceLifecycle() != null) sb.append("InstanceLifecycle: " + getInstanceLifecycle() + ",");
hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode()); hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode()); hashCode = prime * hashCode + ((getInstanceLifecycle() == null) ? 0 : getInstanceLifecycle().hashCode());
if (other.getRootDeviceName() == null ^ this.getRootDeviceName() == null) return false; if (other.getRootDeviceName() != null && other.getRootDeviceName().equals(this.getRootDeviceName()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false) return false; if (other.getVirtualizationType() == null ^ this.getVirtualizationType() == null) return false; if (other.getVirtualizationType() != null && other.getVirtualizationType().equals(this.getVirtualizationType()) == false) return false;
private List<String> getResourcesToTag(Instance inst) { List<String> resources = new ArrayList<>(); resources.add(inst.getInstanceId()); for(InstanceBlockDeviceMapping blockDeviceMapping : inst.getBlockDeviceMappings()) { resources.add(blockDeviceMapping.getEbs().getVolumeId()); } return resources; }
// First get the EC2 instance from the id DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest().withInstanceIds(instanceId); DescribeInstancesResult describeInstancesResult = ec2.describeInstances(describeInstancesRequest); Instance instance = describeInstancesResult.getReservations().get(0).getInstances().get(0); // Then get the mappings List<InstanceBlockDeviceMapping> mappingList = instance.getBlockDeviceMappings(); for(InstanceBlockDeviceMapping mapping: mappingList) { System.out.println(mapping.getEbs().getVolumeId()); }
protected InstanceBlockDeviceMapping getRootVolumeMapping(Instance instance) { checkNotNull(instance, "instance"); String rootDeviceName = instance.getRootDeviceName(); List<InstanceBlockDeviceMapping> mappings = instance.getBlockDeviceMappings(); for (InstanceBlockDeviceMapping mapping : mappings) { if (rootDeviceName.equals(mapping.getDeviceName())) { return mapping; } } throw illegalState("Unable to locate the root volume mapping for [%s]", instance.getInstanceId()); }
if (getArchitecture() != null) sb.append("Architecture: ").append(getArchitecture()).append(","); if (getBlockDeviceMappings() != null) sb.append("BlockDeviceMappings: ").append(getBlockDeviceMappings()).append(","); if (getClientToken() != null) sb.append("ClientToken: ").append(getClientToken()).append(",");
instance.getBlockDeviceMappings().add(InstanceBlockDeviceMappingStaxUnmarshaller.getInstance().unmarshall(context)); continue;
hashCode = prime * hashCode + ((getVpcId() == null) ? 0 : getVpcId().hashCode()); hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode()); hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode()); hashCode = prime * hashCode + ((getClientToken() == null) ? 0 : getClientToken().hashCode()); hashCode = prime * hashCode + ((getEbsOptimized() == null) ? 0 : getEbsOptimized().hashCode());
if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false) return false; if (other.getBlockDeviceMappings() == null ^ this.getBlockDeviceMappings() == null) return false; if (other.getBlockDeviceMappings() != null && other.getBlockDeviceMappings().equals(this.getBlockDeviceMappings()) == false) return false; if (other.getClientToken() == null ^ this.getClientToken() == null)