Package io.micronaut.discovery.cloud.gcp
Class GoogleComputeInstanceMetadataResolver
java.lang.Object
io.micronaut.discovery.cloud.gcp.GoogleComputeInstanceMetadataResolver
- All Implemented Interfaces:
io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
@Singleton
@Requires(env="gcp") @Requires(property="micronaut.application.gcp.metadata.enabled",value="true",defaultValue="true")
@Primary
public class GoogleComputeInstanceMetadataResolver
extends Object
implements io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
Resolves
ComputeInstanceMetadata
for Google Cloud Platform.- Since:
- 1.0
- Author:
- rvanderwerf, Graeme Rocher
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstruct with default settings.GoogleComputeInstanceMetadataResolver
(io.micronaut.json.JsonMapper jsonMapper, GoogleComputeMetadataConfiguration configuration) -
Method Summary
-
Field Details
-
HEADER_METADATA_FLAVOR
Constant for Metadata flavor.- See Also:
-
-
Constructor Details
-
GoogleComputeInstanceMetadataResolver
@Inject public GoogleComputeInstanceMetadataResolver(io.micronaut.json.JsonMapper jsonMapper, GoogleComputeMetadataConfiguration configuration) - Parameters:
jsonMapper
- To read and write JSONconfiguration
- The configuration for computing Google Metadata
-
GoogleComputeInstanceMetadataResolver
public GoogleComputeInstanceMetadataResolver()Construct with default settings.
-
-
Method Details
-
resolve
public Optional<io.micronaut.discovery.cloud.ComputeInstanceMetadata> resolve(io.micronaut.context.env.Environment environment) - Specified by:
resolve
in interfaceio.micronaut.discovery.cloud.ComputeInstanceMetadataResolver
-