Class OracleCloudMetadataConfiguration
java.lang.Object
io.micronaut.discovery.cloud.oraclecloud.OracleCloudMetadataConfiguration
- All Implemented Interfaces:
io.micronaut.core.util.Toggleable
@ConfigurationProperties("micronaut.application.oraclecloud.metadata")
@Requires(env="oraclecloud") @Requires(classes=io.micronaut.runtime.ApplicationConfiguration.class)
@Primary
public class OracleCloudMetadataConfiguration
extends Object
implements io.micronaut.core.util.Toggleable
Default configuration for retrieving Oracle Cloud metadata for
ComputePlatform.ORACLE_CLOUD
.- Since:
- 1.2.0
- Author:
- Todd Sharp
-
Field Summary
Modifier and TypeFieldDescriptionstatic final boolean
The default enable value.static final String
The default url value.static final String
static final String
static final int
The default IMDS version to use.static final String
static final String
Prefix for Oracle Cloud configuration metadata. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionDeprecated, for removal: This API element is subject to removal in a future version.Deprecated, for removal: This API element is subject to removal in a future version.UsegetUrl()
instead.getUrl()
Default value: "http://169.254.169.254/opc/v1/vnics/" or "http://169.254.169.254/opc/v2/vnics/", depending on the value ofv2Enabled
.boolean
boolean
boolean
void
setEnabled
(boolean enabled) Default value (true).void
setInstanceDocumentUrl
(String instanceDocumentUrl) Deprecated, for removal: This API element is subject to removal in a future version.UsesetUrl(String)
instead.void
setMetadataUrl
(String metadataUrl) Deprecated, for removal: This API element is subject to removal in a future version.UsesetUrl(String)
instead.void
Default value: "http://169.254.169.254/opc/v1/instance/" or "http://169.254.169.254/opc/v2/instance/", depending on the value ofv2Enabled
.void
setV1Enabled
(boolean v1Enabled) Default value:false
.void
setV2Enabled
(boolean v2Enabled) Default value:true
.void
setVnicUrl
(String vnicUrl)
-
Field Details
-
PREFIX
Prefix for Oracle Cloud configuration metadata.- See Also:
-
DEFAULT_ENABLED
public static final boolean DEFAULT_ENABLEDThe default enable value.- See Also:
-
DEFAULT_URL
The default url value.- See Also:
-
DEFAULT_V2_URL
- See Also:
-
DEFAULT_VNIC_URL
- See Also:
-
DEFAULT_V2_VNIC_URL
- See Also:
-
DEFAULT_VERSION
public static final int DEFAULT_VERSIONThe default IMDS version to use.- See Also:
-
-
Constructor Details
-
OracleCloudMetadataConfiguration
public OracleCloudMetadataConfiguration()
-
-
Method Details
-
isEnabled
public boolean isEnabled()- Specified by:
isEnabled
in interfaceio.micronaut.core.util.Toggleable
- Returns:
- Whether the Oracle Cloud configuration is enabled
-
setEnabled
public void setEnabled(boolean enabled) Default value (true).- Parameters:
enabled
- Enable or disable the Oracle Cloud configuration
-
getUrl
- Returns:
- The Url
-
getBaseUrl
- Returns:
- The base URL of the metadata service.
-
setUrl
Default value: "http://169.254.169.254/opc/v1/instance/" or "http://169.254.169.254/opc/v2/instance/", depending on the value ofv2Enabled
.- Parameters:
url
- The url
-
getMetadataUrl
Deprecated, for removal: This API element is subject to removal in a future version.UsegetUrl()
instead.- Returns:
- The metadata Url
-
setMetadataUrl
Deprecated, for removal: This API element is subject to removal in a future version.UsesetUrl(String)
instead.Deprecated. Useurl
instead.- Parameters:
metadataUrl
- The metadata Url
-
getInstanceDocumentUrl
Deprecated, for removal: This API element is subject to removal in a future version.UsegetUrl()
instead.- Returns:
- The instance document Url
-
setInstanceDocumentUrl
@Deprecated(since="3.6.0", forRemoval=true) public void setInstanceDocumentUrl(String instanceDocumentUrl) Deprecated, for removal: This API element is subject to removal in a future version.UsesetUrl(String)
instead.Deprecated. Useurl
instead.- Parameters:
instanceDocumentUrl
- The instance document Url
-
getVnicUrl
Default value: "http://169.254.169.254/opc/v1/vnics/" or "http://169.254.169.254/opc/v2/vnics/", depending on the value ofv2Enabled
.- Returns:
- The VNIC Url
-
setVnicUrl
- Parameters:
vnicUrl
- The instance document Url
-
isV1Enabled
public boolean isV1Enabled()- Returns:
- Whether the V1 metadata is enabled
-
setV1Enabled
public void setV1Enabled(boolean v1Enabled) Default value:false
.- Parameters:
v1Enabled
- Enable or disable the V1 metadata
-
isV2Enabled
public boolean isV2Enabled()- Returns:
- Whether the V2 metadata is enabled
-
setV2Enabled
public void setV2Enabled(boolean v2Enabled) Default value:true
.- Parameters:
v2Enabled
- Enable or disable the V2 metadata
-
getUrl()
instead.