public static Status fromValue(String state) { // Statuses are in free text form. These are the ones in CloudStack 3.0.4 source // https://github.com/CloudStack/CloudStack/blob/e2e76c70ec51bfb35d755371f6c33856cef8a277/server/src/com/cloud/api/ApiResponseHelper.java#L1968 if (Strings.isNullOrEmpty(state)) { return UNKNOWN; } else if (state.equals("Processing")) { return DOWNLOAD_IN_PROGRESS; } else if (state.endsWith("% Downloaded")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing Template")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing ISO")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Download Complete")) { return DOWNLOADED; } try { return valueOf(checkNotNull(state, "state")); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
public static Status fromValue(String state) { // Statuses are in free text form. These are the ones in CloudStack 3.0.4 source // https://github.com/CloudStack/CloudStack/blob/e2e76c70ec51bfb35d755371f6c33856cef8a277/server/src/com/cloud/api/ApiResponseHelper.java#L1968 if (Strings.isNullOrEmpty(state)) { return UNKNOWN; } else if (state.equals("Processing")) { return DOWNLOAD_IN_PROGRESS; } else if (state.endsWith("% Downloaded")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing Template")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing ISO")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Download Complete")) { return DOWNLOADED; } try { return valueOf(checkNotNull(state, "state")); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }
public static Status fromValue(String state) { // Statuses are in free text form. These are the ones in CloudStack 3.0.4 source // https://github.com/CloudStack/CloudStack/blob/e2e76c70ec51bfb35d755371f6c33856cef8a277/server/src/com/cloud/api/ApiResponseHelper.java#L1968 if (Strings.isNullOrEmpty(state)) { return UNKNOWN; } else if (state.equals("Processing")) { return DOWNLOAD_IN_PROGRESS; } else if (state.endsWith("% Downloaded")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing Template")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Installing ISO")) { return DOWNLOAD_IN_PROGRESS; } else if (state.equals("Download Complete")) { return DOWNLOADED; } try { return valueOf(checkNotNull(state, "state")); } catch (IllegalArgumentException e) { return UNRECOGNIZED; } }