Class SpotInstanceRequest

    • Method Detail

      • actualBlockHourlyPrice

        public final String actualBlockHourlyPrice()

        Deprecated.

        Returns:
        Deprecated.
      • availabilityZoneGroup

        public final String availabilityZoneGroup()

        The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.

        Returns:
        The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone.
      • blockDurationMinutes

        public final Integer blockDurationMinutes()

        Deprecated.

        Returns:
        Deprecated.
      • createTime

        public final Instant createTime()

        The date and time when the Spot Instance request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).

        Returns:
        The date and time when the Spot Instance request was created, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ).
      • fault

        public final SpotInstanceStateFault fault()

        The fault codes for the Spot Instance request, if any.

        Returns:
        The fault codes for the Spot Instance request, if any.
      • instanceId

        public final String instanceId()

        The instance ID, if an instance has been launched to fulfill the Spot Instance request.

        Returns:
        The instance ID, if an instance has been launched to fulfill the Spot Instance request.
      • launchGroup

        public final String launchGroup()

        The instance launch group. Launch groups are Spot Instances that launch together and terminate together.

        Returns:
        The instance launch group. Launch groups are Spot Instances that launch together and terminate together.
      • launchSpecification

        public final LaunchSpecification launchSpecification()

        Additional information for launching instances.

        Returns:
        Additional information for launching instances.
      • launchedAvailabilityZone

        public final String launchedAvailabilityZone()

        The Availability Zone in which the request is launched.

        Returns:
        The Availability Zone in which the request is launched.
      • spotInstanceRequestId

        public final String spotInstanceRequestId()

        The ID of the Spot Instance request.

        Returns:
        The ID of the Spot Instance request.
      • spotPrice

        public final String spotPrice()

        The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

        If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

        Returns:
        The maximum price per unit hour that you are willing to pay for a Spot Instance. We do not recommend using this parameter because it can lead to increased interruptions. If you do not specify this parameter, you will pay the current Spot price.

        If you specify a maximum price, your instances will be interrupted more frequently than if you do not specify this parameter.

      • state

        public final SpotInstanceState state()

        The state of the Spot Instance request. Spot request status information helps track your Spot Instance requests. For more information, see Spot request status in the Amazon EC2 User Guide for Linux Instances.

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

        Returns:
        The state of the Spot Instance request. Spot request status information helps track your Spot Instance requests. For more information, see Spot request status in the Amazon EC2 User Guide for Linux Instances.
        See Also:
        SpotInstanceState
      • stateAsString

        public final String stateAsString()

        The state of the Spot Instance request. Spot request status information helps track your Spot Instance requests. For more information, see Spot request status in the Amazon EC2 User Guide for Linux Instances.

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

        Returns:
        The state of the Spot Instance request. Spot request status information helps track your Spot Instance requests. For more information, see Spot request status in the Amazon EC2 User Guide for Linux Instances.
        See Also:
        SpotInstanceState
      • status

        public final SpotInstanceStatus status()

        The status code and status message describing the Spot Instance request.

        Returns:
        The status code and status message describing the Spot Instance request.
      • 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 resource.

        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 resource.
      • validFrom

        public final Instant validFrom()

        The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The request becomes active at this date and time.

        Returns:
        The start date of the request, in UTC format (for example, YYYY-MM-DDTHH:MM:SSZ). The request becomes active at this date and time.
      • validUntil

        public final Instant validUntil()

        The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

        • For a persistent request, the request remains active until the validUntil date and time is reached. Otherwise, the request remains active until you cancel it.

        • For a one-time request, the request remains active until all instances launch, the request is canceled, or the validUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

        Returns:
        The end date of the request, in UTC format (YYYY-MM-DDTHH:MM:SSZ).

        • For a persistent request, the request remains active until the validUntil date and time is reached. Otherwise, the request remains active until you cancel it.

        • For a one-time request, the request remains active until all instances launch, the request is canceled, or the validUntil date and time is reached. By default, the request is valid for 7 days from the date the request was created.

      • hashCode

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

        public final boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • 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)