use of com.emc.vipr.model.catalog.Reference in project coprhd-controller by CoprHD.
the class ApprovalsApi method approvals.
public static void approvals() {
List<Reference> approvals = Lists.newArrayList();
List<NamedRelatedResourceRep> allApprovals = getCatalogClient().approvals().listByUserTenant();
for (NamedRelatedResourceRep element : allApprovals) {
approvals.add(newApprovalReference(element.getId().toString()));
}
renderApi(approvals);
}
use of com.emc.vipr.model.catalog.Reference in project coprhd-controller by CoprHD.
the class ApprovalsApi method pending.
public static void pending() {
List<Reference> approvals = Lists.newArrayList();
List<ApprovalRestRep> pendingApprovals = getCatalogClient().approvals().search().byStatus(ApprovalRestRep.PENDING).run();
for (ApprovalRestRep request : pendingApprovals) {
approvals.add(newApprovalReference(request.getId().toString()));
}
renderApi(approvals);
}
use of com.emc.vipr.model.catalog.Reference in project coprhd-controller by CoprHD.
the class AssetOptionsApi method dependencies.
public static void dependencies(String asset, String service) {
// The 'service' may be the baseService or a service ID
ServiceDescriptorRestRep descriptor;
if (StringUtils.isEmpty(service)) {
error(Messages.get("AssetOptionsApi.serviceParameterIsRequired"));
}
if (service.startsWith("urn:")) {
CatalogServiceRestRep catalogService = CatalogServiceUtils.getCatalogService(uri(service));
descriptor = catalogService.getServiceDescriptor();
} else {
descriptor = ServiceDescriptorUtils.getDescriptor(service);
}
Set<String> allAssetTypes = ServiceDescriptorUtils.getAllAssetTypes(descriptor);
List<String> dependencies = calculateAssetDependencies(cleanAssetType(asset), allAssetTypes);
List<Reference> references = Lists.newArrayList();
for (String dependency : dependencies) {
references.add(newAssetOptionsReference(dependency));
}
renderApi(references);
}
use of com.emc.vipr.model.catalog.Reference in project coprhd-controller by CoprHD.
the class OrdersApi method allOrders.
@Restrict("TENANT_ADMIN")
public static void allOrders(String startTime, String endTime) {
List<? extends RelatedResourceRep> elements = queryOrders(startTime, endTime);
List<Reference> orders = Lists.newArrayList();
for (RelatedResourceRep element : elements) {
orders.add(newOrderReference(element.getId().toString()));
}
renderApi(orders);
}
use of com.emc.vipr.model.catalog.Reference 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);
}
Aggregations