Package org.jclouds.compute.util
Class ComputeServiceUtils
- java.lang.Object
-
- org.jclouds.compute.util.ComputeServiceUtils
-
public class ComputeServiceUtils extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static PatternDELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
-
Constructor Summary
Constructors Constructor Description ComputeServiceUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NodeMetadataBuilderaddMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder, Map<String,String> map)static NodeMetadataBuilderaddMetadataAndParseTagsFromValuesOfEmptyString(NodeMetadataBuilder builder, Map<String,String> map)static StringcreateExecutionErrorMessage(Map<?,Exception> executionExceptions)static StringcreateNodeErrorMessage(Map<? extends NodeMetadata,? extends Throwable> failedNodes)static StatementexecHttpResponse(URI location)static StatementexecHttpResponse(HttpRequest request)build a shell script that invokes the contents of the http request in bash.static StatementextractTargzIntoDirectory(URI targz, String directory)static StatementextractTargzIntoDirectory(HttpRequest targz, String directory)build a shell script that invokes the contents of the http request in bash.static StatementextractZipIntoDirectory(URI zip, String directory)static StatementextractZipIntoDirectory(HttpRequest zip, String directory)build a shell script that invokes the contents of the http request in bash.static Iterable<? extends ComputeMetadata>filterByName(Iterable<? extends ComputeMetadata> nodes, String name)static StringformatStatus(ComputeMetadataIncludingStatus<?> resource)status as a string which optionally includes the backend statusstatic doublegetCores(Hardware input)static doublegetCoresAndSpeed(Hardware input)static Map<Integer,Integer>getPortRangesFromList(int... ports)static doublegetSpace(Hardware input)static StringgroupFromMapOrName(Map<String,String> metadataMap, String nodeName, GroupNamingConvention namingConvention)static Map<String,String>metadataAndTagsAsCommaDelimitedValue(TemplateOptions options)For cloud apis that need to namespace tags as the value of the keyjclouds.tagsstatic Map<String,String>metadataAndTagsAsValuesOfEmptyString(TemplateOptions options)For cloud apis that have a pattern of using empty strings as tags, return a map that contains that.static OsFamilyparseOsFamilyOrUnrecognized(String in)static StringparseVersionOrReturnEmptyString(OsFamily family, String in, Map<OsFamily,Map<String,String>> osVersionMap)
-
-
-
Field Detail
-
DELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
public static final Pattern DELIMITED_BY_HYPHEN_ENDING_IN_HYPHEN_HEX
-
-
Method Detail
-
formatStatus
public static String formatStatus(ComputeMetadataIncludingStatus<?> resource)
status as a string which optionally includes the backend status
-
execHttpResponse
public static Statement execHttpResponse(HttpRequest request)
build a shell script that invokes the contents of the http request in bash.- Returns:
- a shell script that will invoke the http request
-
extractTargzIntoDirectory
public static Statement extractTargzIntoDirectory(HttpRequest targz, String directory)
build a shell script that invokes the contents of the http request in bash.- Returns:
- a shell script that will invoke the http request
-
extractTargzIntoDirectory
public static Statement extractTargzIntoDirectory(URI targz, String directory)
-
extractZipIntoDirectory
public static Statement extractZipIntoDirectory(HttpRequest zip, String directory)
build a shell script that invokes the contents of the http request in bash.- Returns:
- a shell script that will invoke the http request
-
getCores
public static double getCores(Hardware input)
-
getCoresAndSpeed
public static double getCoresAndSpeed(Hardware input)
-
getSpace
public static double getSpace(Hardware input)
-
createExecutionErrorMessage
public static String createExecutionErrorMessage(Map<?,Exception> executionExceptions)
-
createNodeErrorMessage
public static String createNodeErrorMessage(Map<? extends NodeMetadata,? extends Throwable> failedNodes)
-
filterByName
public static Iterable<? extends ComputeMetadata> filterByName(Iterable<? extends ComputeMetadata> nodes, String name)
-
metadataAndTagsAsValuesOfEmptyString
public static Map<String,String> metadataAndTagsAsValuesOfEmptyString(TemplateOptions options)
For cloud apis that have a pattern of using empty strings as tags, return a map that contains that.
-
addMetadataAndParseTagsFromValuesOfEmptyString
public static NodeMetadataBuilder addMetadataAndParseTagsFromValuesOfEmptyString(NodeMetadataBuilder builder, Map<String,String> map)
-
metadataAndTagsAsCommaDelimitedValue
public static Map<String,String> metadataAndTagsAsCommaDelimitedValue(TemplateOptions options)
For cloud apis that need to namespace tags as the value of the keyjclouds.tags
-
addMetadataAndParseTagsFromCommaDelimitedValue
public static NodeMetadataBuilder addMetadataAndParseTagsFromCommaDelimitedValue(NodeMetadataBuilder builder, Map<String,String> map)
-
parseVersionOrReturnEmptyString
public static String parseVersionOrReturnEmptyString(OsFamily family, String in, Map<OsFamily,Map<String,String>> osVersionMap)
-
-