Class Instance

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

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

Describes an instance (a virtual private server).

See Also:
  • Method Details

    • name

      public final String name()

      The name the user gave the instance (Amazon_Linux_2023-1).

      Returns:
      The name the user gave the instance (Amazon_Linux_2023-1).
    • arn

      public final String arn()

      The Amazon Resource Name (ARN) of the instance ( arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE).

      Returns:
      The Amazon Resource Name (ARN) of the instance ( arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE).
    • supportCode

      public final String supportCode()

      The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.

      Returns:
      The support code. Include this code in your email to support when you have questions about an instance or another resource in Lightsail. This code enables our support team to look up your Lightsail information more easily.
    • createdAt

      public final Instant createdAt()

      The timestamp when the instance was created (1479734909.17) in Unix time format.

      Returns:
      The timestamp when the instance was created (1479734909.17) in Unix time format.
    • location

      public final ResourceLocation location()

      The region name and Availability Zone where the instance is located.

      Returns:
      The region name and Availability Zone where the instance is located.
    • resourceType

      public final ResourceType resourceType()

      The type of resource (usually Instance).

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

      Returns:
      The type of resource (usually Instance).
      See Also:
    • resourceTypeAsString

      public final String resourceTypeAsString()

      The type of resource (usually Instance).

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

      Returns:
      The type of resource (usually Instance).
      See Also:
    • 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()

      The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.

      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:
      The tag keys and optional values for the resource. For more information about tags in Lightsail, see the Amazon Lightsail Developer Guide.
    • blueprintId

      public final String blueprintId()

      The blueprint ID (amazon_linux_2023).

      Returns:
      The blueprint ID (amazon_linux_2023).
    • blueprintName

      public final String blueprintName()

      The friendly name of the blueprint (Amazon Linux 2023).

      Returns:
      The friendly name of the blueprint (Amazon Linux 2023).
    • bundleId

      public final String bundleId()

      The bundle for the instance (micro_x_x).

      Returns:
      The bundle for the instance (micro_x_x).
    • hasAddOns

      public final boolean hasAddOns()
      For responses, this returns true if the service returned a value for the AddOns 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.
    • addOns

      public final List<AddOn> addOns()

      An array of objects representing the add-ons enabled on the instance.

      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 hasAddOns() method.

      Returns:
      An array of objects representing the add-ons enabled on the instance.
    • isStaticIp

      public final Boolean isStaticIp()

      A Boolean value indicating whether this instance has a static IP assigned to it.

      Returns:
      A Boolean value indicating whether this instance has a static IP assigned to it.
    • privateIpAddress

      public final String privateIpAddress()

      The private IP address of the instance.

      Returns:
      The private IP address of the instance.
    • publicIpAddress

      public final String publicIpAddress()

      The public IP address of the instance.

      Returns:
      The public IP address of the instance.
    • hasIpv6Addresses

      public final boolean hasIpv6Addresses()
      For responses, this returns true if the service returned a value for the Ipv6Addresses 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.
    • ipv6Addresses

      public final List<String> ipv6Addresses()

      The IPv6 addresses of the instance.

      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 hasIpv6Addresses() method.

      Returns:
      The IPv6 addresses of the instance.
    • ipAddressType

      public final IpAddressType ipAddressType()

      The IP address type of the instance.

      The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

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

      Returns:
      The IP address type of the instance.

      The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

      See Also:
    • ipAddressTypeAsString

      public final String ipAddressTypeAsString()

      The IP address type of the instance.

      The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

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

      Returns:
      The IP address type of the instance.

      The possible values are ipv4 for IPv4 only, ipv6 for IPv6 only, and dualstack for IPv4 and IPv6.

      See Also:
    • hardware

      public final InstanceHardware hardware()

      The size of the vCPU and the amount of RAM for the instance.

      Returns:
      The size of the vCPU and the amount of RAM for the instance.
    • networking

      public final InstanceNetworking networking()

      Information about the public ports and monthly data transfer rates for the instance.

      Returns:
      Information about the public ports and monthly data transfer rates for the instance.
    • state

      public final InstanceState state()

      The status code and the state (running) for the instance.

      Returns:
      The status code and the state (running) for the instance.
    • username

      public final String username()

      The user name for connecting to the instance (ec2-user).

      Returns:
      The user name for connecting to the instance (ec2-user).
    • sshKeyName

      public final String sshKeyName()

      The name of the SSH key being used to connect to the instance (LightsailDefaultKeyPair).

      Returns:
      The name of the SSH key being used to connect to the instance (LightsailDefaultKeyPair).
    • metadataOptions

      public final InstanceMetadataOptions metadataOptions()

      The metadata options for the Amazon Lightsail instance.

      Returns:
      The metadata options for the Amazon Lightsail instance.
    • toBuilder

      public Instance.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<Instance.Builder,Instance>
      Returns:
      a builder for type T
    • builder

      public static Instance.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Instance.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.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.