Search in sources :

Example 1 with HostDetails

use of com.cloud.api.ApiConstants.HostDetails in project CloudStack-archive by CloudStack-extras.

the class ListHostsCmd method getDetails.

public EnumSet<HostDetails> getDetails() throws InvalidParameterValueException {
    EnumSet<HostDetails> dv;
    if (viewDetails == null || viewDetails.size() <= 0) {
        dv = EnumSet.of(HostDetails.all);
    } else {
        try {
            ArrayList<HostDetails> dc = new ArrayList<HostDetails>();
            for (String detail : viewDetails) {
                dc.add(HostDetails.valueOf(detail));
            }
            dv = EnumSet.copyOf(dc);
        } catch (IllegalArgumentException e) {
            throw new InvalidParameterValueException("The details parameter contains a non permitted value. The allowed values are " + EnumSet.allOf(HostDetails.class));
        }
    }
    return dv;
}
Also used : InvalidParameterValueException(com.cloud.exception.InvalidParameterValueException) HostDetails(com.cloud.api.ApiConstants.HostDetails) ArrayList(java.util.ArrayList)

Aggregations

HostDetails (com.cloud.api.ApiConstants.HostDetails)1 InvalidParameterValueException (com.cloud.exception.InvalidParameterValueException)1 ArrayList (java.util.ArrayList)1