Search in sources :

Example 6 with VirtualDataCenterList

use of com.emc.storageos.model.vdc.VirtualDataCenterList in project coprhd-controller by CoprHD.

the class VirtualDataCenterService method getVirtualDataCenters.

/**
 * Get Virtual Data Centers
 * @brief List VDC names and IDs
 * @return
 */
@GET
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
public VirtualDataCenterList getVirtualDataCenters() {
    VirtualDataCenterList vdcList = new VirtualDataCenterList();
    List<URI> ids = _dbClient.queryByType(VirtualDataCenter.class, true);
    Iterator<VirtualDataCenter> iter = _dbClient.queryIterativeObjects(VirtualDataCenter.class, ids);
    while (iter.hasNext()) {
        vdcList.getVirtualDataCenters().add(toNamedRelatedResource(iter.next()));
    }
    return vdcList;
}
Also used : VirtualDataCenterList(com.emc.storageos.model.vdc.VirtualDataCenterList) URI(java.net.URI) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET)

Example 7 with VirtualDataCenterList

use of com.emc.storageos.model.vdc.VirtualDataCenterList in project coprhd-controller by CoprHD.

the class InternalVdcServiceClient method listVdc.

/**
 * List all vdc uuid
 *
 * @return
 */
public VirtualDataCenterList listVdc() {
    WebResource rRoot = createRequest(INTERNAL_VDC_ROOT);
    VirtualDataCenterList resp = null;
    try {
        resp = addSignature(rRoot).get(VirtualDataCenterList.class);
    } catch (UniformInterfaceException e) {
        _log.warn("could not list vdc. Err:{}", e);
    }
    return resp;
}
Also used : UniformInterfaceException(com.sun.jersey.api.client.UniformInterfaceException) VirtualDataCenterList(com.emc.storageos.model.vdc.VirtualDataCenterList) WebResource(com.sun.jersey.api.client.WebResource)

Aggregations

VirtualDataCenterList (com.emc.storageos.model.vdc.VirtualDataCenterList)7 URI (java.net.URI)5 NamedRelatedResourceRep (com.emc.storageos.model.NamedRelatedResourceRep)3 Test (org.junit.Test)3 VirtualDataCenterRestRep (com.emc.storageos.model.vdc.VirtualDataCenterRestRep)2 ClientResponse (com.sun.jersey.api.client.ClientResponse)2 GET (javax.ws.rs.GET)2 Produces (javax.ws.rs.Produces)2 VirtualDataCenter (com.emc.storageos.db.client.model.VirtualDataCenter)1 TaskResourceRep (com.emc.storageos.model.TaskResourceRep)1 RoleAssignmentChanges (com.emc.storageos.model.auth.RoleAssignmentChanges)1 RoleAssignmentEntry (com.emc.storageos.model.auth.RoleAssignmentEntry)1 VirtualDataCenterAddParam (com.emc.storageos.model.vdc.VirtualDataCenterAddParam)1 UniformInterfaceException (com.sun.jersey.api.client.UniformInterfaceException)1 WebResource (com.sun.jersey.api.client.WebResource)1