java.lang.Object
software.amazon.awssdk.services.ec2.model.Image
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Image.Builder,Image>

@Generated("software.amazon.awssdk:codegen") public final class Image extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Image.Builder,Image>

Describes an image.

See Also:
  • Method Details

    • architecture

      public final ArchitectureValues architecture()

      The architecture of the image.

      If the service returns an enum value that is not available in the current SDK version, architecture will return ArchitectureValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from architectureAsString().

      Returns:
      The architecture of the image.
      See Also:
    • architectureAsString

      public final String architectureAsString()

      The architecture of the image.

      If the service returns an enum value that is not available in the current SDK version, architecture will return ArchitectureValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from architectureAsString().

      Returns:
      The architecture of the image.
      See Also:
    • creationDate

      public final String creationDate()

      The date and time the image was created.

      Returns:
      The date and time the image was created.
    • imageId

      public final String imageId()

      The ID of the AMI.

      Returns:
      The ID of the AMI.
    • imageLocation

      public final String imageLocation()

      The location of the AMI.

      Returns:
      The location of the AMI.
    • imageType

      public final ImageTypeValues imageType()

      The type of image.

      If the service returns an enum value that is not available in the current SDK version, imageType will return ImageTypeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from imageTypeAsString().

      Returns:
      The type of image.
      See Also:
    • imageTypeAsString

      public final String imageTypeAsString()

      The type of image.

      If the service returns an enum value that is not available in the current SDK version, imageType will return ImageTypeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from imageTypeAsString().

      Returns:
      The type of image.
      See Also:
    • kernelId

      public final String kernelId()

      The kernel associated with the image, if any. Only applicable for machine images.

      Returns:
      The kernel associated with the image, if any. Only applicable for machine images.
    • ownerId

      public final String ownerId()

      The ID of the Amazon Web Services account that owns the image.

      Returns:
      The ID of the Amazon Web Services account that owns the image.
    • platform

      public final PlatformValues platform()

      This value is set to windows for Windows AMIs; otherwise, it is blank.

      If the service returns an enum value that is not available in the current SDK version, platform will return PlatformValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from platformAsString().

      Returns:
      This value is set to windows for Windows AMIs; otherwise, it is blank.
      See Also:
    • platformAsString

      public final String platformAsString()

      This value is set to windows for Windows AMIs; otherwise, it is blank.

      If the service returns an enum value that is not available in the current SDK version, platform will return PlatformValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from platformAsString().

      Returns:
      This value is set to windows for Windows AMIs; otherwise, it is blank.
      See Also:
    • platformDetails

      public final String platformDetails()

      The platform details associated with the billing code of the AMI. For more information, see Understand AMI billing information in the Amazon EC2 User Guide.

      Returns:
      The platform details associated with the billing code of the AMI. For more information, see Understand AMI billing information in the Amazon EC2 User Guide.
    • usageOperation

      public final String usageOperation()

      The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. usageOperation corresponds to the lineitem/Operation column on your Amazon Web Services Cost and Usage Report and in the Amazon Web Services Price List API. You can view these fields on the Instances or AMIs pages in the Amazon EC2 console, or in the responses that are returned by the DescribeImages command in the Amazon EC2 API, or the describe-images command in the CLI.

      Returns:
      The operation of the Amazon EC2 instance and the billing code that is associated with the AMI. usageOperation corresponds to the lineitem/Operation column on your Amazon Web Services Cost and Usage Report and in the Amazon Web Services Price List API. You can view these fields on the Instances or AMIs pages in the Amazon EC2 console, or in the responses that are returned by the DescribeImages command in the Amazon EC2 API, or the describe-images command in the CLI.
    • hasProductCodes

      public final boolean hasProductCodes()
      For responses, this returns true if the service returned a value for the ProductCodes property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • productCodes

      public final List<ProductCode> productCodes()

      Any product codes associated with the AMI.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasProductCodes() method.

      Returns:
      Any product codes associated with the AMI.
    • ramdiskId

      public final String ramdiskId()

      The RAM disk associated with the image, if any. Only applicable for machine images.

      Returns:
      The RAM disk associated with the image, if any. Only applicable for machine images.
    • state

      public final ImageState state()

      The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

      If the service returns an enum value that is not available in the current SDK version, state will return ImageState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      Returns:
      The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
      See Also:
    • stateAsString

      public final String stateAsString()

      The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.

      If the service returns an enum value that is not available in the current SDK version, state will return ImageState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from stateAsString().

      Returns:
      The current state of the AMI. If the state is available, the image is successfully registered and can be used to launch an instance.
      See Also:
    • hasBlockDeviceMappings

      public final boolean hasBlockDeviceMappings()
      For responses, this returns true if the service returned a value for the BlockDeviceMappings property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • blockDeviceMappings

      public final List<BlockDeviceMapping> blockDeviceMappings()

      Any block device mapping entries.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasBlockDeviceMappings() method.

      Returns:
      Any block device mapping entries.
    • description

      public final String description()

      The description of the AMI that was provided during image creation.

      Returns:
      The description of the AMI that was provided during image creation.
    • enaSupport

      public final Boolean enaSupport()

      Specifies whether enhanced networking with ENA is enabled.

      Returns:
      Specifies whether enhanced networking with ENA is enabled.
    • hypervisor

      public final HypervisorType hypervisor()

      The hypervisor type of the image. Only xen is supported. ovm is not supported.

      If the service returns an enum value that is not available in the current SDK version, hypervisor will return HypervisorType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from hypervisorAsString().

      Returns:
      The hypervisor type of the image. Only xen is supported. ovm is not supported.
      See Also:
    • hypervisorAsString

      public final String hypervisorAsString()

      The hypervisor type of the image. Only xen is supported. ovm is not supported.

      If the service returns an enum value that is not available in the current SDK version, hypervisor will return HypervisorType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from hypervisorAsString().

      Returns:
      The hypervisor type of the image. Only xen is supported. ovm is not supported.
      See Also:
    • imageOwnerAlias

      public final String imageOwnerAlias()

      The owner alias (amazon | aws-marketplace).

      Returns:
      The owner alias (amazon | aws-marketplace).
    • name

      public final String name()

      The name of the AMI that was provided during image creation.

      Returns:
      The name of the AMI that was provided during image creation.
    • rootDeviceName

      public final String rootDeviceName()

      The device name of the root device volume (for example, /dev/sda1).

      Returns:
      The device name of the root device volume (for example, /dev/sda1).
    • rootDeviceType

      public final DeviceType rootDeviceType()

      The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

      If the service returns an enum value that is not available in the current SDK version, rootDeviceType will return DeviceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from rootDeviceTypeAsString().

      Returns:
      The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.
      See Also:
    • rootDeviceTypeAsString

      public final String rootDeviceTypeAsString()

      The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.

      If the service returns an enum value that is not available in the current SDK version, rootDeviceType will return DeviceType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from rootDeviceTypeAsString().

      Returns:
      The type of root device used by the AMI. The AMI can use an Amazon EBS volume or an instance store volume.
      See Also:
    • sriovNetSupport

      public final String sriovNetSupport()

      Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.

      Returns:
      Specifies whether enhanced networking with the Intel 82599 Virtual Function interface is enabled.
    • stateReason

      public final StateReason stateReason()

      The reason for the state change.

      Returns:
      The reason for the state change.
    • hasTags

      public final boolean hasTags()
      For responses, this returns true if the service returned a value for the Tags property. This DOES NOT check that the value is non-empty (for which, you should check the isEmpty() method on the property). This is useful because the SDK will never return a null collection or map, but you may need to differentiate between the service returning nothing (or null) and the service returning an empty collection or map. For requests, this returns true if a value for the property was specified in the request builder, and false if a value was not specified.
    • tags

      public final List<Tag> tags()

      Any tags assigned to the image.

      Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.

      This method will never return null. If you would like to know whether the service returned this field (so that you can differentiate between null and empty), you can use the hasTags() method.

      Returns:
      Any tags assigned to the image.
    • virtualizationType

      public final VirtualizationType virtualizationType()

      The type of virtualization of the AMI.

      If the service returns an enum value that is not available in the current SDK version, virtualizationType will return VirtualizationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from virtualizationTypeAsString().

      Returns:
      The type of virtualization of the AMI.
      See Also:
    • virtualizationTypeAsString

      public final String virtualizationTypeAsString()

      The type of virtualization of the AMI.

      If the service returns an enum value that is not available in the current SDK version, virtualizationType will return VirtualizationType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from virtualizationTypeAsString().

      Returns:
      The type of virtualization of the AMI.
      See Also:
    • bootMode

      public final BootModeValues bootMode()

      The boot mode of the image. For more information, see Boot modes in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, bootMode will return BootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from bootModeAsString().

      Returns:
      The boot mode of the image. For more information, see Boot modes in the Amazon EC2 User Guide.
      See Also:
    • bootModeAsString

      public final String bootModeAsString()

      The boot mode of the image. For more information, see Boot modes in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, bootMode will return BootModeValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from bootModeAsString().

      Returns:
      The boot mode of the image. For more information, see Boot modes in the Amazon EC2 User Guide.
      See Also:
    • tpmSupport

      public final TpmSupportValues tpmSupport()

      If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, tpmSupport will return TpmSupportValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from tpmSupportAsString().

      Returns:
      If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.
      See Also:
    • tpmSupportAsString

      public final String tpmSupportAsString()

      If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, tpmSupport will return TpmSupportValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from tpmSupportAsString().

      Returns:
      If the image is configured for NitroTPM support, the value is v2.0. For more information, see NitroTPM in the Amazon EC2 User Guide.
      See Also:
    • deprecationTime

      public final String deprecationTime()

      The date and time to deprecate the AMI, in UTC, in the following format: YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.

      Returns:
      The date and time to deprecate the AMI, in UTC, in the following format: YYYY-MM-DDTHH:MM:SSZ. If you specified a value for seconds, Amazon EC2 rounds the seconds to the nearest minute.
    • imdsSupport

      public final ImdsSupportValues imdsSupport()

      If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, imdsSupport will return ImdsSupportValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from imdsSupportAsString().

      Returns:
      If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide.
      See Also:
    • imdsSupportAsString

      public final String imdsSupportAsString()

      If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide.

      If the service returns an enum value that is not available in the current SDK version, imdsSupport will return ImdsSupportValues.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from imdsSupportAsString().

      Returns:
      If v2.0, it indicates that IMDSv2 is specified in the AMI. Instances launched from this AMI will have HttpTokens automatically set to required so that, by default, the instance requires that IMDSv2 is used when requesting instance metadata. In addition, HttpPutResponseHopLimit is set to 2. For more information, see Configure the AMI in the Amazon EC2 User Guide.
      See Also:
    • sourceInstanceId

      public final String sourceInstanceId()

      The ID of the instance that the AMI was created from if the AMI was created using CreateImage. This field only appears if the AMI was created using CreateImage.

      Returns:
      The ID of the instance that the AMI was created from if the AMI was created using CreateImage. This field only appears if the AMI was created using CreateImage.
    • deregistrationProtection

      public final String deregistrationProtection()

      Indicates whether deregistration protection is enabled for the AMI.

      Returns:
      Indicates whether deregistration protection is enabled for the AMI.
    • lastLaunchedTime

      public final String lastLaunchedTime()

      The date and time, in ISO 8601 date-time format, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.

      lastLaunchedTime data is available starting April 2017.

      Returns:
      The date and time, in ISO 8601 date-time format, when the AMI was last used to launch an EC2 instance. When the AMI is used to launch an instance, there is a 24-hour delay before that usage is reported.

      lastLaunchedTime data is available starting April 2017.

    • publicLaunchPermissions

      public final Boolean publicLaunchPermissions()

      Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.

      Returns:
      Indicates whether the image has public launch permissions. The value is true if this image has public launch permissions or false if it has only implicit and explicit launch permissions.
    • toBuilder

      public Image.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<Image.Builder,Image>
      Returns:
      a builder for type T
    • builder

      public static Image.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Image.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.