use of com.emc.vipr.client.ViPRCatalogClient2 in project coprhd-controller by CoprHD.
the class OrderUtils method getScheduledOrders.
public static List<OrderRestRep> getScheduledOrders(URI tenantId) {
ViPRCatalogClient2 catalog = getCatalogClient();
List<OrderRestRep> scheduledOrders = catalog.orders().search().byStatus(OrderStatus.SCHEDULED.name(), tenantId).run();
return scheduledOrders;
}
use of com.emc.vipr.client.ViPRCatalogClient2 in project coprhd-controller by CoprHD.
the class OrderUtils method getOrder.
public static OrderRestRep getOrder(URI id) {
ViPRCatalogClient2 catalog = getCatalogClient();
OrderRestRep order = null;
try {
order = catalog.orders().get(id);
} catch (ViPRHttpException e) {
if (e.getHttpCode() == 404) {
order = null;
} else {
throw e;
}
}
return order;
}
use of com.emc.vipr.client.ViPRCatalogClient2 in project coprhd-controller by CoprHD.
the class OrderUtils method getErrorOrders.
public static List<OrderRestRep> getErrorOrders(URI tenantId) {
ViPRCatalogClient2 catalog = getCatalogClient();
List<OrderRestRep> scheduledOrders = catalog.orders().search().byStatus(OrderStatus.ERROR.name(), tenantId).run();
return scheduledOrders;
}
use of com.emc.vipr.client.ViPRCatalogClient2 in project coprhd-controller by CoprHD.
the class OrdersApi method orders.
public static void orders() {
ViPRCatalogClient2 catalog = getCatalogClient();
List<Reference> orders = Lists.newArrayList();
for (NamedRelatedResourceRep element : catalog.orders().listByUserTenant()) {
orders.add(newOrderReference(element.getId().toString()));
}
renderApi(orders);
}
use of com.emc.vipr.client.ViPRCatalogClient2 in project coprhd-controller by CoprHD.
the class BourneUtil method getCatalogClient.
public static ViPRCatalogClient2 getCatalogClient() {
String authToken = Security.getAuthToken();
String key = String.format("ViPRCatalogClient.%s", authToken);
ViPRCatalogClient2 client = getRequestArg(key);
if (client == null) {
Logger.debug("Creating new ViPRCatalogClient");
client = new ViPRCatalogClient2(getClientConfig()).withAuthToken(authToken);
setRequestArg(key, client);
} else {
Logger.debug("Returning cached ViPRCatalogClient");
}
return client;
}
Aggregations