Package io.micronaut.discovery.cloud
Class AbstractComputeInstanceMetadata
java.lang.Object
io.micronaut.discovery.cloud.AbstractComputeInstanceMetadata
- All Implemented Interfaces:
ComputeInstanceMetadata
- Direct Known Subclasses:
DigitalOceanInstanceMetadata
public abstract class AbstractComputeInstanceMetadata
extends Object
implements ComputeInstanceMetadata
Abstract class representing a cloud computing instance metadata.
- Since:
- 1.1
- Author:
- Alvaro Sanchez-Mariscal
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThe network interfaces attached to the compute instance.The metadata as a map.getName()
The name of the instance.getTags()
The tags attached to the instance.boolean
isCached()
void
setAccount
(String account) void
setAvailabilityZone
(String availabilityZone) void
setCached
(boolean cached) void
setDescription
(String description) void
setImageId
(String imageId) void
setInstanceId
(String instanceId) void
setInterfaces
(List<NetworkInterface> interfaces) void
setLocalHostname
(String localHostname) void
setMachineType
(String machineType) void
setMetadata
(Map<String, String> metadata) void
void
setPrivateIpV4
(String privateIpV4) void
setPrivateIpV6
(String privateIpV6) void
setPublicHostname
(String publicHostname) void
setPublicIpV4
(String publicIpV4) void
setPublicIpV6
(String publicIpV6) void
void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.discovery.cloud.ComputeInstanceMetadata
getComputePlatform
-
Field Details
-
region
-
availabilityZone
-
-
Constructor Details
-
AbstractComputeInstanceMetadata
public AbstractComputeInstanceMetadata()
-
-
Method Details
-
getImageId
- Specified by:
getImageId
in interfaceComputeInstanceMetadata
- Returns:
- The ID of the image used for the instance
-
getAccount
- Specified by:
getAccount
in interfaceComputeInstanceMetadata
- Returns:
- The account the instance is associated with
-
getMetadata
Description copied from interface:ComputeInstanceMetadata
The metadata as a map.- Specified by:
getMetadata
in interfaceComputeInstanceMetadata
- Returns:
- A map of metadata
-
getInterfaces
Description copied from interface:ComputeInstanceMetadata
The network interfaces attached to the compute instance.- Specified by:
getInterfaces
in interfaceComputeInstanceMetadata
- Returns:
- The
NetworkInterface
instances
-
getTags
Description copied from interface:ComputeInstanceMetadata
The tags attached to the instance.- Specified by:
getTags
in interfaceComputeInstanceMetadata
- Returns:
- A map of tags
-
getName
Description copied from interface:ComputeInstanceMetadata
The name of the instance. Usually the same asComputeInstanceMetadata.getInstanceId()
. Some cloud platforms assign unique IDs- Specified by:
getName
in interfaceComputeInstanceMetadata
- Returns:
- The name of the instance
-
getRegion
- Specified by:
getRegion
in interfaceComputeInstanceMetadata
- Returns:
- The region of the instance
-
getInstanceId
- Specified by:
getInstanceId
in interfaceComputeInstanceMetadata
- Returns:
- The instance id
-
getMachineType
- Specified by:
getMachineType
in interfaceComputeInstanceMetadata
- Returns:
- The machine type
-
getAvailabilityZone
- Specified by:
getAvailabilityZone
in interfaceComputeInstanceMetadata
- Returns:
- The availability zone of the instance
-
getLocalHostname
- Specified by:
getLocalHostname
in interfaceComputeInstanceMetadata
- Returns:
- The local host name of the instance
-
getPrivateHostname
- Specified by:
getPrivateHostname
in interfaceComputeInstanceMetadata
- Returns:
- The private host name of the instance
-
getPublicIpV4
- Specified by:
getPublicIpV4
in interfaceComputeInstanceMetadata
- Returns:
- The public IP of the instance
-
getPublicIpV6
- Specified by:
getPublicIpV6
in interfaceComputeInstanceMetadata
- Returns:
- The public IP v6 of the instance
-
getPrivateIpV4
- Specified by:
getPrivateIpV4
in interfaceComputeInstanceMetadata
- Returns:
- The private IP of the instance
-
getPrivateIpV6
- Specified by:
getPrivateIpV6
in interfaceComputeInstanceMetadata
- Returns:
- The private IP v6 of the instance
-
getDescription
- Specified by:
getDescription
in interfaceComputeInstanceMetadata
- Returns:
- A description of the instance
-
getPublicHostname
- Specified by:
getPublicHostname
in interfaceComputeInstanceMetadata
- Returns:
- The public host name of the instance
-
isCached
public boolean isCached()- Specified by:
isCached
in interfaceComputeInstanceMetadata
- Returns:
- Is this cached instance metadata
-
setInterfaces
- Parameters:
interfaces
- the list of interfaces
-
setMetadata
- Parameters:
metadata
- key/value metadata
-
setName
- Parameters:
name
- instance name
-
setAvailabilityZone
- Parameters:
availabilityZone
- the availability zone
-
setLocalHostname
- Parameters:
localHostname
- the local host name
-
setPublicHostname
- Parameters:
publicHostname
- the public host name
-
setDescription
- Parameters:
description
- the description
-
setMachineType
- Parameters:
machineType
- the machine type
-
setInstanceId
- Parameters:
instanceId
- the instance ID
-
setRegion
- Parameters:
region
- the region
-
setAccount
- Parameters:
account
- the account
-
setImageId
- Parameters:
imageId
- the image ID
-
setPublicIpV4
- Parameters:
publicIpV4
- the public IPV4
-
setPublicIpV6
- Parameters:
publicIpV6
- the public IPV6
-
setPrivateIpV4
- Parameters:
privateIpV4
- the private IPV4
-
setPrivateIpV6
- Parameters:
privateIpV6
- the private IPV4
-
setCached
public void setCached(boolean cached) - Parameters:
cached
- whether this instance is cached
-
setTags
- Parameters:
tags
- the instance tags
-