use of com.emc.vipr.model.catalog.ServiceDescriptorRestRep in project coprhd-controller by CoprHD.
the class ServiceDescriptorService method getServiceDescriptors.
/**
* List service descriptors
*
* @prereq none
* @brief List service descriptors
* @return List of service descriptors
*/
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@Path("")
public ServiceDescriptorList getServiceDescriptors() {
Collection<ServiceDescriptor> descriptors = this.serviceDescriptors.listDescriptors(Locale.getDefault());
descriptors.addAll(workflowServiceDescriptor.listDescriptors());
List<ServiceDescriptorRestRep> serviceDescriptors = Lists.newArrayList();
for (ServiceDescriptor descriptor : descriptors) {
serviceDescriptors.add(map(descriptor));
}
ServiceDescriptorList serviceDescriptorList = new ServiceDescriptorList(serviceDescriptors);
return serviceDescriptorList;
}
use of com.emc.vipr.model.catalog.ServiceDescriptorRestRep in project coprhd-controller by CoprHD.
the class ServiceDescriptorMapper method map.
public static ServiceDescriptorRestRep map(ServiceDescriptor from) {
if (from == null) {
return null;
}
ServiceDescriptorRestRep to = new ServiceDescriptorRestRep();
to.setCategory(from.getCategory());
to.setDescription(from.getDescription());
to.setDestructive(from.isDestructive());
to.setUseModal(from.isUseModal());
to.setModalTitle(from.getModalTitle());
to.setServiceId(from.getServiceId());
to.setTitle(from.getTitle());
to.setRoles(from.getRoles());
to.getItems().addAll(map(from.getItems().values()));
return to;
}
use of com.emc.vipr.model.catalog.ServiceDescriptorRestRep in project coprhd-controller by CoprHD.
the class CatalogApi method createAndValidateOrder.
private static OrderCreateParam createAndValidateOrder(String serviceId) {
CatalogServiceRestRep service = CatalogServiceUtils.getCatalogService(uri(serviceId));
ServiceDescriptorRestRep descriptor = service.getServiceDescriptor();
// Filter out actual Service Parameters
Map<String, String> parameters = parseParameters(service, descriptor);
if (Validation.hasErrors()) {
response.status = HttpStatus.SC_BAD_REQUEST;
renderApi(getValidationErrors());
}
// Create request and perform selection
OrderCreateParam order = createOrder(service, descriptor, parameters);
return order;
}
use of com.emc.vipr.model.catalog.ServiceDescriptorRestRep in project coprhd-controller by CoprHD.
the class Orders method receipt.
public static void receipt(String orderId) {
OrderDetails details = new OrderDetails(orderId);
Models.checkAccess(details.order.getTenant());
fetchData(details);
ServiceDescriptorRestRep descriptor = details.catalogService.getServiceDescriptor();
addBreadCrumbToRenderArgs(id(details.order.getTenant()), details.catalogService);
render(orderId, details, descriptor);
}
Aggregations