Class Instance
- All Implemented Interfaces:
Serializable
,SdkPojo
,ToCopyableBuilder<Instance.Builder,
Instance>
Describes an instance (a virtual private server).
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionaddOns()
An array of objects representing the add-ons enabled on the instance.final String
arn()
The Amazon Resource Name (ARN) of the instance (arn:aws:lightsail:us-east-2:123456789101:Instance/244ad76f-8aad-4741-809f-12345EXAMPLE
).final String
The blueprint ID (amazon_linux_2023
).final String
The friendly name of the blueprint (Amazon Linux 2023
).static Instance.Builder
builder()
final String
bundleId()
The bundle for the instance (micro_x_x
).final Instant
The timestamp when the instance was created (1479734909.17
) in Unix time format.final boolean
final boolean
equalsBySdkFields
(Object obj) Indicates whether some other object is "equal to" this one by SDK fields.final <T> Optional
<T> getValueForField
(String fieldName, Class<T> clazz) final InstanceHardware
hardware()
The size of the vCPU and the amount of RAM for the instance.final boolean
For responses, this returns true if the service returned a value for the AddOns property.final int
hashCode()
final boolean
For responses, this returns true if the service returned a value for the Ipv6Addresses property.final boolean
hasTags()
For responses, this returns true if the service returned a value for the Tags property.final IpAddressType
The IP address type of the instance.final String
The IP address type of the instance.The IPv6 addresses of the instance.final Boolean
A Boolean value indicating whether this instance has a static IP assigned to it.final ResourceLocation
location()
The region name and Availability Zone where the instance is located.final InstanceMetadataOptions
The metadata options for the Amazon Lightsail instance.final String
name()
The name the user gave the instance (Amazon_Linux_2023-1
).final InstanceNetworking
Information about the public ports and monthly data transfer rates for the instance.final String
The private IP address of the instance.final String
The public IP address of the instance.final ResourceType
The type of resource (usuallyInstance
).final String
The type of resource (usuallyInstance
).static Class
<? extends Instance.Builder> final String
The name of the SSH key being used to connect to the instance (LightsailDefaultKeyPair
).final InstanceState
state()
The status code and the state (running
) for the instance.final String
The support code.tags()
The tag keys and optional values for the resource.Take this object and create a builder that contains all of the current property values of this object.final String
toString()
Returns a string representation of this object.final String
username()
The user name for connecting to the instance (ec2-user
).Methods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
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
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
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
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
The region name and Availability Zone where the instance is located.
- Returns:
- The region name and Availability Zone where the instance is located.
-
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 returnResourceType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromresourceTypeAsString()
.- Returns:
- The type of resource (usually
Instance
). - See Also:
-
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 returnResourceType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromresourceTypeAsString()
.- 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 theisEmpty()
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
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
The blueprint ID (
amazon_linux_2023
).- Returns:
- The blueprint ID (
amazon_linux_2023
).
-
blueprintName
The friendly name of the blueprint (
Amazon Linux 2023
).- Returns:
- The friendly name of the blueprint (
Amazon Linux 2023
).
-
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 theisEmpty()
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
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
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
The private IP address of the instance.
- Returns:
- The private IP address of the instance.
-
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 theisEmpty()
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
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
The IP address type of the instance.
The possible values are
ipv4
for IPv4 only,ipv6
for IPv6 only, anddualstack
for IPv4 and IPv6.If the service returns an enum value that is not available in the current SDK version,
ipAddressType
will returnIpAddressType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromipAddressTypeAsString()
.- Returns:
- The IP address type of the instance.
The possible values are
ipv4
for IPv4 only,ipv6
for IPv6 only, anddualstack
for IPv4 and IPv6. - See Also:
-
ipAddressTypeAsString
The IP address type of the instance.
The possible values are
ipv4
for IPv4 only,ipv6
for IPv6 only, anddualstack
for IPv4 and IPv6.If the service returns an enum value that is not available in the current SDK version,
ipAddressType
will returnIpAddressType.UNKNOWN_TO_SDK_VERSION
. The raw value returned by the service is available fromipAddressTypeAsString()
.- Returns:
- The IP address type of the instance.
The possible values are
ipv4
for IPv4 only,ipv6
for IPv6 only, anddualstack
for IPv4 and IPv6. - See Also:
-
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
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
The status code and the state (
running
) for the instance.- Returns:
- The status code and the state (
running
) for the instance.
-
username
The user name for connecting to the instance (
ec2-user
).- Returns:
- The user name for connecting to the instance (
ec2-user
).
-
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
The metadata options for the Amazon Lightsail instance.
- Returns:
- The metadata options for the Amazon Lightsail instance.
-
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 interfaceToCopyableBuilder<Instance.Builder,
Instance> - Returns:
- a builder for type T
-
builder
-
serializableBuilderClass
-
hashCode
-
equals
-
equalsBySdkFields
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 anSdkPojo
class, and is generated based on a service model.If an
SdkPojo
class does not have any inherited fields,equalsBySdkFields
andequals
are essentially the same.- Specified by:
equalsBySdkFields
in interfaceSdkPojo
- Parameters:
obj
- the object to be compared with- Returns:
- true if the other object equals to this object by sdk fields, false otherwise.
-
toString
-
getValueForField
-
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToField
in interfaceSdkPojo
- Returns:
- The mapping between the field name and its corresponding field.
-