Search in sources :

Example 1 with DecommissionedResources

use of com.emc.storageos.model.varray.DecommissionedResources in project coprhd-controller by CoprHD.

the class StorageProviderService method getDecommissionedResources.

/**
 * Get zone role assignments
 *
 * @brief List zone role assignments
 * @return Role assignment details
 */
@GET
@Path("/deactivated-systems")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SECURITY_ADMIN, Role.RESTRICTED_SECURITY_ADMIN })
public DecommissionedResources getDecommissionedResources() {
    List<URI> resList = _dbClient.queryByType(DecommissionedResource.class, true);
    DecommissionedResources results = new DecommissionedResources();
    for (URI res : resList) {
        DecommissionedResource resource = _dbClient.queryObject(DecommissionedResource.class, res);
        if ("StorageSystem".equals(resource.getType())) {
            results.addResource(map(resource));
        }
    }
    return results;
}
Also used : DecommissionedResource(com.emc.storageos.db.client.model.DecommissionedResource) URI(java.net.URI) DecommissionedResources(com.emc.storageos.model.varray.DecommissionedResources) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Example 2 with DecommissionedResources

use of com.emc.storageos.model.varray.DecommissionedResources in project coprhd-controller by CoprHD.

the class SMISProviderService method getDecommissionedResources.

/**
 * Get zone role assignments
 * The method is deprecated. Use /vdc/storage-providers/deactivated-systems
 *
 * @brief List zone role assignments
 * @return Role assignment details
 */
@GET
@Path("/deactivated-systems")
@Produces({ MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON })
@CheckPermission(roles = { Role.SECURITY_ADMIN })
public DecommissionedResources getDecommissionedResources() {
    List<URI> resList = _dbClient.queryByType(DecommissionedResource.class, true);
    DecommissionedResources results = new DecommissionedResources();
    for (URI res : resList) {
        DecommissionedResource resource = _dbClient.queryObject(DecommissionedResource.class, res);
        if ("StorageSystem".equals(resource.getType())) {
            results.addResource(map(resource));
        }
    }
    return results;
}
Also used : DecommissionedResource(com.emc.storageos.db.client.model.DecommissionedResource) URI(java.net.URI) DecommissionedResources(com.emc.storageos.model.varray.DecommissionedResources) Path(javax.ws.rs.Path) Produces(javax.ws.rs.Produces) GET(javax.ws.rs.GET) CheckPermission(com.emc.storageos.security.authorization.CheckPermission)

Aggregations

DecommissionedResource (com.emc.storageos.db.client.model.DecommissionedResource)2 DecommissionedResources (com.emc.storageos.model.varray.DecommissionedResources)2 CheckPermission (com.emc.storageos.security.authorization.CheckPermission)2 URI (java.net.URI)2 GET (javax.ws.rs.GET)2 Path (javax.ws.rs.Path)2 Produces (javax.ws.rs.Produces)2