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 Classes Modifier and Type Interface Description static class
MetadataReader.Default
A simple default implementation that reads metadata via http requests.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
hasMetadata()
Are we on a Google Compute Engine instance?String
readMetadata(String metadataPath)
Reads the specified sub-element out of the Google Compute Engine instance's metadata.
-
-
-
Method Detail
-
hasMetadata
boolean hasMetadata() throws IOException
Are we on a Google Compute Engine instance?- Throws:
IOException
-
readMetadata
String readMetadata(String metadataPath) throws IOException, ExecutorException
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
-
-