@Singleton @Requires(env="gcp") public class GoogleComputeInstanceMetadataResolver extends java.lang.Object implements ComputeInstanceMetadataResolver
ComputeInstanceMetadata for Google Cloud Platform.| Modifier and Type | Field and Description |
|---|---|
static java.lang.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 |
|---|---|
java.util.Optional<ComputeInstanceMetadata> |
resolve(Environment environment)
Resolves
ComputeInstanceMetadata for the current environment if possible. |
public static final java.lang.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 java.util.Optional<ComputeInstanceMetadata> resolve(Environment environment)
ComputeInstanceMetadataResolverComputeInstanceMetadata for the current environment if possible.resolve in interface ComputeInstanceMetadataResolverenvironment - The environmentComputeInstanceMetadata