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 Details

    • HEADER_METADATA_FLAVOR

      public static final String 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 JSON
      configuration - 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 interface io.micronaut.discovery.cloud.ComputeInstanceMetadataResolver