use of com.emc.storageos.model.customconfig.CustomConfigTypeList in project coprhd-controller by CoprHD.
the class CustomConfigService method getCustomConfigTypes.
/**
* List config types.
*
* @brief List of config types
* @return The list of config types.
*/
@GET
@Path("/types")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SYSTEM_ADMIN, Role.SYSTEM_MONITOR })
public CustomConfigTypeList getCustomConfigTypes() {
List<CustomConfigType> items = customConfigHandler.getCustomConfigTypes();
List<RelatedConfigTypeRep> types = new ArrayList<RelatedConfigTypeRep>();
for (CustomConfigType item : items) {
RelatedConfigTypeRep type = new RelatedConfigTypeRep();
// build config type Link
String service = ResourceTypeEnum.CONFIG_TYPE.getService();
StringBuilder build = (new StringBuilder(service)).append('/').append(item.getName());
type.setConfigName(item.getName());
try {
type.setSelfLink(new RestLinkRep("self", new URI(build.toString())));
} catch (URISyntaxException e) {
// it should not happen
}
types.add(type);
}
return new CustomConfigTypeList(types);
}
use of com.emc.storageos.model.customconfig.CustomConfigTypeList in project coprhd-controller by CoprHD.
the class CustomConfigs method getCustomConfigTypes.
public List<CustomConfigTypeRep> getCustomConfigTypes() {
CustomConfigTypeList list = client.get(CustomConfigTypeList.class, PathConstants.CUSTOM_CONFIG_TYPE_URL);
List<CustomConfigTypeRep> configTypes = new ArrayList<>();
for (RelatedConfigTypeRep configTypeRep : list.getConfigTypes()) {
CustomConfigTypeRep template = getCustomConfigType(configTypeRep.getConfigName());
configTypes.add(template);
}
return configTypes;
}
Aggregations