Search in sources :

Example 1 with TenantsCall

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);
    }
}
Also used : StringOption(util.StringOption) TenantsCall(jobs.vipr.TenantsCall) ArrayList(java.util.ArrayList)

Example 2 with TenantsCall

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);
}
Also used : TenantsCall(jobs.vipr.TenantsCall) JsonObject(com.google.gson.JsonObject)

Example 3 with TenantsCall

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);
}
Also used : VirtualArraysCall(jobs.vipr.VirtualArraysCall) TenantsCall(jobs.vipr.TenantsCall) StorageSystemTypeList(com.emc.storageos.model.storagesystem.type.StorageSystemTypeList) List(java.util.List) ArrayList(java.util.ArrayList)

Example 4 with TenantsCall

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);
}
Also used : VirtualArraysCall(jobs.vipr.VirtualArraysCall) TenantsCall(jobs.vipr.TenantsCall) List(java.util.List)

Example 5 with TenantsCall

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);
}
Also used : VirtualArraysCall(jobs.vipr.VirtualArraysCall) TenantsCall(jobs.vipr.TenantsCall) List(java.util.List)

Aggregations

TenantsCall (jobs.vipr.TenantsCall)5 List (java.util.List)3 VirtualArraysCall (jobs.vipr.VirtualArraysCall)3 ArrayList (java.util.ArrayList)2 StorageSystemTypeList (com.emc.storageos.model.storagesystem.type.StorageSystemTypeList)1 JsonObject (com.google.gson.JsonObject)1 StringOption (util.StringOption)1