@Singleton @Requires(env="gcp") public class GoogleComputeInstanceMetadataResolver extends Object implements ComputeInstanceMetadataResolver
ComputeInstanceMetadata for Google Cloud Platform.| Modifier and Type | Field and Description |
|---|---|
static String |
HEADER_METADATA_FLAVOR
Constant for Metadata flavor.
|
| Constructor and Description |
|---|
GoogleComputeInstanceMetadataResolver()
Construct with default settings.
|
GoogleComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper,
GoogleComputeMetadataConfiguration configuration) |
| Modifier and Type | Method and Description |
|---|---|
Optional<ComputeInstanceMetadata> |
resolve(Environment environment)
Resolves
ComputeInstanceMetadata for the current environment if possible. |
public static final String HEADER_METADATA_FLAVOR
@Inject public GoogleComputeInstanceMetadataResolver(com.fasterxml.jackson.databind.ObjectMapper objectMapper, GoogleComputeMetadataConfiguration configuration)
objectMapper - To read and write JSONconfiguration - The configuration for computing Google Metadatapublic GoogleComputeInstanceMetadataResolver()
public Optional<ComputeInstanceMetadata> resolve(Environment environment)
ComputeInstanceMetadataResolverComputeInstanceMetadata for the current environment if possible.resolve in interface ComputeInstanceMetadataResolverenvironment - The environmentComputeInstanceMetadata