Tabnine Logo
Image
Code IndexAdd Tabnine to your IDE (free)

How to use
Image
in
com.amazonaws.services.ec2.model

Best Java code snippets using com.amazonaws.services.ec2.model.Image (Showing top 20 results out of 315)

origin: aws/aws-sdk-java

@Override
public int hashCode() {
  final int prime = 31;
  int hashCode = 1;
  hashCode = prime * hashCode + ((getArchitecture() == null) ? 0 : getArchitecture().hashCode());
  hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode());
  hashCode = prime * hashCode + ((getImageId() == null) ? 0 : getImageId().hashCode());
  hashCode = prime * hashCode + ((getImageLocation() == null) ? 0 : getImageLocation().hashCode());
  hashCode = prime * hashCode + ((getImageType() == null) ? 0 : getImageType().hashCode());
  hashCode = prime * hashCode + ((getPublic() == null) ? 0 : getPublic().hashCode());
  hashCode = prime * hashCode + ((getKernelId() == null) ? 0 : getKernelId().hashCode());
  hashCode = prime * hashCode + ((getOwnerId() == null) ? 0 : getOwnerId().hashCode());
  hashCode = prime * hashCode + ((getPlatform() == null) ? 0 : getPlatform().hashCode());
  hashCode = prime * hashCode + ((getProductCodes() == null) ? 0 : getProductCodes().hashCode());
  hashCode = prime * hashCode + ((getRamdiskId() == null) ? 0 : getRamdiskId().hashCode());
  hashCode = prime * hashCode + ((getState() == null) ? 0 : getState().hashCode());
  hashCode = prime * hashCode + ((getBlockDeviceMappings() == null) ? 0 : getBlockDeviceMappings().hashCode());
  hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
  hashCode = prime * hashCode + ((getEnaSupport() == null) ? 0 : getEnaSupport().hashCode());
  hashCode = prime * hashCode + ((getHypervisor() == null) ? 0 : getHypervisor().hashCode());
  hashCode = prime * hashCode + ((getImageOwnerAlias() == null) ? 0 : getImageOwnerAlias().hashCode());
  hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
  hashCode = prime * hashCode + ((getRootDeviceName() == null) ? 0 : getRootDeviceName().hashCode());
  hashCode = prime * hashCode + ((getRootDeviceType() == null) ? 0 : getRootDeviceType().hashCode());
  hashCode = prime * hashCode + ((getSriovNetSupport() == null) ? 0 : getSriovNetSupport().hashCode());
  hashCode = prime * hashCode + ((getStateReason() == null) ? 0 : getStateReason().hashCode());
  hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
  hashCode = prime * hashCode + ((getVirtualizationType() == null) ? 0 : getVirtualizationType().hashCode());
  return hashCode;
}
origin: aws-amplify/aws-sdk-android

public Image unmarshall(StaxUnmarshallerContext context) throws Exception {
  Image image = new Image();
  int originalDepth = context.getCurrentDepth();
  int targetDepth = originalDepth + 1;
        image.setImageId(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setImageLocation(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setState(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setOwnerId(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setCreationDate(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setPublic(BooleanStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.getProductCodes().add(ProductCodeStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setArchitecture(StringStaxUnmarshaller.getInstance().unmarshall(context));
        continue;
        image.setImageType(StringStaxUnmarshaller.getInstance().unmarshall(context));
origin: zalando-stups/fullstop

    .filter(img -> img.getName().startsWith(taupageNamePrefix))
    .map(Image::getOwnerId)
    .map(taupageOwners::contains);
    taupageExpirationTimeProvider.getExpirationTime(region, image.getOwnerId(), image.getImageId()));
if (optionalExpirationDate.isPresent()) {
  final ZonedDateTime expirationDate = optionalExpirationDate.get();
        .withApplicationVersion(taupageYaml.map(TaupageYaml::getApplicationVersion).map(StringUtils::trimToNull).orElse(null))
        .withMetaInfo(ImmutableMap.of(
            "ami_owner_id", image.getOwnerId(),
            "ami_id", image.getImageId(),
            "ami_name", image.getName(),
            "expiration_date", expirationDate.toString()))
        .build());
origin: org.kuali.common/kuali-aws

protected BlockDeviceMapping getRootBlockDeviceMapping(Image image) {
  String rootDeviceName = image.getRootDeviceName();
  List<BlockDeviceMapping> mappings = image.getBlockDeviceMappings();
  for (BlockDeviceMapping mapping : mappings) {
    String deviceName = mapping.getDeviceName();
    if (rootDeviceName.equals(deviceName)) {
      return mapping;
    }
  }
  throw illegalState("Could not locate the root block device mapping for AMI [%s]", image.getImageId());
}
origin: com.netflix.spinnaker.clouddriver/clouddriver-aws

 public String getId() {
  return image.getImageId();
 }
}
origin: org.jenkins-ci.plugins/ec2

private List<BlockDeviceMapping> getAmiBlockDeviceMappings() {
  /*
   * AmazonEC2#describeImageAttribute does not work due to a bug
   * https://forums.aws.amazon.com/message.jspa?messageID=231972
   */
  for (final Image image: getParent().connect().describeImages().getImages()) {
    if (ami.equals(image.getImageId())) {
      return image.getBlockDeviceMappings();
    }
  }
  throw new AmazonClientException("Unable to get AMI device mapping for " + ami);
}
origin: org.wso2.testgrid/org.wso2.testgrid.infrastructure

        parameterName, lookupParameters.getProperty(parameterName), ami.getTags())) {
      isMissingLookupParams = true;
      break;
  return Optional.empty();
} else if (applicableAMIList.size() == 1) {
  return Optional.of(applicableAMIList.get(0).getImageId());
} else {
  String environment = ConfigurationContext.
    logger.info("Setting up AMI environment as " + environment);
    for (Image image : applicableAMIList) {
      for (Tag amiTag : image.getTags()) {
        if (AMI_TAG_TESTGRID_ENVIRONMENT.equals(amiTag.getKey())) {
          if (amiTag.getValue().equals(environment)) {
            return Optional.of(image.getImageId());
  } else {
    logger.warn("Execution environment of TESTGRID_ENVIRONMENT is not set in config.properties.");
    return Optional.of(applicableAMIList.get(0).getImageId());
origin: org.jenkins-ci.plugins/ec2

  String ownerAlias = img.get(0).getImageOwnerAlias();
  return FormValidation.ok(img.get(0).getImageLocation() +
      (ownerAlias != null ? " by " + ownerAlias : ""));
} catch (AmazonClientException e) {
origin: aws-amplify/aws-sdk-android

/**
 * Any block device mapping entries.
 * <p>
 * Returns a reference to this object so that method calls can be chained together.
 *
 * @param blockDeviceMappings Any block device mapping entries.
 *
 * @return A reference to this updated object so that method calls can be chained
 *         together.
 */
public Image withBlockDeviceMappings(BlockDeviceMapping... blockDeviceMappings) {
  if (getBlockDeviceMappings() == null) setBlockDeviceMappings(new java.util.ArrayList<BlockDeviceMapping>(blockDeviceMappings.length));
  for (BlockDeviceMapping value : blockDeviceMappings) {
    getBlockDeviceMappings().add(value);
  }
  return this;
}

origin: com.netflix.spinnaker.clouddriver/clouddriver-aws

public String getName() {
 return image.getName();
}
origin: jenkinsci/ec2-plugin

private List<BlockDeviceMapping> getAmiBlockDeviceMappings() {
  /*
   * AmazonEC2#describeImageAttribute does not work due to a bug
   * https://forums.aws.amazon.com/message.jspa?messageID=231972
   */
  return getImage().getBlockDeviceMappings();
}
origin: org.kuali.common/kuali-aws

@Override
public boolean isTrue() {
  Image image = service.getImage(imageId);
  return this.state.equals(image.getState());
}
origin: UrbanCode/terraform

private void updatePlatform() {
  // update the platform
  List<String> imageId = new ArrayList<String>();
  imageId.add(amiId);
  List<Image> images = helper.getImages(null, imageId, ec2Client);
  if (images != null) {
    Image image = images.get(0);
    platform = image.getPlatform();
  }
  if (platform == null || "".equals(platform)) {
    platform = "linux";
  }
}
origin: jenkinsci/ec2-plugin

private void setupRootDevice(List<BlockDeviceMapping> deviceMappings) {
  if (deleteRootOnTermination && getImage().getRootDeviceType().equals("ebs")) {
    // get the root device (only one expected in the blockmappings)
    final List<BlockDeviceMapping> rootDeviceMappings = getAmiBlockDeviceMappings();
    BlockDeviceMapping rootMapping = null;
    for (final BlockDeviceMapping deviceMapping : rootDeviceMappings) {
      System.out.println("AMI had " + deviceMapping.getDeviceName());
      System.out.println(deviceMapping.getEbs());
      rootMapping = deviceMapping;
      break;
    }
    // Check if the root device is already in the mapping and update it
    for (final BlockDeviceMapping mapping : deviceMappings) {
      System.out.println("Request had " + mapping.getDeviceName());
      if (rootMapping.getDeviceName().equals(mapping.getDeviceName())) {
        mapping.getEbs().setDeleteOnTermination(Boolean.TRUE);
        return;
      }
    }
    // Create a shadow of the AMI mapping (doesn't like reusing rootMapping directly)
    BlockDeviceMapping newMapping = new BlockDeviceMapping().withDeviceName(rootMapping.getDeviceName());
    EbsBlockDevice newEbs = new EbsBlockDevice();
    newEbs.setDeleteOnTermination(Boolean.TRUE);
    newMapping.setEbs(newEbs);
    deviceMappings.add(0, newMapping);
  }
}
origin: jenkinsci/ec2-plugin

private Image getImage() {
  DescribeImagesRequest request = new DescribeImagesRequest().withImageIds(ami);
  for (final Image image : getParent().connect().describeImages(request).getImages()) {
    if (ami.equals(image.getImageId())) {
      return image;
    }
  }
  throw new AmazonClientException("Unable to find AMI " + ami);
}
origin: jenkinsci/ec2-plugin

  String ownerAlias = img.get(0).getImageOwnerAlias();
  return FormValidation.ok(img.get(0).getImageLocation() + (ownerAlias != null ? " by " + ownerAlias : ""));
} catch (AmazonClientException e) {
  return FormValidation.error(e.getMessage());
origin: zalando-stups/fullstop

@Override
public Optional<Boolean> isTaupageAmi() {
  return getAmi()
      .filter(image -> image.getName().startsWith(taupageNamePrefix))
      .map(Image::getOwnerId)
      .map(taupageOwners::contains);
}
origin: org.kuali.common/kuali-aws

@Override
public void purgeAmi(String imageId) {
  Image image = getImage(imageId);
  List<String> snapshotIds = newArrayList();
  List<BlockDeviceMapping> mappings = image.getBlockDeviceMappings();
  for (BlockDeviceMapping mapping : mappings) {
    Optional<EbsBlockDevice> ebsBlockDevice = fromNullable(mapping.getEbs());
    if (ebsBlockDevice.isPresent()) {
      snapshotIds.add(ebsBlockDevice.get().getSnapshotId());
    }
  }
  DeregisterImageRequest request = new DeregisterImageRequest();
  request.setImageId(imageId);
  client.deregisterImage(request);
  for (String snapshotId : snapshotIds) {
    deleteSnapshot(snapshotId);
  }
}
origin: aws/aws-sdk-java

  return false;
Image other = (Image) obj;
if (other.getArchitecture() == null ^ this.getArchitecture() == null)
  return false;
if (other.getArchitecture() != null && other.getArchitecture().equals(this.getArchitecture()) == false)
  return false;
if (other.getCreationDate() == null ^ this.getCreationDate() == null)
  return false;
if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == 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.getImageLocation() == null ^ this.getImageLocation() == null)
  return false;
if (other.getImageLocation() != null && other.getImageLocation().equals(this.getImageLocation()) == false)
  return false;
if (other.getImageType() == null ^ this.getImageType() == null)
  return false;
if (other.getImageType() != null && other.getImageType().equals(this.getImageType()) == false)
  return false;
if (other.getPublic() == null ^ this.getPublic() == null)
  return false;
if (other.getPublic() != null && other.getPublic().equals(this.getPublic()) == false)
  return false;
if (other.getKernelId() == null ^ this.getKernelId() == null)
  return false;
if (other.getKernelId() != null && other.getKernelId().equals(this.getKernelId()) == false)
origin: LendingClub/mercator

@Override
protected void doScan() {
  AmazonEC2Client c = getClient();
  
  NeoRxClient neoRx = getNeoRxClient();
  Preconditions.checkNotNull(neoRx);
  GraphNodeGarbageCollector gc = newGarbageCollector().bindScannerContext();
  DescribeImagesRequest req = new DescribeImagesRequest().withOwners("self");
  DescribeImagesResult result = c.describeImages(req);
  
  rateLimit();
  result.getImages().forEach(i -> { 
    try { 
      ObjectNode n = convertAwsObject(i, getRegion());
    
      
      String cypher = "merge (x:AwsAmi {aws_arn:{aws_arn}}) set x+={props} set x.updateTs=timestamp() return x";
      neoRx.execCypher(cypher, "aws_arn", n.path("aws_arn").asText(), "props",n).forEach( r->{
        gc.MERGE_ACTION.accept(r);
        getShadowAttributeRemover().removeTagAttributes("AwsAmi", n, r);
      });
      incrementEntityCount();
    } catch (RuntimeException e) { 
      maybeThrow(e,"problem scanning AMI "+i.getImageId());
    }
  });

}
com.amazonaws.services.ec2.modelImage

Javadoc

Describes an image.

Most used methods

  • getImageId
    The ID of the AMI.
  • getName
    The name of the AMI that was provided during image creation.
  • getBlockDeviceMappings
    Any block device mapping entries.
  • getImageLocation
    The location of the AMI.
  • getImageOwnerAlias
    The AWS account alias (for example, amazon, self) or the AWS account ID of the AMI owner.
  • getOwnerId
    The AWS account ID of the image owner.
  • getPlatform
    The value is Windows for Windows AMIs; otherwise blank.
  • getRootDeviceName
    The device name of the root device volume (for example, /dev/sda1).
  • getRootDeviceType
    The type of root device used by the AMI. The AMI can use an EBS volume or an instance store volume.
  • getState
    The current state of the AMI. If the state is available, the image is successfully registered and c
  • getTags
    Any tags assigned to the image.
  • setImageId
    The ID of the AMI.
  • getTags,
  • setImageId,
  • <init>,
  • getArchitecture,
  • getCreationDate,
  • getDescription,
  • getHypervisor,
  • getImageType,
  • getKernelId,
  • getProductCodes

Popular in Java

  • Finding current android device location
  • getContentResolver (Context)
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JCheckBox (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now