@ConfigurationProperties(value="micronaut.application.gcp.metadata") @Requires(env="gcp") public class GoogleComputeMetadataConfiguration extends Object implements Toggleable
ComputePlatform.GOOGLE_COMPUTE
.Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_CONNECTTIMEOUT
The default connect timeout in seconds.
|
static boolean |
DEFAULT_ENABLED
The default enable value.
|
static String |
DEFAULT_METADATAURL
The default metadata url value.
|
static String |
DEFAULT_PROJECTMETADATAURL
The default project metadata url value.
|
static int |
DEFAULT_READTIMEOUT
The default read timeout in seconds.
|
static String |
PREFIX
Prefix for Google Compute configuration.
|
Constructor and Description |
---|
GoogleComputeMetadataConfiguration() |
Modifier and Type | Method and Description |
---|---|
Duration |
getConnectTimeout() |
String |
getMetadataUrl() |
String |
getProjectMetadataUrl() |
Duration |
getReadTimeout() |
boolean |
isEnabled() |
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).
|
public static final String PREFIX
public static final boolean DEFAULT_ENABLED
public static final String DEFAULT_METADATAURL
public static final String DEFAULT_PROJECTMETADATAURL
public static final int DEFAULT_READTIMEOUT
public static final int DEFAULT_CONNECTTIMEOUT
public boolean isEnabled()
isEnabled
in interface Toggleable
public void setEnabled(boolean enabled)
enabled
- Enable or disable the Google Compute configurationpublic String getMetadataUrl()
public void setMetadataUrl(String metadataUrl)
metadataUrl
- The metadata Urlpublic String getProjectMetadataUrl()
public void setProjectMetadataUrl(String projectMetadataUrl)
projectMetadataUrl
- The project metadata Urlpublic Duration getReadTimeout()
public void setReadTimeout(Duration readTimeout)
readTimeout
- The read timeoutpublic Duration getConnectTimeout()