Package com.google.jenkins.plugins.util
Interface MetadataReader
- All Known Implementing Classes:
MetadataReader.Default
public interface MetadataReader
This helper utility is used for reading values out of a Google Compute Engine instance's attached
metadata service.
- Author:
- Matt Moore
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic class
A simple default implementation that reads metadata via http requests. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Are we on a Google Compute Engine instance?readMetadata
(String metadataPath) Reads the specified sub-element out of the Google Compute Engine instance's metadata.
-
Method Details
-
hasMetadata
Are we on a Google Compute Engine instance?- Throws:
IOException
-
readMetadata
Reads the specified sub-element out of the Google Compute Engine instance's metadata. These relative paths are expected to start with:- /instance/...
- /project/...
- Throws:
IOException
ExecutorException
-