Search in sources :

Example 26 with OrderRestRep

use of com.emc.vipr.model.catalog.OrderRestRep in project coprhd-controller by CoprHD.

the class Orders method resubmitOrder.

/**
 * Resubmits an order, creating a new copy with the same parameters.
 *
 * @param orderId
 *            the order ID.
 */
public static void resubmitOrder(@Required String orderId) {
    checkAuthenticity();
    OrderRestRep order = OrderUtils.getOrder(uri(orderId));
    try {
        addParametersToFlash(order);
    } catch (Exception e) {
        Logger.error(e, MessagesUtils.get("order.submitFailedWithDetail", e.getMessage()));
        flash.error(MessagesUtils.get("order.submitFailedWithDetail", e.getMessage()));
        Common.handleError();
    }
    Services.showForm(order.getCatalogService().getId().toString());
}
Also used : OrderRestRep(com.emc.vipr.model.catalog.OrderRestRep) FlashException(controllers.util.FlashException)

Example 27 with OrderRestRep

use of com.emc.vipr.model.catalog.OrderRestRep in project coprhd-controller by CoprHD.

the class ScheduledOrders method itemsJson.

public static void itemsJson(@As(",") String[] ids) {
    List<ScheduledOrderInfo> results = Lists.newArrayList();
    if (ids != null && ids.length > 0) {
        for (String id : ids) {
            if (StringUtils.isNotBlank(id)) {
                OrderRestRep order = OrderUtils.getOrder(uri(id));
                if (order != null) {
                    Models.checkAccess(order.getTenant());
                    results.add(new ScheduledOrderInfo(order));
                }
            }
        }
    }
    renderJSON(DataTablesSupport.toJson(results));
}
Also used : ScheduledOrderInfo(models.datatable.ScheduledOrdersDataTable.ScheduledOrderInfo) OrderRestRep(com.emc.vipr.model.catalog.OrderRestRep)

Aggregations

OrderRestRep (com.emc.vipr.model.catalog.OrderRestRep)27 ViPRCatalogClient2 (com.emc.vipr.client.ViPRCatalogClient2)7 ApprovalRestRep (com.emc.vipr.model.catalog.ApprovalRestRep)4 URI (java.net.URI)4 CatalogServiceRestRep (com.emc.vipr.model.catalog.CatalogServiceRestRep)3 OrderBulkRep (com.emc.vipr.model.catalog.OrderBulkRep)3 ArrayList (java.util.ArrayList)3 Order (com.emc.storageos.db.client.model.uimodels.Order)2 OrderAndParams (com.emc.storageos.db.client.model.uimodels.OrderAndParams)2 OrderParameter (com.emc.storageos.db.client.model.uimodels.OrderParameter)2 OrderCreateParam (com.emc.vipr.model.catalog.OrderCreateParam)2 ScheduledEventRestRep (com.emc.vipr.model.catalog.ScheduledEventRestRep)2 FlashException (controllers.util.FlashException)2 OrderFilter (com.emc.sa.api.mapper.OrderFilter)1 TimeSeriesConstraint (com.emc.storageos.db.client.constraint.TimeSeriesConstraint)1 Tags (com.emc.storageos.model.search.Tags)1 StorageOSUser (com.emc.storageos.security.authentication.StorageOSUser)1 ViPRHttpException (com.emc.vipr.client.exceptions.ViPRHttpException)1 ExecutionWindowRestRep (com.emc.vipr.model.catalog.ExecutionWindowRestRep)1 OrderInfo (com.emc.vipr.model.catalog.OrderInfo)1