Search in sources :

Example 51 with Order

use of com.emc.storageos.db.client.model.uimodels.Order in project coprhd-controller by CoprHD.

the class SampleServiceRunner method main.

public static void main(String[] args) {
    Order order = ServiceRunner.executeOrder("SampleService", "text=Hello World", "number=42", "choice=No Choice", "rollback=false");
    ServiceRunner.dumpOrder(order);
}
Also used : Order(com.emc.storageos.db.client.model.uimodels.Order)

Example 52 with Order

use of com.emc.storageos.db.client.model.uimodels.Order in project coprhd-controller by CoprHD.

the class ServiceRunner method createOrder.

public static Order createOrder(String name, Map<String, String> params) {
    init();
    Order order = new Order();
    order.setCatalogServiceId(createService(name).getId());
    order = save(order);
    for (Map.Entry<String, String> entry : params.entrySet()) {
        OrderParameter param = createParam(entry.getKey(), entry.getValue());
        param.setOrderId(order.getId());
        getModels().save(param);
    }
    return order;
}
Also used : Order(com.emc.storageos.db.client.model.uimodels.Order) OrderParameter(com.emc.storageos.db.client.model.uimodels.OrderParameter) Map(java.util.Map)

Example 53 with Order

use of com.emc.storageos.db.client.model.uimodels.Order in project coprhd-controller by CoprHD.

the class ServiceRunner method executeOrder.

public static Order executeOrder(String name, String... params) {
    Order order = createOrder(name, params);
    getEngine().executeOrder(order);
    return order;
}
Also used : Order(com.emc.storageos.db.client.model.uimodels.Order)

Aggregations

Order (com.emc.storageos.db.client.model.uimodels.Order)53 Test (org.junit.Test)15 StorageOSUser (com.emc.storageos.security.authentication.StorageOSUser)12 URI (java.net.URI)12 Path (javax.ws.rs.Path)11 Produces (javax.ws.rs.Produces)9 DatabaseException (com.emc.storageos.db.exceptions.DatabaseException)8 OrderParameter (com.emc.storageos.db.client.model.uimodels.OrderParameter)7 GET (javax.ws.rs.GET)7 AbstractExecutionService (com.emc.sa.engine.service.AbstractExecutionService)6 ExecutionService (com.emc.sa.engine.service.ExecutionService)6 NamedURI (com.emc.storageos.db.client.model.NamedURI)6 ServiceNotFoundException (com.emc.sa.engine.service.ServiceNotFoundException)5 Date (java.util.Date)5 ModelClient (com.emc.sa.model.dao.ModelClient)4 TimeSeriesConstraint (com.emc.storageos.db.client.constraint.TimeSeriesConstraint)4 ExecutionState (com.emc.storageos.db.client.model.uimodels.ExecutionState)4 Consumes (javax.ws.rs.Consumes)4 BaseModelTest (com.emc.sa.model.BaseModelTest)3 NamedElementQueryResultList (com.emc.storageos.db.client.constraint.NamedElementQueryResultList)3