Class Instance

    • Method Detail

      • name

        public final String name()

        The name the user gave the instance (Amazon_Linux-1GB-Ohio-1).

        Returns:
        The name the user gave the instance (Amazon_Linux-1GB-Ohio-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.
      • 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 (os_amlinux_2016_03).

        Returns:
        The blueprint ID (os_amlinux_2016_03).
      • blueprintName

        public final String blueprintName()

        The friendly name of the blueprint (Amazon Linux).

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

        public final String bundleId()

        The bundle for the instance (micro_1_0).

        Returns:
        The bundle for the instance (micro_1_0).
      • 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, 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, and dualstack for IPv4 and IPv6.

        See Also:
        IpAddressType
      • ipAddressTypeAsString

        public final String ipAddressTypeAsString()

        The IP address type of the instance.

        The possible values are ipv4 for IPv4 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, and dualstack for IPv4 and IPv6.

        See Also:
        IpAddressType
      • 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.
      • 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)