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
Fields -
Constructor Summary
Constructors -
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.booleanisCached()voidsetAccount(String account) voidsetAvailabilityZone(String availabilityZone) voidsetCached(boolean cached) voidsetDescription(String description) voidsetImageId(String imageId) voidsetInstanceId(String instanceId) voidsetInterfaces(List<NetworkInterface> interfaces) voidsetLocalHostname(String localHostname) voidsetMachineType(String machineType) voidsetMetadata(Map<String, String> metadata) voidvoidsetPrivateIpV4(String privateIpV4) voidsetPrivateIpV6(String privateIpV6) voidsetPublicHostname(String publicHostname) voidsetPublicIpV4(String publicIpV4) voidsetPublicIpV6(String publicIpV6) voidvoidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.discovery.cloud.ComputeInstanceMetadata
getComputePlatform
-
Field Details
-
region
-
availabilityZone
-
-
Constructor Details
-
AbstractComputeInstanceMetadata
public AbstractComputeInstanceMetadata()
-
-
Method Details
-
getImageId
- Specified by:
getImageIdin interfaceComputeInstanceMetadata- Returns:
- The ID of the image used for the instance
-
getAccount
- Specified by:
getAccountin interfaceComputeInstanceMetadata- Returns:
- The account the instance is associated with
-
getMetadata
Description copied from interface:ComputeInstanceMetadataThe metadata as a map.- Specified by:
getMetadatain interfaceComputeInstanceMetadata- Returns:
- A map of metadata
-
getInterfaces
Description copied from interface:ComputeInstanceMetadataThe network interfaces attached to the compute instance.- Specified by:
getInterfacesin interfaceComputeInstanceMetadata- Returns:
- The
NetworkInterfaceinstances
-
getTags
Description copied from interface:ComputeInstanceMetadataThe tags attached to the instance.- Specified by:
getTagsin interfaceComputeInstanceMetadata- Returns:
- A map of tags
-
getName
Description copied from interface:ComputeInstanceMetadataThe name of the instance. Usually the same asComputeInstanceMetadata.getInstanceId(). Some cloud platforms assign unique IDs- Specified by:
getNamein interfaceComputeInstanceMetadata- Returns:
- The name of the instance
-
getRegion
- Specified by:
getRegionin interfaceComputeInstanceMetadata- Returns:
- The region of the instance
-
getInstanceId
- Specified by:
getInstanceIdin interfaceComputeInstanceMetadata- Returns:
- The instance id
-
getMachineType
- Specified by:
getMachineTypein interfaceComputeInstanceMetadata- Returns:
- The machine type
-
getAvailabilityZone
- Specified by:
getAvailabilityZonein interfaceComputeInstanceMetadata- Returns:
- The availability zone of the instance
-
getLocalHostname
- Specified by:
getLocalHostnamein interfaceComputeInstanceMetadata- Returns:
- The local host name of the instance
-
getPrivateHostname
- Specified by:
getPrivateHostnamein interfaceComputeInstanceMetadata- Returns:
- The private host name of the instance
-
getPublicIpV4
- Specified by:
getPublicIpV4in interfaceComputeInstanceMetadata- Returns:
- The public IP of the instance
-
getPublicIpV6
- Specified by:
getPublicIpV6in interfaceComputeInstanceMetadata- Returns:
- The public IP v6 of the instance
-
getPrivateIpV4
- Specified by:
getPrivateIpV4in interfaceComputeInstanceMetadata- Returns:
- The private IP of the instance
-
getPrivateIpV6
- Specified by:
getPrivateIpV6in interfaceComputeInstanceMetadata- Returns:
- The private IP v6 of the instance
-
getDescription
- Specified by:
getDescriptionin interfaceComputeInstanceMetadata- Returns:
- A description of the instance
-
getPublicHostname
- Specified by:
getPublicHostnamein interfaceComputeInstanceMetadata- Returns:
- The public host name of the instance
-
isCached
public boolean isCached()- Specified by:
isCachedin 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
-