Package io.micronaut.discovery.cloud.gcp
Class GoogleComputeMetadataConfiguration
java.lang.Object
io.micronaut.discovery.cloud.gcp.GoogleComputeMetadataConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("micronaut.application.gcp.metadata")
@Requires(env="gcp")
@Primary
public class GoogleComputeMetadataConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Configuration for computing metadata for
ComputePlatform.GOOGLE_COMPUTE
.- Since:
- 1.0
- Author:
- graemerocher
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
The default connect timeout in seconds.static final boolean
The default enable value.static final String
The default metadata url value.static final String
The default project metadata url value.static final int
The default read timeout in seconds.static final String
Prefix for Google Compute configuration. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
void
setConnectTimeout
(Duration connectTimeout) Default value (2).void
setEnabled
(boolean enabled) Default value (true).void
setMetadataUrl
(String metadataUrl) Default value ("http://metadata.google.internal/computeMetadata/v1/project/").void
setProjectMetadataUrl
(String projectMetadataUrl) Default value ("http://metadata.google.internal/project/v1/project/").void
setReadTimeout
(Duration readTimeout) Default value (5 seconds).
-
Field Details
-
PREFIX
Prefix for Google Compute configuration.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_METADATAURL
The default metadata url value.- See Also:
-
DEFAULT_PROJECTMETADATAURL
The default project metadata url value.- See Also:
-
DEFAULT_READTIMEOUT
public static final int DEFAULT_READTIMEOUTThe default read timeout in seconds.- See Also:
-
DEFAULT_CONNECTTIMEOUT
public static final int DEFAULT_CONNECTTIMEOUTThe default connect timeout in seconds.- See Also:
-
-
Constructor Details
-
GoogleComputeMetadataConfiguration
public GoogleComputeMetadataConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- Whether the Google Compute configuration is enabled
-
setEnabled
public void setEnabled(boolean enabled) Default value (true).- Parameters:
enabled
- Enable or disable the Google Compute configuration
-
getMetadataUrl
- Returns:
- The metadata Url
-
setMetadataUrl
Default value ("http://metadata.google.internal/computeMetadata/v1/project/").- Parameters:
metadataUrl
- The metadata Url
-
getProjectMetadataUrl
- Returns:
- The project metadata Url
-
setProjectMetadataUrl
Default value ("http://metadata.google.internal/project/v1/project/").- Parameters:
projectMetadataUrl
- The project metadata Url
-
getReadTimeout
- Returns:
- The read timeout
-
setReadTimeout
Default value (5 seconds).- Parameters:
readTimeout
- The read timeout
-
getConnectTimeout
- Returns:
- The connect timeout
-
setConnectTimeout
Default value (2).- Parameters:
connectTimeout
- The connect timeout
-