use of jobs.vipr.TenantsCall in project coprhd-controller by CoprHD.
the class VCenters method renderTenantOptions.
private static void renderTenantOptions() {
if (TenantUtils.canReadAllTenantsForVcenters() && VCenterUtils.canUpdateVcenterACLs()) {
List<StringOption> tenantOptions = dataObjectOptions(await(new TenantsCall().asPromise()));
renderArgs.put("tenantOptions", tenantOptions);
List<StringOption> tenantOptionsWithNone = new ArrayList<StringOption>();
tenantOptionsWithNone.add(new StringOption(NullColumnValueGetter.getNullStr().toString(), "None"));
tenantOptionsWithNone.addAll(tenantOptions);
renderArgs.put("tenantOptionsWithNone", tenantOptionsWithNone);
}
}
use of jobs.vipr.TenantsCall in project coprhd-controller by CoprHD.
the class VirtualArrays method edit.
/**
* Shows the edit page for a virtual array form.
*
* @param virtualArray
* the virtual array form.
*/
private static void edit(VirtualArrayForm virtualArray) {
// Check edit of virtual array is called when guide is visible
JsonObject jobject = getCookieAsJson(VIPR_START_GUIDE);
String isGuideAdd = null;
if (jobject != null && jobject.get(GUIDE_VISIBLE) != null) {
isGuideAdd = jobject.get(GUIDE_VISIBLE).getAsString();
}
if (isGuideAdd != null && StringUtils.equalsIgnoreCase(isGuideAdd, "true")) {
renderArgs.put(GUIDE_VISIBLE, isGuideAdd);
}
Map<Boolean, String> autoSanZoningOptions = Maps.newHashMap();
autoSanZoningOptions.put(Boolean.TRUE, Messages.get("virtualArray.autoSanZoning.true"));
autoSanZoningOptions.put(Boolean.FALSE, Messages.get("virtualArray.autoSanZoning.false"));
renderArgs.put("autoSanZoningOptions", autoSanZoningOptions);
renderArgs.put("storageSystems", new VirtualArrayStorageSystemsDataTable());
renderArgs.put("virtualPools", new VirtualArrayVirtualPoolsDataTable());
if (TenantUtils.canReadAllTenants() && VirtualArrayUtils.canUpdateACLs()) {
renderArgs.put("tenantOptions", dataObjectOptions(await(new TenantsCall().asPromise())));
}
// Numbers for networks, ports and pools
if (!virtualArray.isNew()) {
renderArgs.put("networksCount", NetworkUtils.getNetworksByVirtualArray(virtualArray.id).size());
renderArgs.put("storagePortsCount", StoragePortUtils.getStoragePortsByVirtualArray(uri(virtualArray.id)).size());
renderArgs.put("storagePoolsCount", StoragePoolUtils.getStoragePoolsAssignedToVirtualArray(virtualArray.id).size());
}
render("@edit", virtualArray);
}
use of jobs.vipr.TenantsCall in project coprhd-controller by CoprHD.
the class BlockVirtualPools method addDynamicOptions.
private static void addDynamicOptions(BlockVirtualPoolForm vpool) {
// Runs all queries in jobs
Promise<List<VirtualArrayRestRep>> virtualArrays = new VirtualArraysCall().asPromise();
Promise<List<String>> autoTierPolicies = vpool.autoTierPolicyNames().asPromise();
Promise<List<BlockVirtualPoolRestRep>> connectedVirtualPools = vpool.connectedVirtualPools().asPromise();
Promise<List<VirtualArrayRestRep>> haVirtualArrays = vpool.highAvailabilityVirtualArrays().asPromise();
Promise<List<BlockVirtualPoolRestRep>> haVirtualPools = vpool.highAvailabilityVirtualPools().asPromise();
Promise<List<VirtualArrayRestRep>> rpVirtualArrays = vpool.recoverPointVirtualArrays().asPromise();
Promise<List<VirtualArrayRestRep>> rpJournalVirtualArrays = vpool.recoverPointVirtualArrays().asPromise();
Promise<List<VirtualArrayRestRep>> sourceJournalVirtualArrays = vpool.sourceJournalVirtualArrays().asPromise();
Promise<List<VirtualArrayRestRep>> haJournalVirtualArrays = vpool.haRpJournalVirtualArrays().asPromise();
Promise<List<BlockVirtualPoolRestRep>> sourceJournalVirtualPools = vpool.sourceRpJournalVirtualPools().asPromise();
Promise<List<BlockVirtualPoolRestRep>> haJournalVirtualPools = vpool.haRpJournalVirtualPools().asPromise();
Promise<List<VirtualArrayRestRep>> srdfVirtualArrays = vpool.srdfVirtualArrays().asPromise();
if (TenantUtils.canReadAllTenants() && VirtualPoolUtils.canUpdateACLs()) {
addDataObjectOptions("tenantOptions", new TenantsCall().asPromise());
}
addDataObjectOptions("virtualArrayOptions", virtualArrays);
addStringOptions("autoTierPolicyOptions", autoTierPolicies);
addDataObjectOptions("continuousCopyVirtualPoolOptions", connectedVirtualPools);
addDataObjectOptions("haVirtualArrayOptions", haVirtualArrays);
addDataObjectOptions("haVirtualPoolOptions", haVirtualPools);
addDataObjectOptions("rpVirtualArrayOptions", rpVirtualArrays);
addDataObjectOptions("rpJournalVirtualArrayOptions", rpJournalVirtualArrays);
addDataObjectOptions("vpoolSourceJournalVirtualArrayOptions", sourceJournalVirtualArrays);
addDataObjectOptions("vpoolSourceJournalVirtualPoolOptions", sourceJournalVirtualPools);
addDataObjectOptions("vpoolHAJournalVirtualArrayOptions", haJournalVirtualArrays);
addDataObjectOptions("vpoolHAJournalVirtualPoolOptions", haJournalVirtualPools);
addDataObjectOptions("srdfVirtualArrayOptions", srdfVirtualArrays);
addDataObjectOptions("srdfVirtualPoolOptions", connectedVirtualPools);
}
use of jobs.vipr.TenantsCall in project coprhd-controller by CoprHD.
the class FileVirtualPools method addDynamicOptions.
private static void addDynamicOptions(FileVirtualPoolForm vpool) {
// Runs all queries in jobs
Promise<List<VirtualArrayRestRep>> virtualArrays = new VirtualArraysCall().asPromise();
if (TenantUtils.canReadAllTenants() && VirtualPoolUtils.canUpdateACLs()) {
addDataObjectOptions("tenantOptions", new TenantsCall().asPromise());
}
addDataObjectOptions("virtualArrayOptions", virtualArrays);
}
use of jobs.vipr.TenantsCall in project coprhd-controller by CoprHD.
the class ObjectVirtualPools method addDynamicOptions.
private static void addDynamicOptions(ObjectVirtualPoolForm vpool) {
// Runs all queries in jobs
Promise<List<VirtualArrayRestRep>> virtualArrays = new VirtualArraysCall().asPromise();
if (TenantUtils.canReadAllTenants() && VirtualPoolUtils.canUpdateACLs()) {
addDataObjectOptions("tenantOptions", new TenantsCall().asPromise());
}
addDataObjectOptions("virtualArrayOptions", virtualArrays);
}
Aggregations